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

Skip to content

Commit f6ff1a1

Browse files
committed
Better (automatic) picking of a --string candidate (especially in case of international pages)
1 parent 32ee586 commit f6ff1a1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

lib/controller/checks.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,20 @@ def genCmpPayload():
471471

472472
if not injectable and not any((conf.string, conf.notString, conf.regexp)) and kb.pageStable:
473473
trueSet = set(extractTextTagContent(truePage))
474+
trueSet = trueSet.union(__ for _ in trueSet for __ in _.split())
475+
474476
falseSet = set(extractTextTagContent(falsePage))
477+
falseSet = falseSet.union(__ for _ in falseSet for __ in _.split())
478+
475479
candidates = filter(None, (_.strip() if _.strip() in (kb.pageTemplate or "") and _.strip() not in falsePage and _.strip() not in threadData.lastComparisonHeaders else None for _ in (trueSet - falseSet)))
476480

477481
if candidates:
478-
conf.string = candidates[0]
482+
candidates = sorted(candidates, key=lambda _: len(_))
483+
for candidate in candidates:
484+
if re.match(r"\A\w+\Z", candidate):
485+
break
486+
conf.string = candidate
487+
479488
infoMsg = "%s parameter '%s' seems to be '%s' injectable (with --string=\"%s\")" % (paramType, parameter, title, repr(conf.string).lstrip('u').strip("'"))
480489
logger.info(infoMsg)
481490

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.5.45"
22+
VERSION = "1.0.5.46"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

0 commit comments

Comments
 (0)