(injection)
return retVal
Checks for false positives (only in single special cases)
Checks for false positives (only in single special cases)
Checks for false positives ( only in single special cases )
def checkFalsePositives(injection):
    """
    Checks for false positives (only in single special cases)
    """

    retVal = injection

    if all(_ in (PAYLOAD.TECHNIQUE.BOOLEAN, PAYLOAD.TECHNIQUE.TIME, PAYLOAD.TECHNIQUE.STACKED) for _ in injection.data) or\
      (len(injection.data) == 1 and PAYLOAD.TECHNIQUE.UNION in injection.data and "Generic" in injection.data[PAYLOAD.TECHNIQUE.UNION].title):
        pushValue(kb.injection)

        infoMsg = "checking if the injection point on %s " % injection.place
        infoMsg += "parameter '%s' is a false positive" % injection.parameter
        logger.info(infoMsg)

        def _():
            return int(randomInt(2)) + 1

        kb.injection = injection

        for i in xrange(conf.level):
            while True:
                randInt1, randInt2, randInt3 = (_() for j in xrange(3))

                randInt1 = min(randInt1, randInt2, randInt3)
                randInt3 = max(randInt1, randInt2, randInt3)

                if randInt3 > randInt2 > randInt1:
                    break

            if not checkBooleanExpression("%d=%d" % (randInt1, randInt1)):
                retVal = None
                break

            # Just in case if DBMS hasn't properly recovered from previous delayed request
            if PAYLOAD.TECHNIQUE.BOOLEAN not in injection.data:
                checkBooleanExpression("%d=%d" % (randInt1, randInt2))

            if checkBooleanExpression("%d=%d" % (randInt1, randInt3)):
                retVal = None
                break

            elif checkBooleanExpression("%d=%d" % (randInt3, randInt2)):
                retVal = None
                break

            elif not checkBooleanExpression("%d=%d" % (randInt2, randInt2)):
                retVal = None
                break

        if retVal is None:
            warnMsg = "false positive or unexploitable injection point detected"
            logger.warn(warnMsg)

        kb.injection = popValue()

    return retVal
def checkFalsePositives ( injection ) : retVal = injection if all ( _ in ( PAYLOAD . TECHNIQUE . BOOLEAN , PAYLOAD . TECHNIQUE . TIME , PAYLOAD . TECHNIQUE . STACKED ) for _ in injection . data ) or ( len ( injection . data ) == 1 and PAYLOAD . TECHNIQUE . UNION in injection . data and "Generic" in injection . data [ PAYLOAD . TECHNIQUE . UNION ] . title ) : pushValue ( kb . injection ) infoMsg = "checking if the injection point on %s " % injection . place infoMsg += "parameter '%s' is a false positive" % injection . parameter logger . info ( infoMsg ) def _ ( ) : return int ( randomInt ( 2 ) ) + 1 kb . injection = injection for i in xrange ( conf . level ) : while True : randInt1 , randInt2 , randInt3 = ( _ ( ) for j in xrange ( 3 ) ) randInt1 = min ( randInt1 , randInt2 , randInt3 ) randInt3 = max ( randInt1 , randInt2 , randInt3 ) if randInt3 > randInt2 > randInt1 : break if not checkBooleanExpression ( "%d=%d" % ( randInt1 , randInt1 ) ) : retVal = None break # Just in case if DBMS hasn't properly recovered from previous delayed request if PAYLOAD . TECHNIQUE . BOOLEAN not in injection . data : checkBooleanExpression ( "%d=%d" % ( randInt1 , randInt2 ) ) if checkBooleanExpression ( "%d=%d" % ( randInt1 , randInt3 ) ) : retVal = None break elif checkBooleanExpression ( "%d=%d" % ( randInt3 , randInt2 ) ) : retVal = None break elif not checkBooleanExpression ( "%d=%d" % ( randInt2 , randInt2 ) ) : retVal = None break if retVal is None : warnMsg = "false positive or unexploitable injection point detected" logger . warn ( warnMsg ) kb . injection = popValue ( ) return retVal