Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2efb3b7

Browse files
committed
Consider also --dbms value during the detection phase
1 parent be6df7a commit 2efb3b7

2 files changed

Lines changed: 30 additions & 5 deletions

File tree

lib/controller/checks.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,20 @@ def checkSqlInjection(place, parameter, value):
108108

109109
# Skip DBMS-specific tests if they do not match the DBMS
110110
# identified
111-
if injection.dbms is not None and injection.dbms != dbms:
112-
debugMsg = "skipping test '%s' because " % title
113-
debugMsg += "the back-end DBMS is %s" % injection.dbms
114-
logger.debug(debugMsg)
111+
if dbms is not None:
112+
if injection.dbms is not None and injection.dbms != dbms:
113+
debugMsg = "skipping test '%s' because " % title
114+
debugMsg += "the back-end DBMS is %s" % injection.dbms
115+
logger.debug(debugMsg)
115116

116-
continue
117+
continue
118+
119+
if conf.dbms is not None and conf.dbms.lower() != dbms.lower():
120+
debugMsg = "skipping test '%s' because " % title
121+
debugMsg += "the provided DBMS is %s" % conf.dbms
122+
logger.debug(debugMsg)
123+
124+
continue
117125

118126
infoMsg = "testing '%s'" % title
119127
logger.info(infoMsg)

lib/core/option.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@
6363
from lib.core.settings import SUPPORTED_DBMS
6464
from lib.core.settings import SUPPORTED_OS
6565
from lib.core.settings import VERSION_STRING
66+
from lib.core.settings import MSSQL_ALIASES
67+
from lib.core.settings import MYSQL_ALIASES
68+
from lib.core.settings import PGSQL_ALIASES
69+
from lib.core.settings import ORACLE_ALIASES
70+
from lib.core.settings import SQLITE_ALIASES
71+
from lib.core.settings import ACCESS_ALIASES
72+
from lib.core.settings import FIREBIRD_ALIASES
73+
from lib.core.settings import MAXDB_ALIASES
74+
from lib.core.settings import SYBASE_ALIASES
6675
from lib.core.update import update
6776
from lib.parse.configfile import configFileParser
6877
from lib.parse.payloads import loadPayloads
@@ -588,6 +597,14 @@ def __setDBMS():
588597
errMsg += "fingerprint it for you."
589598
raise sqlmapUnsupportedDBMSException, errMsg
590599

600+
for aliases in (MSSQL_ALIASES, MYSQL_ALIASES, PGSQL_ALIASES, \
601+
ORACLE_ALIASES, SQLITE_ALIASES, ACCESS_ALIASES, \
602+
FIREBIRD_ALIASES, MAXDB_ALIASES, SYBASE_ALIASES):
603+
if conf.dbms in aliases:
604+
conf.dbms = aliases[0]
605+
606+
break
607+
591608
def __setTamperingFunctions():
592609
"""
593610
Loads tampering functions from given script(s)

0 commit comments

Comments
 (0)