fix for Feature #187 (Skip duplicates parameters in -g)

This commit is contained in:
Miroslav Stampar 2010-07-29 20:01:04 +00:00
parent 6a6ff09c9a
commit 28d9115373
2 changed files with 23 additions and 17 deletions

View File

@ -199,21 +199,26 @@ def start():
for parameter, value in paramDict.items(): for parameter, value in paramDict.items():
testSqlInj = True testSqlInj = True
paramKey = (conf.hostname, place, parameter)
if paramKey in kb.testedParams:
warnMsg = "skipping previously processed %s parameter '%s'" % (place, parameter)
logger.warn(warnMsg)
testSqlInj = False
# Avoid dinamicity test if the user provided the # Avoid dinamicity test if the user provided the
# parameter manually # parameter manually
if parameter in conf.testParameter: elif parameter in conf.testParameter:
pass pass
elif not checkDynParam(place, parameter, value): elif not checkDynParam(place, parameter, value):
warnMsg = "%s parameter '%s' is not dynamic" % (place, parameter) warnMsg = "%s parameter '%s' is not dynamic" % (place, parameter)
logger.warn(warnMsg) logger.warn(warnMsg)
testSqlInj = False testSqlInj = False
else: else:
logMsg = "%s parameter '%s' is dynamic" % (place, parameter) logMsg = "%s parameter '%s' is dynamic" % (place, parameter)
logger.info(logMsg) logger.info(logMsg)
kb.testedParams.add(paramKey)
if testSqlInj: if testSqlInj:
for parenthesis in range(0, 4): for parenthesis in range(0, 4):
logMsg = "testing sql injection on %s " % place logMsg = "testing sql injection on %s " % place

View File

@ -1011,6 +1011,7 @@ def __setKnowledgeBaseAttributes():
kb.resumedQueries = {} kb.resumedQueries = {}
kb.stackedTest = None kb.stackedTest = None
kb.targetUrls = set() kb.targetUrls = set()
kb.testedParams = set()
kb.timeTest = None kb.timeTest = None
kb.unionComment = "" kb.unionComment = ""
kb.unionCount = None kb.unionCount = None