code refactoring and some fixes

This commit is contained in:
Miroslav Stampar
2010-12-18 09:51:34 +00:00
parent a067e805fa
commit fe67d3827c
10 changed files with 53 additions and 50 deletions

View File

@@ -292,9 +292,9 @@ def checkSqlInjection(place, parameter, value):
boundPayload = agent.cleanupPayload(boundPayload, value)
cmpPayload = agent.payload(place, parameter, value, boundPayload)
# Useful to set conf.matchRatio at first based on
# Useful to set kb.matchRatio at first based on
# the False response content
conf.matchRatio = None
kb.matchRatio = None
_ = Request.queryPage(cmpPayload, place)
# Perform the test's True request
@@ -308,7 +308,6 @@ def checkSqlInjection(place, parameter, value):
infoMsg = "%s parameter '%s' is '%s' injectable " % (place, parameter, title)
logger.info(infoMsg)
kb.paramMatchRatio[(place, parameter)] = conf.matchRatio
injectable = True
# In case of error-based or UNION query SQL injections
@@ -382,6 +381,7 @@ def checkSqlInjection(place, parameter, value):
injection.data[stype].where = where
injection.data[stype].vector = vector
injection.data[stype].comment = comment
injection.data[stype].matchRatio = kb.matchRatio
injection.data[stype].templatePayload = templatePayload
if hasattr(test, "details"):
@@ -455,7 +455,7 @@ def checkDynParam(place, parameter, value):
dynamicity might depend on another parameter.
"""
conf.matchRatio = None
kb.matchRatio = None
infoMsg = "testing if %s parameter '%s' is dynamic" % (place, parameter)
logger.info(infoMsg)

View File

@@ -37,7 +37,6 @@ from lib.core.exception import sqlmapSilentQuitException
from lib.core.exception import sqlmapValueException
from lib.core.exception import sqlmapUserQuitException
from lib.core.session import setInjection
from lib.core.session import setMatchRatio
from lib.core.target import initTargetEnv
from lib.core.target import setupTargetEnv
@@ -382,14 +381,6 @@ def start():
condition = True
if condition:
if kb.paramMatchRatio:
key = (kb.injection.place, kb.injection.parameter)
if key in kb.paramMatchRatio:
conf.matchRatio = kb.paramMatchRatio[key]
setMatchRatio()
else:
conf.matchRatio = None
action()
except KeyboardInterrupt: