Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b45ae10

Browse files
committed
minor fixes
1 parent 627bfc5 commit b45ae10

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/controller/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def genCmpPayload():
349349
if not injectable and not conf.string:
350350
trueSet = set(extractTextTagContent(truePage))
351351
falseSet = set(extractTextTagContent(falsePage))
352-
candidate = reduce(lambda x, y: x or (y.strip() if y.strip() in (kb.pageTemplate or "") else None), (trueSet - falseSet), None)
352+
candidate = reduce(lambda x, y: x or (y.strip() if y.strip() in (kb.pageTemplate or "") and y.strip() not in falsePage else None), (trueSet - falseSet), None)
353353
if candidate:
354354
conf.string = candidate
355355
infoMsg = "%s parameter '%s' seems to be '%s' injectable (with --string=%s)" % (place, parameter, title, repr(candidate).lstrip('u'))

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,8 +2161,8 @@ def extractTextTagContent(page):
21612161
Returns list containing content from "textual" tags
21622162
"""
21632163

2164-
page = re.sub(r"(?si)[^\s]*%s[^<]*" % REFLECTED_VALUE_MARKER, "", page or "")
2165-
return [_.group('result') for _ in re.finditer(TEXT_TAG_REGEX, page)]
2164+
page = re.sub(r"(?si)[^\s>]*%s[^<]*" % REFLECTED_VALUE_MARKER, "", page or "")
2165+
return filter(None, (_.group('result').strip() for _ in re.finditer(TEXT_TAG_REGEX, page)))
21662166

21672167
def trimAlphaNum(value):
21682168
"""

0 commit comments

Comments
 (0)