mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-03 19:55:47 +03:00
little refactoring of parseUnionPage together with a patch for some special case
This commit is contained in:
parent
7fb1f3fc70
commit
1418ae9767
|
@ -1178,27 +1178,27 @@ def getLimitRange(count, dump=False, plusOne=False):
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
def parseUnionPage(output, unique=True):
|
def parseUnionPage(page, unique=True):
|
||||||
"""
|
"""
|
||||||
Returns resulting items from inband query inside provided page content
|
Returns resulting items from inband query inside provided page content
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if output is None:
|
if page is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if output.startswith(kb.chars.start) and output.endswith(kb.chars.stop):
|
if page.startswith(kb.chars.start) and page.endswith(kb.chars.stop):
|
||||||
if len(output) > LARGE_OUTPUT_THRESHOLD:
|
if len(page) > LARGE_OUTPUT_THRESHOLD:
|
||||||
warnMsg = "large output detected. This might take a while"
|
warnMsg = "large output detected. This might take a while"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
data = BigArray()
|
data = BigArray()
|
||||||
_ = []
|
_ = []
|
||||||
|
|
||||||
regExpr = '%s(.*?)%s' % (kb.chars.start, kb.chars.stop)
|
for match in re.finditer("%s(.*?)%s" % (kb.chars.start, kb.chars.stop), page, re.DOTALL | re.IGNORECASE):
|
||||||
output = re.finditer(regExpr, output, re.DOTALL | re.IGNORECASE)
|
entry = match.group(1)
|
||||||
|
|
||||||
for entry in output:
|
if kb.chars.start in entry:
|
||||||
entry = entry.group(1)
|
entry = entry.split(kb.chars.start)[-1]
|
||||||
|
|
||||||
if unique:
|
if unique:
|
||||||
key = entry.lower()
|
key = entry.lower()
|
||||||
|
@ -1219,7 +1219,7 @@ def parseUnionPage(output, unique=True):
|
||||||
|
|
||||||
data.append(entry[0] if len(entry) == 1 else entry)
|
data.append(entry[0] if len(entry) == 1 else entry)
|
||||||
else:
|
else:
|
||||||
data = output
|
data = page
|
||||||
|
|
||||||
if len(data) == 1 and isinstance(data[0], basestring):
|
if len(data) == 1 and isinstance(data[0], basestring):
|
||||||
data = data[0]
|
data = data[0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user