Skip to content

Commit 0d6afca

Browse files
committed
adding new switch '--smart' by request
1 parent 5d31eb5 commit 0d6afca

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

lib/controller/controller.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,11 @@ def start():
440440
if testSqlInj:
441441
check = heuristicCheckSqlInjection(place, parameter)
442442

443-
if not check and conf.realTest and \
444-
not simpletonCheckSqlInjection(place, parameter, value):
445-
continue
443+
if not check:
444+
if conf.smart or conf.realTest and not simpletonCheckSqlInjection(place, parameter, value):
445+
infoMsg = "skipping %s parameter '%s'" % (place, parameter)
446+
logger.info(infoMsg)
447+
continue
446448

447449
infoMsg = "testing sql injection on %s " % place
448450
infoMsg += "parameter '%s'" % parameter

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"googlePage": "integer",
176176
"mobile": "boolean",
177177
"pageRank": "boolean",
178+
"smart": "boolean",
178179
"wizard": "boolean",
179180
"verbose": "integer"
180181
},

lib/parse/cmdline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,10 @@ def cmdLineParser():
549549
action="store_true",
550550
help="Display page rank (PR) for Google dork results")
551551

552+
miscellaneous.add_option("--smart", dest="smart",
553+
action="store_true",
554+
help="Conduct through tests only if positive heuristic(s)")
555+
552556
miscellaneous.add_option("--wizard", dest="wizard",
553557
action="store_true",
554558
help="Simple wizard interface for beginner users")

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,10 @@ mobile = False
584584
# Valid: True or False
585585
pageRank = False
586586

587+
# Conduct through tests only if positive heuristic(s).
588+
# Valid: True or False
589+
smart = False
590+
587591
# Simple wizard interface for beginner users.
588592
# Valid: True or False
589593
wizard = False

0 commit comments

Comments
 (0)