Consider also --dbms value during the detection phase

This commit is contained in:
Bernardo Damele 2010-11-29 14:48:07 +00:00
parent be6df7abd9
commit 2efb3b78ea
2 changed files with 30 additions and 5 deletions

View File

@ -108,6 +108,7 @@ def checkSqlInjection(place, parameter, value):
# Skip DBMS-specific tests if they do not match the DBMS
# identified
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
@ -115,6 +116,13 @@ def checkSqlInjection(place, parameter, value):
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)

View File

@ -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)