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