Patch for an Issue #582

This commit is contained in:
Miroslav Stampar 2013-12-26 22:27:04 +01:00
parent ab64d385d6
commit 02de2aee6d
3 changed files with 16 additions and 13 deletions

View File

@ -351,7 +351,8 @@ class Agent(object):
else:
nulledCastedField = rootQuery.isnull.query % nulledCastedField
if conf.hexConvert or conf.binaryFields and field in conf.binaryFields.split(','):
kb.binaryField = conf.binaryFields and field in conf.binaryFields.split(',')
if conf.hexConvert or kb.binaryField:
nulledCastedField = self.hexConvertField(nulledCastedField)
return nulledCastedField

View File

@ -3478,6 +3478,7 @@ def decodeHexValue(value):
if value and isinstance(value, basestring) and len(value) % 2 == 0:
retVal = hexdecode(retVal)
if not kb.binaryField:
if Backend.isDbms(DBMS.MSSQL) and value.startswith("0x"):
try:
retVal = retVal.decode("utf-16-le")

View File

@ -1572,6 +1572,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
kb.arch = None
kb.authHeader = None
kb.bannerFp = AttribDict()
kb.binaryField = False
kb.brute = AttribDict({"tables": [], "columns": []})
kb.bruteMode = False