diff --git a/lib/controller/checks.py b/lib/controller/checks.py index bd751a484..01d2a30c5 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -322,6 +322,9 @@ def checkSqlInjection(place, parameter, value): boundPayload = agent.suffixQuery(boundPayload, comment, suffix, where) cmpPayload = agent.payload(place, parameter, newValue=boundPayload, where=where) + pushValue(kb.negativeLogic) + kb.negativeLogic = "OR NOT" in cmpPayload + return cmpPayload # Useful to set kb.matchRatio at first based on @@ -347,6 +350,8 @@ def checkSqlInjection(place, parameter, value): injectable = True + kb.negativeLogic = popValue() + # In case of error-based SQL injection elif method == PAYLOAD.METHOD.GREP: # Perform the test's request and grep the response diff --git a/lib/request/comparison.py b/lib/request/comparison.py index e0329bea0..d15e336f1 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -36,7 +36,7 @@ def comparison(page, headers, code=None, getRatioValue=False, pageLength=None): seqMatcher.set_seq1(kb.pageTemplate) def _(condition): - #condition = not condition if kb.negativeLogic else condition + condition = not condition if kb.negativeLogic else condition return condition if not getRatioValue else (MAX_RATIO if condition else MIN_RATIO) if any([conf.string, conf.regexp]):