diff --git a/lib/core/common.py b/lib/core/common.py index 8010ccbef..8939f17f2 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1328,7 +1328,7 @@ def getRange(count, dump=False, plusOne=False): return indexRange -def parseUnionPage(output, expression, partial=False, unique=True): +def parseUnionPage(output, unique=True): if output is None: return None @@ -1336,10 +1336,12 @@ def parseUnionPage(output, expression, partial=False, unique=True): if output.startswith(kb.chars.start) and output.endswith(kb.chars.stop): regExpr = '%s(.*?)%s' % (kb.chars.start, kb.chars.stop) - output = re.findall(regExpr, output, re.DOTALL | re.IGNORECASE) + output = re.finditer(regExpr, output, re.DOTALL | re.IGNORECASE) _ = set() for entry in output: + entry = entry.group(1) + if unique: key = entry.lower() if key not in _: diff --git a/lib/request/inject.py b/lib/request/inject.py index d8f231da4..5516d7f1b 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -384,7 +384,7 @@ def __goInband(expression, expected=None, unique=True, resumeValue=True, unpack= if isinstance(output, list): data = output else: - data = parseUnionPage(output, expression, partial, unique) + data = parseUnionPage(output, unique) return data diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 126433d36..411819ded 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -233,13 +233,13 @@ def unionUse(expression, unpack=True, dump=False): countedExpression = countedExpression[:untilOrderChar] count = resume(countedExpression, None) - count = parseUnionPage(count, countedExpression) + count = parseUnionPage(count) if not count or not count.isdigit(): output = __oneShotUnionUse(countedExpression, unpack) if output: - count = parseUnionPage(output, countedExpression) + count = parseUnionPage(output) if isNumPosStrValue(count): if isinstance(stopLimit, int) and stopLimit > 0: