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

Skip to content

Commit c871ced

Browse files
committed
Adding hidden option '--force-dbms' to skip fingerprinting
1 parent 3e4130c commit c871ced

6 files changed

Lines changed: 20 additions & 8 deletions

File tree

lib/controller/handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ def setHandler():
7676
items.insert(0, _)
7777

7878
for dbms, aliases, Handler, Connector in items:
79+
if conf.forceDbms:
80+
if conf.forceDbms.lower() not in aliases:
81+
continue
82+
else:
83+
kb.dbms = conf.dbms = conf.forceDbms = dbms
84+
7985
handler = Handler()
8086
conf.dbmsConnector = Connector()
8187

@@ -96,7 +102,7 @@ def setHandler():
96102
else:
97103
conf.dbmsConnector.connect()
98104

99-
if handler.checkDbms():
105+
if conf.forceDbms == dbms or handler.checkDbms():
100106
if kb.resolutionDbms:
101107
conf.dbmsHandler = max(_ for _ in items if _[0] == kb.resolutionDbms)[2]()
102108
else:

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def setArch():
435435
# Get methods
436436
@staticmethod
437437
def getForcedDbms():
438-
return aliasToDbmsEnum(kb.get("forcedDbms"))
438+
return aliasToDbmsEnum(conf.get("forceDbms")) or aliasToDbmsEnum(kb.get("forcedDbms"))
439439

440440
@staticmethod
441441
def getDbms():

lib/core/option.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,9 @@ def _cleanupOptions():
16961696
if conf.os:
16971697
conf.os = conf.os.capitalize()
16981698

1699+
if conf.forceDbms:
1700+
conf.dbms = conf.forceDbms
1701+
16991702
if conf.dbms:
17001703
conf.dbms = conf.dbms.capitalize()
17011704

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.13"
22+
VERSION = "1.1.8.14"
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)

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,9 @@ def cmdLineParser(argv=None):
782782
parser.add_option("--profile", dest="profile", action="store_true",
783783
help=SUPPRESS_HELP)
784784

785+
parser.add_option("--force-dbms", dest="forceDbms",
786+
help=SUPPRESS_HELP)
787+
785788
parser.add_option("--force-dns", dest="forceDns", action="store_true",
786789
help=SUPPRESS_HELP)
787790

txt/checksum.md5

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ c55b400b72acc43e0e59c87dd8bb8d75 extra/shellcodeexec/windows/shellcodeexec.x32.
2323
7afe836fd97271ccba67b4c0da2482ff lib/controller/action.py
2424
979909f798bfcd346d72089d72234b74 lib/controller/checks.py
2525
a66093c734c7f94ecdf94d882c2d8b89 lib/controller/controller.py
26-
35843d3e6dc4ea6c2462d48d2554ad10 lib/controller/handler.py
26+
76ecef480eef54d4599b8fc44decb639 lib/controller/handler.py
2727
310efc965c862cfbd7b0da5150a5ad36 lib/controller/__init__.py
2828
ca0a4eba91d73c9d7adedabf528ca4f1 lib/core/agent.py
2929
6cc95a117fbd34ef31b9aa25520f0e31 lib/core/bigarray.py
30-
d7efe9cd474162b9ef0875ed83a8fd0f lib/core/common.py
30+
fc1f0a8732386fd502612fb4094fbcec lib/core/common.py
3131
5065a4242a8cccf72f91e22e1007ae63 lib/core/convert.py
3232
a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py
3333
7936d78b1a7f1f008ff92bf2f88574ba lib/core/datatype.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-
467a77eb68d193467a3a91d7b378501d lib/core/option.py
43+
106ed715de3e616df28fcc600b724db2 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-
5ad722bb1b3296fb62948866e662bfd1 lib/core/settings.py
49+
ba13dfc439f93ae49f8146416bf47f7d lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
4a6ecdd8a6e44bb4737bd9bc7f9b5743 lib/core/target.py
@@ -57,7 +57,7 @@ ad74fc58fc7214802fd27067bce18dd2 lib/core/unescaper.py
5757
4d13ed693401a498b6d073a2a494bd83 lib/core/wordlist.py
5858
310efc965c862cfbd7b0da5150a5ad36 lib/__init__.py
5959
8c4b04062db2245d9e190b413985202a lib/parse/banner.py
60-
18a64eb1c9a3c0f0896bcfc6a23d76da lib/parse/cmdline.py
60+
96a762a2ed36b34baedd59b9bfae80c2 lib/parse/cmdline.py
6161
3a31657bc38f277d0016ff6d50bde61f lib/parse/configfile.py
6262
14539f1be714d4f1ed042067d63bc50a lib/parse/handler.py
6363
64e5bb3ecbdd75144500588b437ba8da lib/parse/headers.py

0 commit comments

Comments
 (0)