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

Skip to content

Commit cb2258f

Browse files
committed
Fixes #2603
1 parent c871ced commit cb2258f

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

lib/controller/checks.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ def checkSqlInjection(place, parameter, value):
259259
# provided DBMS
260260
if conf.dbms is not None and not intersect(payloadDbms, conf.dbms, True):
261261
debugMsg = "skipping test '%s' because " % title
262-
debugMsg += "the provided DBMS is %s" % conf.dbms
262+
debugMsg += "it is different than provided"
263+
logger.debug(debugMsg)
264+
continue
265+
266+
if kb.dbmsFilter is not None and not intersect(payloadDbms, kb.dbmsFilter, True):
267+
debugMsg = "skipping test '%s' because " % title
268+
debugMsg += "it is different than provided"
263269
logger.debug(debugMsg)
264270
continue
265271

@@ -618,7 +624,9 @@ def genCmpPayload():
618624

619625
configUnion(test.request.char, test.request.columns)
620626

621-
if not Backend.getIdentifiedDbms():
627+
if len(kb.dbmsFilter or []) == 1:
628+
Backend.forceDbms(kb.dbmsFilter[0])
629+
elif not Backend.getIdentifiedDbms():
622630
if kb.heuristicDbms is None:
623631
warnMsg = "using unescaped version of the test "
624632
warnMsg += "because of zero knowledge of the "

lib/controller/handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ def setHandler():
8282
else:
8383
kb.dbms = conf.dbms = conf.forceDbms = dbms
8484

85+
if kb.dbmsFilter:
86+
if dbms not in kb.dbmsFilter:
87+
continue
88+
8589
handler = Handler()
8690
conf.dbmsConnector = Connector()
8791

lib/core/option.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,13 @@ def _cleanupOptions():
17001700
conf.dbms = conf.forceDbms
17011701

17021702
if conf.dbms:
1703-
conf.dbms = conf.dbms.capitalize()
1703+
kb.dbmsFilter = []
1704+
for _ in conf.dbms.split(','):
1705+
for dbms, aliases in DBMS_ALIASES:
1706+
if _.strip().lower() in aliases:
1707+
kb.dbmsFilter.append(dbms)
1708+
conf.dbms = dbms if conf.dbms and ',' not in conf.dbms else None
1709+
break
17041710

17051711
if conf.testFilter:
17061712
conf.testFilter = conf.testFilter.strip('*+')
@@ -1905,6 +1911,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
19051911

19061912
# Active back-end DBMS fingerprint
19071913
kb.dbms = None
1914+
kb.dbmsFilter = []
19081915
kb.dbmsVersion = [UNKNOWN_DBMS_VERSION]
19091916

19101917
kb.delayCandidates = TIME_DELAY_CANDIDATES * [0]

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.8.14"
22+
VERSION = "1.1.8.15"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ c55b400b72acc43e0e59c87dd8bb8d75 extra/shellcodeexec/windows/shellcodeexec.x32.
2121
310efc965c862cfbd7b0da5150a5ad36 extra/sqlharvest/__init__.py
2222
7713aa366c983cdf1f3dbaa7383ea9e1 extra/sqlharvest/sqlharvest.py
2323
7afe836fd97271ccba67b4c0da2482ff lib/controller/action.py
24-
979909f798bfcd346d72089d72234b74 lib/controller/checks.py
24+
20ec996d592a09f0b4607ddd231586f7 lib/controller/checks.py
2525
a66093c734c7f94ecdf94d882c2d8b89 lib/controller/controller.py
26-
76ecef480eef54d4599b8fc44decb639 lib/controller/handler.py
26+
926bdaf98d082a41fdd57bb41c1692d1 lib/controller/handler.py
2727
310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py
2828
ca0a4eba91d73c9d7adedabf528ca4f1 lib/core/agent.py
2929
6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py
@@ -40,13 +40,13 @@ a44d7a4cc6c9a67a72d6af2f25f4ddac lib/core/exception.py
4040
310efc965c862cfbd7b0da5150a5ad36 lib/core/__init__.py
4141
9ba39bf66e9ecd469446bdbbeda906c3 lib/core/log.py
4242
9d7069d81e4a520ed3fbcac584c1e86e lib/core/optiondict.py
43-
106ed715de3e616df28fcc600b724db2 lib/core/option.py
43+
c5f09788ee8ff9c9d12a052986875bc6 lib/core/option.py
4444
5f2f56e6c5f274408df61943f1e080c0 lib/core/profiling.py
4545
40be71cd774662a7b420caeb7051e7d5 lib/core/readlineng.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
ba13dfc439f93ae49f8146416bf47f7d lib/core/settings.py
49+
35c5e25bc24da66bf3df549e1f1db1ab lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
4a6ecdd8a6e44bb4737bd9bc7f9b5743 lib/core/target.py

0 commit comments

Comments
 (0)