def heuristicCheckDbms(injection):
 retVal = False
 pushValue(kb.injection)
 kb.injection = injection
 for dbms in getPublicTypeMembers(DBMS, True):
  if (not FROM_DUMMY_TABLE.get(dbms, '')):
   continue
  (randStr1, randStr2) = (randomStr(), randomStr())
  Backend.forceDbms(dbms)
  if checkBooleanExpression(("(SELECT '%s'%s)='%s'" % (randStr1, FROM_DUMMY_TABLE.get(dbms, ''), randStr1))):
   if (not checkBooleanExpression(("(SELECT '%s'%s)='%s'" % (randStr1, FROM_DUMMY_TABLE.get(dbms, ''), randStr2)))):
    retVal = dbms
    break
 Backend.flushForcedDbms()
 kb.injection = popValue()
 if retVal:
  infoMsg = 'heuristic (extended) test shows that the back-end DBMS '
  infoMsg += ("could be '%s' " % retVal)
  logger.info(infoMsg)
 return retVal

def heuristicCheckDbms ( injection ) : retVal = False pushValue ( kb . injection ) kb . injection = injection for dbms in getPublicTypeMembers ( DBMS , True ) : if ( not FROM_DUMMY_TABLE . get ( dbms , '' ) ) : continue ( randStr1 , randStr2 ) = ( randomStr ( ) , randomStr ( ) ) Backend . forceDbms ( dbms ) if checkBooleanExpression ( ( "(SELECT '%s'%s)='%s'" % ( randStr1 , FROM_DUMMY_TABLE . get ( dbms , '' ) , randStr1 ) ) ) : if ( not checkBooleanExpression ( ( "(SELECT '%s'%s)='%s'" % ( randStr1 , FROM_DUMMY_TABLE . get ( dbms , '' ) , randStr2 ) ) ) ) : retVal = dbms break Backend . flushForcedDbms ( ) kb . injection = popValue ( ) if retVal : infoMsg = 'heuristic (extended) test shows that the back-end DBMS ' infoMsg += ( "could be '%s' " % retVal ) logger . info ( infoMsg ) return retVal
this functions is called when boolean-based blind is identified with a generic payload and the dbms has not yet been fingerprinted to attempt to identify with a simple dbms specific boolean-based test what the dbms may be .