diff --git a/lib/controller/checks.py b/lib/controller/checks.py index e7800b4ab..76aa18a50 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -108,12 +108,20 @@ def checkSqlInjection(place, parameter, value): # Skip DBMS-specific tests if they do not match the DBMS # identified - if injection.dbms is not None and injection.dbms != dbms: - debugMsg = "skipping test '%s' because " % title - debugMsg += "the back-end DBMS is %s" % injection.dbms - logger.debug(debugMsg) + if dbms is not None: + if injection.dbms is not None and injection.dbms != dbms: + debugMsg = "skipping test '%s' because " % title + debugMsg += "the back-end DBMS is %s" % injection.dbms + logger.debug(debugMsg) - continue + continue + + if conf.dbms is not None and conf.dbms.lower() != dbms.lower(): + debugMsg = "skipping test '%s' because " % title + debugMsg += "the provided DBMS is %s" % conf.dbms + logger.debug(debugMsg) + + continue infoMsg = "testing '%s'" % title logger.info(infoMsg) diff --git a/lib/core/option.py b/lib/core/option.py index d178ea371..1b0e00101 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -63,6 +63,15 @@ from lib.core.settings import SITE from lib.core.settings import SUPPORTED_DBMS from lib.core.settings import SUPPORTED_OS from lib.core.settings import VERSION_STRING +from lib.core.settings import MSSQL_ALIASES +from lib.core.settings import MYSQL_ALIASES +from lib.core.settings import PGSQL_ALIASES +from lib.core.settings import ORACLE_ALIASES +from lib.core.settings import SQLITE_ALIASES +from lib.core.settings import ACCESS_ALIASES +from lib.core.settings import FIREBIRD_ALIASES +from lib.core.settings import MAXDB_ALIASES +from lib.core.settings import SYBASE_ALIASES from lib.core.update import update from lib.parse.configfile import configFileParser from lib.parse.payloads import loadPayloads @@ -588,6 +597,14 @@ def __setDBMS(): errMsg += "fingerprint it for you." raise sqlmapUnsupportedDBMSException, errMsg + for aliases in (MSSQL_ALIASES, MYSQL_ALIASES, PGSQL_ALIASES, \ + ORACLE_ALIASES, SQLITE_ALIASES, ACCESS_ALIASES, \ + FIREBIRD_ALIASES, MAXDB_ALIASES, SYBASE_ALIASES): + if conf.dbms in aliases: + conf.dbms = aliases[0] + + break + def __setTamperingFunctions(): """ Loads tampering functions from given script(s)