mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
added --ratio option for direct manipulation of conf.matchRatio parameter
This commit is contained in:
parent
02523dbfb5
commit
057ec8a6b2
|
@ -943,7 +943,6 @@ def __setConfAttributes():
|
||||||
conf.httpHeaders = []
|
conf.httpHeaders = []
|
||||||
conf.hostname = None
|
conf.hostname = None
|
||||||
conf.loggedToOut = None
|
conf.loggedToOut = None
|
||||||
conf.matchRatio = None
|
|
||||||
conf.md5hash = None
|
conf.md5hash = None
|
||||||
conf.multipleTargets = False
|
conf.multipleTargets = False
|
||||||
conf.outputPath = None
|
conf.outputPath = None
|
||||||
|
@ -1136,6 +1135,11 @@ def __basicOptionValidation():
|
||||||
errMsg = "value for --cpu-throttle (cpuThrottle) option must be in range [0,100]"
|
errMsg = "value for --cpu-throttle (cpuThrottle) option must be in range [0,100]"
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
|
if conf.matchRatio is not None and isinstance(conf.matchRatio, float) and (conf.matchRatio > 1 or\
|
||||||
|
conf.cpuThrottle < 0):
|
||||||
|
errMsg = "value for --ratio (matchRatio) option must be in range [0,1]"
|
||||||
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
def init(inputOptions=advancedDict()):
|
def init(inputOptions=advancedDict()):
|
||||||
"""
|
"""
|
||||||
Set attributes into both configuration and knowledge base singletons
|
Set attributes into both configuration and knowledge base singletons
|
||||||
|
|
|
@ -187,6 +187,9 @@ def cmdLineParser():
|
||||||
help="Matches to be excluded before "
|
help="Matches to be excluded before "
|
||||||
"comparing page contents")
|
"comparing page contents")
|
||||||
|
|
||||||
|
injection.add_option("--ratio", dest="matchRatio", type="float",
|
||||||
|
help="Page comparison treshold value")
|
||||||
|
|
||||||
injection.add_option("--use-between", dest="useBetween",
|
injection.add_option("--use-between", dest="useBetween",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Use operator BETWEEN instead of default '>'")
|
help="Use operator BETWEEN instead of default '>'")
|
||||||
|
|
|
@ -79,8 +79,8 @@ def comparison(page, headers=None, getSeqMatcher=False):
|
||||||
logger.debug("setting match ratio to default value 0.900")
|
logger.debug("setting match ratio to default value 0.900")
|
||||||
conf.matchRatio = 0.900
|
conf.matchRatio = 0.900
|
||||||
|
|
||||||
if conf.matchRatio is not None:
|
if conf.matchRatio is not None:
|
||||||
setMatchRatio()
|
setMatchRatio()
|
||||||
|
|
||||||
# If it has been requested to return the ratio and not a comparison
|
# If it has been requested to return the ratio and not a comparison
|
||||||
# response
|
# response
|
||||||
|
|
Loading…
Reference in New Issue
Block a user