Skip to content

Commit a0b4696

Browse files
committed
minor fix for some special "unusable" cases (seen on Access/ODBC/Linux setup)
1 parent 7330dff commit a0b4696

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

lib/controller/checks.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,26 +540,29 @@ def checkFalsePositives(injection):
540540
infoMsg += "parameter '%s' is a false positive" % injection.parameter
541541
logger.info(infoMsg)
542542

543+
def _():
544+
return int(randomInt(2)) + 1
545+
543546
kb.injection = injection
544-
randInt1, randInt2 = int(randomInt(2)) + 1, int(randomInt(2)) + 1
547+
randInt1, randInt2, randInt3 = (_() for i in xrange(3))
545548

546549
# Just in case (also, they have to be different than 0 because of the last test)
547550
while randInt1 == randInt2:
548-
randInt2 = int(randomInt(2)) + 1
551+
randInt2 = _()
549552

550553
# Simple arithmetic operations which should show basic
551554
# arithmetic ability of the backend if it's really injectable
552555
if not checkBooleanExpression("(%d+%d)=%d" % (randInt1, randInt2, randInt1 + randInt2)):
553556
retVal = None
554-
elif checkBooleanExpression("%d=%d" % (randInt1, randInt2)):
557+
elif checkBooleanExpression("%d>(%d+%d)" % (min(randInt1, randInt2), randInt3, max(randInt1, randInt2))):
555558
retVal = None
556-
if not checkBooleanExpression("%d=(%d+%d)" % (randInt1 + randInt2, randInt1, randInt2)):
559+
elif not checkBooleanExpression("%d=(%d+%d)" % (randInt1 + randInt2, randInt1, randInt2)):
557560
retVal = None
558-
elif checkBooleanExpression("%d=%d" % (randInt2, randInt1)):
561+
elif checkBooleanExpression("(%d+%d)>%d" % (randInt3, min(randInt1, randInt2), randInt1 + randInt2 + randInt3)):
559562
retVal = None
560563

561564
if retVal is None:
562-
warnMsg = "false positive injection point detected"
565+
warnMsg = "false positive and/or unexploitable injection point detected"
563566
logger.warn(warnMsg)
564567

565568
kb.injection = popValue()

0 commit comments

Comments
 (0)