Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76584ff

Browse files
committed
unhidding --test-filter
1 parent d2dd47f commit 76584ff

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

lib/controller/checks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def checkSqlInjection(place, parameter, value):
139139
continue
140140

141141
# Skip tests if title is not included by the given filter
142-
if conf.testFilter:
143-
if not any(re.search(conf.testFilter, str(item), re.I) for item in [test.title, test.vector,\
142+
if conf.tstF:
143+
if not any(re.search(conf.tstF, str(item), re.I) for item in [test.title, test.vector,\
144144
test.details.dbms if "details" in test and "dbms" in test.details else ""]):
145145
debugMsg = "skipping test '%s' because " % title
146146
debugMsg += "its name/vector/dbms is not included by the given filter"

lib/core/option.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,9 +1324,9 @@ class _(unicode): pass
13241324
if conf.dbms:
13251325
conf.dbms = conf.dbms.capitalize()
13261326

1327-
if conf.testFilter:
1328-
if not any([char in conf.testFilter for char in ('.', ')', '(', ']', '[')]):
1329-
conf.testFilter = conf.testFilter.replace('*', '.*')
1327+
if conf.tstF:
1328+
if not any([char in conf.tstF for char in ('.', ')', '(', ']', '[')]):
1329+
conf.tstF = conf.tstF.replace('*', '.*')
13301330

13311331
if conf.timeSec not in kb.explicitSettings:
13321332
if conf.tor:

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"mobile": "boolean",
194194
"pageRank": "boolean",
195195
"smart": "boolean",
196+
"tstF": "string",
196197
"wizard": "boolean",
197198
"verbose": "integer"
198199
},

lib/parse/cmdline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ def cmdLineParser():
619619
action="store_true",
620620
help="Conduct through tests only if positive heuristic(s)")
621621

622+
miscellaneous.add_option("--test-filter", dest="tstF",
623+
help="Select tests by payloads and/or titles (e.g. ROW)")
624+
622625
miscellaneous.add_option("--wizard", dest="wizard",
623626
action="store_true",
624627
help="Simple wizard interface for beginner users")
@@ -642,9 +645,6 @@ def cmdLineParser():
642645
parser.add_option("--run-case", dest="runCase", type="int",
643646
help=SUPPRESS_HELP)
644647

645-
parser.add_option("--test-filter", dest="testFilter",
646-
help=SUPPRESS_HELP)
647-
648648
parser.add_option_group(target)
649649
parser.add_option_group(request)
650650
parser.add_option_group(optimization)

sqlmap.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ pageRank = False
656656
# Valid: True or False
657657
smart = False
658658

659+
# Select tests by payloads and/or titles (e.g. ROW)
660+
tstF =
661+
659662
# Simple wizard interface for beginner users.
660663
# Valid: True or False
661664
wizard = False

0 commit comments

Comments
 (0)