From 76584ff0fa8b958f1bffb1ef10e1842f6b3bb51b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 14 Jun 2012 14:36:53 +0000 Subject: [PATCH] unhidding --test-filter --- lib/controller/checks.py | 4 ++-- lib/core/option.py | 6 +++--- lib/core/optiondict.py | 1 + lib/parse/cmdline.py | 6 +++--- sqlmap.conf | 3 +++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index f81f5333c..daa4af7d0 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -139,8 +139,8 @@ def checkSqlInjection(place, parameter, value): continue # Skip tests if title is not included by the given filter - if conf.testFilter: - if not any(re.search(conf.testFilter, str(item), re.I) for item in [test.title, test.vector,\ + if conf.tstF: + if not any(re.search(conf.tstF, str(item), re.I) for item in [test.title, test.vector,\ test.details.dbms if "details" in test and "dbms" in test.details else ""]): debugMsg = "skipping test '%s' because " % title debugMsg += "its name/vector/dbms is not included by the given filter" diff --git a/lib/core/option.py b/lib/core/option.py index cba15af41..c9a5fd92e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1324,9 +1324,9 @@ def __cleanupOptions(): if conf.dbms: conf.dbms = conf.dbms.capitalize() - if conf.testFilter: - if not any([char in conf.testFilter for char in ('.', ')', '(', ']', '[')]): - conf.testFilter = conf.testFilter.replace('*', '.*') + if conf.tstF: + if not any([char in conf.tstF for char in ('.', ')', '(', ']', '[')]): + conf.tstF = conf.tstF.replace('*', '.*') if conf.timeSec not in kb.explicitSettings: if conf.tor: diff --git a/lib/core/optiondict.py b/lib/core/optiondict.py index c08c565eb..9b59f7fe3 100644 --- a/lib/core/optiondict.py +++ b/lib/core/optiondict.py @@ -193,6 +193,7 @@ optDict = { "mobile": "boolean", "pageRank": "boolean", "smart": "boolean", + "tstF": "string", "wizard": "boolean", "verbose": "integer" }, diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index e6950d15b..d230a5a29 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -619,6 +619,9 @@ def cmdLineParser(): action="store_true", help="Conduct through tests only if positive heuristic(s)") + miscellaneous.add_option("--test-filter", dest="tstF", + help="Select tests by payloads and/or titles (e.g. ROW)") + miscellaneous.add_option("--wizard", dest="wizard", action="store_true", help="Simple wizard interface for beginner users") @@ -642,9 +645,6 @@ def cmdLineParser(): parser.add_option("--run-case", dest="runCase", type="int", help=SUPPRESS_HELP) - parser.add_option("--test-filter", dest="testFilter", - help=SUPPRESS_HELP) - parser.add_option_group(target) parser.add_option_group(request) parser.add_option_group(optimization) diff --git a/sqlmap.conf b/sqlmap.conf index 2c39e4aea..1ace5abab 100644 --- a/sqlmap.conf +++ b/sqlmap.conf @@ -656,6 +656,9 @@ pageRank = False # Valid: True or False smart = False +# Select tests by payloads and/or titles (e.g. ROW) +tstF = + # Simple wizard interface for beginner users. # Valid: True or False wizard = False