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:
Bernardo Damele 2011-01-14 11:55:20 +00:00
parent f209b7a65e
commit 3c95d71ea5
23 changed files with 31 additions and 39 deletions

View File

@ -98,6 +98,10 @@ def setHandler():
kb.dbmsDetected = True
conf.dbmsHandler = handler
return
break
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

View File

@ -2044,7 +2044,9 @@ def getErrorParsedDBMSes():
def getIdentifiedDBMS():
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
elif conf.dbms is not None:
dbms = conf.dbms

View File

@ -1172,6 +1172,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
if flushAll:
kb.keywords = set(getFileItems(paths.SQL_KEYWORDS))

View File

@ -8,13 +8,11 @@ See the file 'doc/COPYING' for copying permission
"""
from lib.core.data import logger
from lib.core.enums import DBMS
from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.ACCESS)
GenericEnumeration.__init__(self)
def getDbs(self):
warnMsg = "on Microsoft Access it is not possible to enumerate databases"

View File

@ -33,7 +33,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.ACCESS)
def __sandBoxCheck(self):
# Reference: http://milw0rm.com/papers/198

View File

@ -8,13 +8,11 @@ See the file 'doc/COPYING' for copying permission
"""
from lib.core.data import logger
from lib.core.enums import DBMS
from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.FIREBIRD)
GenericEnumeration.__init__(self)
def getDbs(self):
warnMsg = "on Firebird it is not possible to enumerate databases"

View File

@ -31,7 +31,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.FIREBIRD)
def getFingerprint(self):
value = ""

View File

@ -9,13 +9,11 @@ See the file 'doc/COPYING' for copying permission
from lib.core.data import kb
from lib.core.data import logger
from lib.core.enums import DBMS
from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.MAXDB)
GenericEnumeration.__init__(self)
kb.data.processChar = lambda x: x.replace('_', ' ') if x else x

View File

@ -30,7 +30,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.MAXDB)
def __versionCheck(self):
infoMsg = "executing SAP MaxDB SYSINFO version check"

View File

@ -17,7 +17,6 @@ from lib.core.data import conf
from lib.core.data import kb
from lib.core.data import logger
from lib.core.data import queries
from lib.core.enums import DBMS
from lib.core.enums import EXPECTED
from lib.core.exception import sqlmapNoneDataException
from lib.request import inject
@ -26,7 +25,7 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.MSSQL)
GenericEnumeration.__init__(self)
def getPrivileges(self, *args):
warnMsg = "on Microsoft SQL Server it is not possible to fetch "

View File

@ -28,7 +28,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.MSSQL)
def getFingerprint(self):
value = ""

View File

@ -7,9 +7,8 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.MYSQL)
GenericEnumeration.__init__(self)

View File

@ -31,7 +31,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.MYSQL)
def __commentCheck(self):
infoMsg = "executing MySQL comment injection fingerprint"

View File

@ -16,7 +16,6 @@ from lib.core.data import conf
from lib.core.data import kb
from lib.core.data import logger
from lib.core.data import queries
from lib.core.enums import DBMS
from lib.core.enums import EXPECTED
from lib.core.exception import sqlmapNoneDataException
from lib.request import inject
@ -25,7 +24,7 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.ORACLE)
GenericEnumeration.__init__(self)
def getRoles(self, query2=False):
infoMsg = "fetching database users roles"

View File

@ -27,7 +27,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.ORACLE)
def getFingerprint(self):
value = ""

View File

@ -12,4 +12,4 @@ from plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.PGSQL)
GenericEnumeration.__init__(self)

View File

@ -30,7 +30,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.PGSQL)
def getFingerprint(self):
value = ""

View File

@ -7,16 +7,13 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
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 plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.SQLITE)
GenericEnumeration.__init__(self)
def getCurrentUser(self):
warnMsg = "on SQLite it is not possible to enumerate the current user"

View File

@ -26,7 +26,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.SQLITE)
def getFingerprint(self):
value = ""

View File

@ -7,13 +7,9 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
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 plugins.generic.enumeration import Enumeration as GenericEnumeration
class Enumeration(GenericEnumeration):
def __init__(self):
GenericEnumeration.__init__(self, DBMS.SYBASE)
GenericEnumeration.__init__(self)

View File

@ -26,7 +26,7 @@ from plugins.generic.fingerprint import Fingerprint as GenericFingerprint
class Fingerprint(GenericFingerprint):
def __init__(self):
GenericFingerprint.__init__(self)
GenericFingerprint.__init__(self, DBMS.SYBASE)
def getFingerprint(self):
value = ""

View File

@ -61,7 +61,7 @@ class Enumeration:
This class defines generic enumeration functionalities for plugins.
"""
def __init__(self, dbms):
def __init__(self):
kb.data.has_information_schema = False
kb.data.banner = None
kb.data.currentUser = ""

View File

@ -7,6 +7,7 @@ Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.data import kb
from lib.core.exception import sqlmapUndefinedMethod
class Fingerprint:
@ -14,8 +15,8 @@ class Fingerprint:
This class defines generic fingerprint functionalities for plugins.
"""
def __init__(self):
pass
def __init__(self, dbms):
kb.misc.fpDbms = dbms
def getFingerprint(self):
errMsg = "'getFingerprint' method must be defined "