mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-24 18:45:46 +00:00
Adding hidden option '--force-dbms' to skip fingerprinting
This commit is contained in:
parent
3e4130c5e6
commit
c871cedae4
6 changed files with 20 additions and 8 deletions
|
|
@ -76,6 +76,12 @@ def setHandler():
|
|||
items.insert(0, _)
|
||||
|
||||
for dbms, aliases, Handler, Connector in items:
|
||||
if conf.forceDbms:
|
||||
if conf.forceDbms.lower() not in aliases:
|
||||
continue
|
||||
else:
|
||||
kb.dbms = conf.dbms = conf.forceDbms = dbms
|
||||
|
||||
handler = Handler()
|
||||
conf.dbmsConnector = Connector()
|
||||
|
||||
|
|
@ -96,7 +102,7 @@ def setHandler():
|
|||
else:
|
||||
conf.dbmsConnector.connect()
|
||||
|
||||
if handler.checkDbms():
|
||||
if conf.forceDbms == dbms or handler.checkDbms():
|
||||
if kb.resolutionDbms:
|
||||
conf.dbmsHandler = max(_ for _ in items if _[0] == kb.resolutionDbms)[2]()
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ class Backend:
|
|||
# Get methods
|
||||
@staticmethod
|
||||
def getForcedDbms():
|
||||
return aliasToDbmsEnum(kb.get("forcedDbms"))
|
||||
return aliasToDbmsEnum(conf.get("forceDbms")) or aliasToDbmsEnum(kb.get("forcedDbms"))
|
||||
|
||||
@staticmethod
|
||||
def getDbms():
|
||||
|
|
|
|||
|
|
@ -1696,6 +1696,9 @@ def _cleanupOptions():
|
|||
if conf.os:
|
||||
conf.os = conf.os.capitalize()
|
||||
|
||||
if conf.forceDbms:
|
||||
conf.dbms = conf.forceDbms
|
||||
|
||||
if conf.dbms:
|
||||
conf.dbms = conf.dbms.capitalize()
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
|||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.1.8.13"
|
||||
VERSION = "1.1.8.14"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
|
|
@ -782,6 +782,9 @@ def cmdLineParser(argv=None):
|
|||
parser.add_option("--profile", dest="profile", action="store_true",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--force-dbms", dest="forceDbms",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
parser.add_option("--force-dns", dest="forceDns", action="store_true",
|
||||
help=SUPPRESS_HELP)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue