Skip to content

Commit 53de0e8

Browse files
committed
Implements sqlmapproject#1442
1 parent 29edb4f commit 53de0e8

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

lib/controller/checks.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ def checkSqlInjection(place, parameter, value):
207207
logger.debug(debugMsg)
208208
continue
209209

210+
# Skip tests if title, vector or DBMS is included by the
211+
# given skip filter
212+
if conf.testSkip and any(conf.testSkip in str(item) or \
213+
re.search(conf.testSkip, str(item), re.I) for item in \
214+
(test.title, test.vector, payloadDbms)):
215+
debugMsg = "skipping test '%s' because its " % title
216+
debugMsg += "name/vector/DBMS is included by the given skip filter"
217+
logger.debug(debugMsg)
218+
continue
219+
210220
if payloadDbms is not None:
211221
# Skip DBMS-specific test if it does not match the user's
212222
# provided DBMS

lib/core/option.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,10 @@ def _cleanupOptions():
16341634
conf.testFilter = conf.testFilter.strip('*+')
16351635
conf.testFilter = re.sub(r"([^.])([*+])", "\g<1>.\g<2>", conf.testFilter)
16361636

1637+
if conf.testSkip:
1638+
conf.testSkip = conf.testSkip.strip('*+')
1639+
conf.testSkip = re.sub(r"([^.])([*+])", "\g<1>.\g<2>", conf.testSkip)
1640+
16371641
if "timeSec" not in kb.explicitSettings:
16381642
if conf.tor:
16391643
conf.timeSec = 2 * conf.timeSec

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
"saveConfig": "string",
206206
"scope": "string",
207207
"testFilter": "string",
208+
"testSkip": "string",
208209
"updateAll": "boolean",
209210
},
210211

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ def cmdLineParser(argv=None):
674674
general.add_option("--test-filter", dest="testFilter",
675675
help="Select tests by payloads and/or titles (e.g. ROW)")
676676

677+
general.add_option("--test-skip", dest="testSkip",
678+
help="Skip tests by payloads and/or titles (e.g. BENCHMARK)")
679+
677680
general.add_option("--update", dest="updateAll",
678681
action="store_true",
679682
help="Update sqlmap")

sqlmap.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ scope =
708708
# Select tests by payloads and/or titles (e.g. ROW)
709709
testFilter =
710710

711+
# Skip tests by payloads and/or titles (e.g. BENCHMARK)
712+
testSkip =
713+
711714
# Update sqlmap.
712715
# Valid: True or False
713716
updateAll = False

0 commit comments

Comments
 (0)