mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-10 02:33:44 +03:00
Minor bug fix - restored of so called kb.misc.testedDbms (now kb.misc.fpDbms) to force the DBMS (only) during the fingerprint phase
This commit is contained in:
parent
f209b7a65e
commit
3c95d71ea5
|
@ -98,6 +98,10 @@ def setHandler():
|
||||||
kb.dbmsDetected = True
|
kb.dbmsDetected = True
|
||||||
conf.dbmsHandler = handler
|
conf.dbmsHandler = handler
|
||||||
|
|
||||||
return
|
break
|
||||||
else:
|
else:
|
||||||
conf.dbmsConnector = None
|
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
|
||||||
|
|
|
@ -2044,7 +2044,9 @@ def getErrorParsedDBMSes():
|
||||||
def getIdentifiedDBMS():
|
def getIdentifiedDBMS():
|
||||||
dbms = None
|
dbms = None
|
||||||
|
|
||||||
if kb.dbms is not None:
|
if kb.misc.fpDbms is not None:
|
||||||
|
dbms = kb.misc.fpDbms
|
||||||
|
elif kb.dbms is not None:
|
||||||
dbms = kb.dbms
|
dbms = kb.dbms
|
||||||
elif conf.dbms is not None:
|
elif conf.dbms is not None:
|
||||||
dbms = conf.dbms
|
dbms = conf.dbms
|
||||||
|
|
|
@ -1172,6 +1172,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
|
||||||
|
|
||||||
if flushAll:
|
if flushAll:
|
||||||
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))
|
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))
|
||||||
|
|
|
@ -8,13 +8,11 @@ See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.enums import DBMS
|
|
||||||
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.ACCESS)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
def getDbs(self):
|
def getDbs(self):
|
||||||
warnMsg = "on Microsoft Access it is not possible to enumerate databases"
|
warnMsg = "on Microsoft Access it is not possible to enumerate databases"
|
||||||
|
|
|
@ -33,7 +33,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.ACCESS)
|
||||||
|
|
||||||
def __sandBoxCheck(self):
|
def __sandBoxCheck(self):
|
||||||
# Reference: http://milw0rm.com/papers/198
|
# Reference: http://milw0rm.com/papers/198
|
||||||
|
|
|
@ -8,13 +8,11 @@ See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.enums import DBMS
|
|
||||||
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.FIREBIRD)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
def getDbs(self):
|
def getDbs(self):
|
||||||
warnMsg = "on Firebird it is not possible to enumerate databases"
|
warnMsg = "on Firebird it is not possible to enumerate databases"
|
||||||
|
|
|
@ -31,7 +31,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.FIREBIRD)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -9,13 +9,11 @@ See the file 'doc/COPYING' for copying permission
|
||||||
|
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.enums import DBMS
|
|
||||||
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.MAXDB)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
kb.data.processChar = lambda x: x.replace('_', ' ') if x else x
|
kb.data.processChar = lambda x: x.replace('_', ' ') if x else x
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.MAXDB)
|
||||||
|
|
||||||
def __versionCheck(self):
|
def __versionCheck(self):
|
||||||
infoMsg = "executing SAP MaxDB SYSINFO version check"
|
infoMsg = "executing SAP MaxDB SYSINFO version check"
|
||||||
|
|
|
@ -17,7 +17,6 @@ from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.data import queries
|
from lib.core.data import queries
|
||||||
from lib.core.enums import DBMS
|
|
||||||
from lib.core.enums import EXPECTED
|
from lib.core.enums import EXPECTED
|
||||||
from lib.core.exception import sqlmapNoneDataException
|
from lib.core.exception import sqlmapNoneDataException
|
||||||
from lib.request import inject
|
from lib.request import inject
|
||||||
|
@ -26,7 +25,7 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.MSSQL)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
def getPrivileges(self, *args):
|
def getPrivileges(self, *args):
|
||||||
warnMsg = "on Microsoft SQL Server it is not possible to fetch "
|
warnMsg = "on Microsoft SQL Server it is not possible to fetch "
|
||||||
|
|
|
@ -28,7 +28,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.MSSQL)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -7,9 +7,8 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lib.core.enums import DBMS
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.MYSQL)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
|
@ -31,7 +31,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.MYSQL)
|
||||||
|
|
||||||
def __commentCheck(self):
|
def __commentCheck(self):
|
||||||
infoMsg = "executing MySQL comment injection fingerprint"
|
infoMsg = "executing MySQL comment injection fingerprint"
|
||||||
|
|
|
@ -16,7 +16,6 @@ from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.data import queries
|
from lib.core.data import queries
|
||||||
from lib.core.enums import DBMS
|
|
||||||
from lib.core.enums import EXPECTED
|
from lib.core.enums import EXPECTED
|
||||||
from lib.core.exception import sqlmapNoneDataException
|
from lib.core.exception import sqlmapNoneDataException
|
||||||
from lib.request import inject
|
from lib.request import inject
|
||||||
|
@ -25,7 +24,7 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.ORACLE)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
def getRoles(self, query2=False):
|
def getRoles(self, query2=False):
|
||||||
infoMsg = "fetching database users roles"
|
infoMsg = "fetching database users roles"
|
||||||
|
|
|
@ -27,7 +27,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.ORACLE)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -12,4 +12,4 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.PGSQL)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
|
@ -30,7 +30,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.PGSQL)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -7,16 +7,13 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lib.core.data import conf
|
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
from lib.core.enums import DBMS
|
|
||||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||||
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.SQLITE)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
||||||
def getCurrentUser(self):
|
def getCurrentUser(self):
|
||||||
warnMsg = "on SQLite it is not possible to enumerate the current user"
|
warnMsg = "on SQLite it is not possible to enumerate the current user"
|
||||||
|
|
|
@ -26,7 +26,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.SQLITE)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -7,13 +7,9 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from lib.core.data import conf
|
|
||||||
from lib.core.data import logger
|
|
||||||
from lib.core.enums import DBMS
|
|
||||||
from lib.core.exception import sqlmapUnsupportedFeatureException
|
from lib.core.exception import sqlmapUnsupportedFeatureException
|
||||||
|
|
||||||
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
||||||
|
|
||||||
class Enumeration(GenericEnumeration):
|
class Enumeration(GenericEnumeration):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericEnumeration.__init__(self, DBMS.SYBASE)
|
GenericEnumeration.__init__(self)
|
||||||
|
|
|
@ -26,7 +26,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
|
||||||
|
|
||||||
class Fingerprint(GenericFingerprint):
|
class Fingerprint(GenericFingerprint):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
GenericFingerprint.__init__(self)
|
GenericFingerprint.__init__(self, DBMS.SYBASE)
|
||||||
|
|
||||||
def getFingerprint(self):
|
def getFingerprint(self):
|
||||||
value = ""
|
value = ""
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Enumeration:
|
||||||
This class defines generic enumeration functionalities for plugins.
|
This class defines generic enumeration functionalities for plugins.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, dbms):
|
def __init__(self):
|
||||||
kb.data.has_information_schema = False
|
kb.data.has_information_schema = False
|
||||||
kb.data.banner = None
|
kb.data.banner = None
|
||||||
kb.data.currentUser = ""
|
kb.data.currentUser = ""
|
||||||
|
|
|
@ -7,6 +7,7 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||||
See the file 'doc/COPYING' for copying permission
|
See the file 'doc/COPYING' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from lib.core.data import kb
|
||||||
from lib.core.exception import sqlmapUndefinedMethod
|
from lib.core.exception import sqlmapUndefinedMethod
|
||||||
|
|
||||||
class Fingerprint:
|
class Fingerprint:
|
||||||
|
@ -14,8 +15,8 @@ class Fingerprint:
|
||||||
This class defines generic fingerprint functionalities for plugins.
|
This class defines generic fingerprint functionalities for plugins.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, dbms):
|
||||||
pass
|
kb.misc.fpDbms = 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