From cee888b61367dfb6dfe335076d050397a08aafbf Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 9 Nov 2010 19:14:55 +0000 Subject: [PATCH] tuning detection engine (None results from queryPage/comparison should not be treated as False in checkSqlInjection routine - None is returned when error is detected) --- lib/controller/checks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 4ddc99f61..a745fced1 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -76,12 +76,12 @@ def checkSqlInjection(place, parameter, value, parenthesis): payload = agent.payload(place, parameter, value, positive.format % eval(positive.params)) trueResult = Request.queryPage(payload, place) - if trueResult: + if trueResult == True: payload = agent.payload(place, parameter, value, negative.format % eval(negative.params)) falseResult = Request.queryPage(payload, place) - if not falseResult: + if falseResult == False: infoMsg = "%s parameter '%s' is %s (%s) injectable " % (place, parameter, case.desc, logic) infoMsg += "with %d parenthesis" % parenthesis logger.info(infoMsg) @@ -122,7 +122,7 @@ def heuristicCheckSqlInjection(place, parameter, value): infoMsg += "parameter '%s' is " % parameter if result: - infoMsg += "injectable (possible DBMS: %s)" % kb.htmlFp[-1] + infoMsg += "injectable (possible DBMS: %s)" % (kb.htmlFp[-1] if kb.htmlFp else 'Unknown') logger.info(infoMsg) else: infoMsg += "not injectable"