mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 01:26:42 +03:00
Minor code refactoring
This commit is contained in:
parent
041abb56e2
commit
47565f9459
|
@ -381,7 +381,7 @@ def checkSqlInjection(place, parameter, value):
|
|||
|
||||
# Set fingerprinted DBMS according to the
|
||||
# current test settings for proper unescaping
|
||||
kb.misc.fpDbms = dbms
|
||||
kb.misc.forcedDbms = dbms
|
||||
|
||||
if not getIdentifiedDBMS():
|
||||
warnMsg = "using unescaped version of the test "
|
||||
|
@ -402,7 +402,7 @@ def checkSqlInjection(place, parameter, value):
|
|||
# by unionTest() directly
|
||||
where = vector[6]
|
||||
|
||||
kb.misc.fpDbms = None
|
||||
kb.misc.forcedDbms = None
|
||||
|
||||
# If the injection test was successful feed the injection
|
||||
# object with the test's details
|
||||
|
|
|
@ -101,6 +101,5 @@ def setHandler():
|
|||
else:
|
||||
conf.dbmsConnector = None
|
||||
|
||||
# At this point proper back-end DBMS will be identified (kb.dbms)
|
||||
# so we have to force DBMS
|
||||
kb.misc.fpDbms = None
|
||||
# At this point proper back-end DBMS is fingerprinted (kb.dbms)
|
||||
kb.misc.forcedDbms = None
|
||||
|
|
|
@ -2077,8 +2077,8 @@ def getErrorParsedDBMSes():
|
|||
def getIdentifiedDBMS():
|
||||
dbms = None
|
||||
|
||||
if kb.misc.fpDbms is not None:
|
||||
dbms = kb.misc.fpDbms
|
||||
if kb.misc.forcedDbms is not None:
|
||||
dbms = kb.misc.forcedDbms
|
||||
elif kb.dbms is not None:
|
||||
dbms = kb.dbms
|
||||
elif conf.dbms is not None:
|
||||
|
|
|
@ -1171,7 +1171,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
|||
kb.misc.start = ":%s:" % randomStr(length=3, lowercase=True)
|
||||
kb.misc.stop = ":%s:" % randomStr(length=3, lowercase=True)
|
||||
kb.misc.space = ":%s:" % randomStr(length=1, lowercase=True)
|
||||
kb.misc.fpDbms = None
|
||||
kb.misc.forcedDbms = None
|
||||
|
||||
if flushAll:
|
||||
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))
|
||||
|
|
|
@ -18,7 +18,7 @@ class Fingerprint:
|
|||
"""
|
||||
|
||||
def __init__(self, dbms):
|
||||
kb.misc.fpDbms = dbms
|
||||
kb.misc.forcedDbms = dbms
|
||||
|
||||
def getFingerprint(self):
|
||||
errMsg = "'getFingerprint' method must be defined "
|
||||
|
|
Loading…
Reference in New Issue
Block a user