mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-06 16:53:44 +03:00
much cleaner approach in that "flat" representation of retrieved items in union technique
This commit is contained in:
parent
7fb190f3b1
commit
33bb9c5f19
|
@ -2427,6 +2427,18 @@ def unArrayizeValue(value):
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def flattenValue(value):
|
||||||
|
"""
|
||||||
|
Returns an iterator representing flat representation of a given value
|
||||||
|
"""
|
||||||
|
|
||||||
|
for i in iter(value):
|
||||||
|
if isinstance(i, (list, tuple)):
|
||||||
|
for j in flattenValue(i):
|
||||||
|
yield j
|
||||||
|
else:
|
||||||
|
yield i
|
||||||
|
|
||||||
def getSortedInjectionTests():
|
def getSortedInjectionTests():
|
||||||
"""
|
"""
|
||||||
Returns prioritized test list by eventually detected DBMS from error
|
Returns prioritized test list by eventually detected DBMS from error
|
||||||
|
|
|
@ -19,6 +19,7 @@ from lib.core.common import calculateDeltaSeconds
|
||||||
from lib.core.common import clearConsoleLine
|
from lib.core.common import clearConsoleLine
|
||||||
from lib.core.common import dataToStdout
|
from lib.core.common import dataToStdout
|
||||||
from lib.core.common import extractRegexResult
|
from lib.core.common import extractRegexResult
|
||||||
|
from lib.core.common import flattenValue
|
||||||
from lib.core.common import getConsoleWidth
|
from lib.core.common import getConsoleWidth
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.common import hashDBRetrieve
|
from lib.core.common import hashDBRetrieve
|
||||||
|
@ -316,7 +317,7 @@ def unionUse(expression, unpack=True, dump=False):
|
||||||
items = output.replace(kb.chars.start, "").replace(kb.chars.stop, "").split(kb.chars.delimiter)
|
items = output.replace(kb.chars.start, "").replace(kb.chars.stop, "").split(kb.chars.delimiter)
|
||||||
|
|
||||||
if conf.verbose == 1:
|
if conf.verbose == 1:
|
||||||
status = "[%s] [INFO] %s: %s" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", safecharencode(",".join("\"%s\"" % _ for _ in arrayizeValue(unArrayizeValue(items)))))
|
status = "[%s] [INFO] %s: %s" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", safecharencode(",".join("\"%s\"" % _ for _ in flattenValue(arrayizeValue(items)))))
|
||||||
|
|
||||||
if len(status) > width:
|
if len(status) > width:
|
||||||
status = "%s..." % status[:width - 3]
|
status = "%s..." % status[:width - 3]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user