()
Resume stored DBMS information from HashDB
Resume stored DBMS information from HashDB
Resume stored DBMS information from HashDB
def _resumeDBMS():
    """
    Resume stored DBMS information from HashDB
    """

    value = hashDBRetrieve(HASHDB_KEYS.DBMS)

    if not value:
        return

    dbms = value.lower()
    dbmsVersion = [UNKNOWN_DBMS_VERSION]
    _ = "(%s)" % ("|".join([alias for alias in SUPPORTED_DBMS]))
    _ = re.search("%s ([\d\.]+)" % _, dbms, re.I)

    if _:
        dbms = _.group(1).lower()
        dbmsVersion = [_.group(2)]

    if conf.dbms:
        check = True
        for aliases, _, _, _ in DBMS_DICT.values():
            if conf.dbms.lower() in aliases and dbms not in aliases:
                check = False
                break

        if not check:
            message = "you provided '%s' as a back-end DBMS, " % conf.dbms
            message += "but from a past scan information on the target URL "
            message += "sqlmap assumes the back-end DBMS is '%s'. " % dbms
            message += "Do you really want to force the back-end "
            message += "DBMS value? [y/N] "
            test = readInput(message, default="N")

            if not test or test[0] in ("n", "N"):
                conf.dbms = None
                Backend.setDbms(dbms)
                Backend.setVersionList(dbmsVersion)
    else:
        infoMsg = "resuming back-end DBMS '%s' " % dbms
        logger.info(infoMsg)

        Backend.setDbms(dbms)
        Backend.setVersionList(dbmsVersion)
def _resumeDBMS ( ) : value = hashDBRetrieve ( HASHDB_KEYS . DBMS ) if not value : return dbms = value . lower ( ) dbmsVersion = [ UNKNOWN_DBMS_VERSION ] _ = "(%s)" % ( "|" . join ( [ alias for alias in SUPPORTED_DBMS ] ) ) _ = re . search ( "%s ([\d\.]+)" % _ , dbms , re . I ) if _ : dbms = _ . group ( 1 ) . lower ( ) dbmsVersion = [ _ . group ( 2 ) ] if conf . dbms : check = True for aliases , _ , _ , _ in DBMS_DICT . values ( ) : if conf . dbms . lower ( ) in aliases and dbms not in aliases : check = False break if not check : message = "you provided '%s' as a back-end DBMS, " % conf . dbms message += "but from a past scan information on the target URL " message += "sqlmap assumes the back-end DBMS is '%s'. " % dbms message += "Do you really want to force the back-end " message += "DBMS value? [y/N] " test = readInput ( message , default = "N" ) if not test or test [ 0 ] in ( "n" , "N" ) : conf . dbms = None Backend . setDbms ( dbms ) Backend . setVersionList ( dbmsVersion ) else : infoMsg = "resuming back-end DBMS '%s' " % dbms logger . info ( infoMsg ) Backend . setDbms ( dbms ) Backend . setVersionList ( dbmsVersion )