mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Added hidden (for the moment) switch --technique
This commit is contained in:
parent
b80a86a669
commit
5fb04515d3
|
@ -101,6 +101,15 @@ def checkSqlInjection(place, parameter, value):
|
||||||
stype = test.stype
|
stype = test.stype
|
||||||
clause = test.clause
|
clause = test.clause
|
||||||
|
|
||||||
|
# Skip test if the user's wants to test only for a specific
|
||||||
|
# technique
|
||||||
|
if isinstance(conf.technique, int) and stype != conf.technique:
|
||||||
|
debugMsg = "skipping test '%s' because the user " % title
|
||||||
|
debugMsg += "specified to test only for "
|
||||||
|
debugMsg += "%s" % PAYLOAD.SQLINJECTION[conf.technique]
|
||||||
|
logger.debug(debugMsg)
|
||||||
|
continue
|
||||||
|
|
||||||
# Skip test if the risk is higher than the provided (or default)
|
# Skip test if the risk is higher than the provided (or default)
|
||||||
# value
|
# value
|
||||||
# Parse test's <risk>
|
# Parse test's <risk>
|
||||||
|
|
|
@ -552,6 +552,15 @@ def __setOS():
|
||||||
errMsg += "you."
|
errMsg += "you."
|
||||||
raise sqlmapUnsupportedDBMSException, errMsg
|
raise sqlmapUnsupportedDBMSException, errMsg
|
||||||
|
|
||||||
|
def __setTechnique():
|
||||||
|
if not isinstance(conf.technique, int):
|
||||||
|
return
|
||||||
|
|
||||||
|
if conf.technique < 0 or conf.technique > 5:
|
||||||
|
errMsg = "the value of --technique must be an integer "
|
||||||
|
errMsg += "between 0 and 5"
|
||||||
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
def __setDBMS():
|
def __setDBMS():
|
||||||
"""
|
"""
|
||||||
Force the back-end DBMS option.
|
Force the back-end DBMS option.
|
||||||
|
@ -1383,6 +1392,7 @@ def init(inputOptions=advancedDict()):
|
||||||
__urllib2Opener()
|
__urllib2Opener()
|
||||||
__findPageForms()
|
__findPageForms()
|
||||||
__setDBMS()
|
__setDBMS()
|
||||||
|
__setTechnique()
|
||||||
|
|
||||||
__setThreads()
|
__setThreads()
|
||||||
__setOS()
|
__setOS()
|
||||||
|
|
|
@ -529,6 +529,9 @@ def cmdLineParser():
|
||||||
parser.add_option("--live-test", dest="liveTest", action="store_true",
|
parser.add_option("--live-test", dest="liveTest", action="store_true",
|
||||||
default=False, help=SUPPRESS_HELP)
|
default=False, help=SUPPRESS_HELP)
|
||||||
|
|
||||||
|
parser.add_option("--technique", dest="technique", type="int",
|
||||||
|
default=False, help=SUPPRESS_HELP)
|
||||||
|
|
||||||
parser.add_option_group(target)
|
parser.add_option_group(target)
|
||||||
parser.add_option_group(request)
|
parser.add_option_group(request)
|
||||||
parser.add_option_group(optimization)
|
parser.add_option_group(optimization)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user