From 0ad0d19ff4a5dab7b8d91ba9847bfa63390e7d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Zaj=C4=85c?= Date: Sun, 5 Nov 2023 22:31:09 +0100 Subject: [PATCH] more sql dumps --- artemis/reporting/modules/bruter/classifier.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/artemis/reporting/modules/bruter/classifier.py b/artemis/reporting/modules/bruter/classifier.py index d5bf02a12..7327bfa22 100644 --- a/artemis/reporting/modules/bruter/classifier.py +++ b/artemis/reporting/modules/bruter/classifier.py @@ -92,8 +92,14 @@ def is_sql_dump(found_url: FoundURL) -> bool: if "sql dump" in found_url.content_prefix.lower(): return True - if "\ncreate table" in found_url.content_prefix.lower(): - return True + if any([ + # strip() to allow lines starting with whitespace + line.strip().startswith("create table") or + line.strip().startswith("alter table") or + line.strip().startswith("insert into") + for line in found_url.content_prefix.lower().split("\n") + ]): + return True return False