Bug fix (in --dump mode if error/inband failed with None other techniques were ignored)

This commit is contained in:
Miroslav Stampar 2012-10-27 23:42:52 +02:00
parent 06805b27f2
commit 0aeb9dbe8b
2 changed files with 21 additions and 23 deletions

View File

@ -367,7 +367,6 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
through inband SQL injection (if selected) and/or blind SQL injection through inband SQL injection (if selected) and/or blind SQL injection
(if selected). (if selected).
""" """
kb.safeCharEncode = safeCharEncode kb.safeCharEncode = safeCharEncode
kb.resumeValues = resumeValue kb.resumeValues = resumeValue

View File

@ -162,35 +162,34 @@ class Entries:
if not entries and query: if not entries and query:
entries = inject.getValue(query, blind=False, time=False, dump=True) entries = inject.getValue(query, blind=False, time=False, dump=True)
if isNoneValue(entries): if not isNoneValue(entries):
entries = [] if isinstance(entries, basestring):
elif isinstance(entries, basestring): entries = [entries]
entries = [entries] elif not isListLike(entries):
elif not isListLike(entries): entries = []
entries = []
entriesCount = len(entries) entriesCount = len(entries)
for index, column in enumerate(colList): for index, column in enumerate(colList):
if column not in kb.data.dumpedTable: if column not in kb.data.dumpedTable:
kb.data.dumpedTable[column] = {"length": len(column), "values": BigArray()} kb.data.dumpedTable[column] = {"length": len(column), "values": BigArray()}
for entry in entries: for entry in entries:
if entry is None or len(entry) == 0: if entry is None or len(entry) == 0:
continue continue
if isinstance(entry, basestring): if isinstance(entry, basestring):
colEntry = entry colEntry = entry
else: else:
colEntry = unArrayizeValue(entry[index]) if index < len(entry) else u'' colEntry = unArrayizeValue(entry[index]) if index < len(entry) else u''
_ = len(DUMP_REPLACEMENTS.get(getUnicode(colEntry), getUnicode(colEntry))) _ = len(DUMP_REPLACEMENTS.get(getUnicode(colEntry), getUnicode(colEntry)))
maxLen = max(len(column), _) maxLen = max(len(column), _)
if maxLen > kb.data.dumpedTable[column]["length"]: if maxLen > kb.data.dumpedTable[column]["length"]:
kb.data.dumpedTable[column]["length"] = maxLen kb.data.dumpedTable[column]["length"] = maxLen
kb.data.dumpedTable[column]["values"].append(colEntry) kb.data.dumpedTable[column]["values"].append(colEntry)
if not kb.data.dumpedTable and isInferenceAvailable() and not conf.direct: if not kb.data.dumpedTable and isInferenceAvailable() and not conf.direct:
infoMsg = "fetching number of " infoMsg = "fetching number of "