Fix for --sql-file with comment lines

This commit is contained in:
Miroslav Štampar committed 2026-11-12 14:32:41 +01:00
1 parent b48a14a63b
commit 7827b2c389
2 files changed
+2 -1

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.34"
VERSION = "1.10.11.35"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
+1
View File
@@ -152,6 +152,7 @@ class Custom(object):
# User SQL is not a bundled procedure template: preserve literals and percent tokens.
snippet = readCachedFileContent(filename)
snippet = "\n".join(_ for _ in snippet.split("\n") if not re.match(r"\s*(--|#)", _)) # Note: only whole comment lines (literals stay intact)
queries = [_.strip() for _ in splitFields(snippet, delimiter=';' if zeroDepthSearch(snippet, ';') else '\n') if _.strip()]
if queries and all(query.upper().startswith("SELECT") for query in queries):