Minor update for letting unhandledExceptionMessage() do it's job if kb has not yet been initialized

This commit is contained in:
Miroslav Stampar 2012-07-24 14:44:44 +02:00
parent ffc520b35f
commit 42f518b2d6

View File

@ -386,11 +386,11 @@ class Backend:
# Get methods # Get methods
@staticmethod @staticmethod
def getForcedDbms(): def getForcedDbms():
return aliasToDbmsEnum(kb.forcedDbms) return aliasToDbmsEnum(kb.get("forcedDbms"))
@staticmethod @staticmethod
def getDbms(): def getDbms():
return aliasToDbmsEnum(kb.dbms) if kb.get('dbms') else None return aliasToDbmsEnum(kb.get("dbms"))
@staticmethod @staticmethod
def getErrorParsedDBMSes(): def getErrorParsedDBMSes():
@ -406,7 +406,7 @@ class Backend:
fingerprint phase. fingerprint phase.
""" """
return kb.htmlFp if kb.heuristicTest is not None else [] return kb.htmlFp if kb.get("heuristicTest") is not None else []
@staticmethod @staticmethod
def getIdentifiedDbms(): def getIdentifiedDbms():
@ -2557,7 +2557,7 @@ def unhandledExceptionMessage():
errMsg += "Python version: %s\n" % PYVERSION errMsg += "Python version: %s\n" % PYVERSION
errMsg += "Operating system: %s\n" % PLATFORM errMsg += "Operating system: %s\n" % PLATFORM
errMsg += "Command line: %s\n" % " ".join(sys.argv) errMsg += "Command line: %s\n" % " ".join(sys.argv)
errMsg += "Technique: %s\n" % (enumValueToNameLookup(PAYLOAD.TECHNIQUE, kb.technique) if kb and kb.technique else None) errMsg += "Technique: %s\n" % (enumValueToNameLookup(PAYLOAD.TECHNIQUE, kb.technique) if kb.get("technique") else None)
errMsg += "Back-end DBMS: %s" % ("%s (fingerprinted)" % Backend.getDbms() if Backend.getDbms() is not None else "%s (identified)" % Backend.getIdentifiedDbms()) errMsg += "Back-end DBMS: %s" % ("%s (fingerprinted)" % Backend.getDbms() if Backend.getDbms() is not None else "%s (identified)" % Backend.getIdentifiedDbms())
return maskSensitiveData(errMsg) return maskSensitiveData(errMsg)