Fixing core helpers (decodeStringEscape round-trip, joinValue on Python 3, parseUnionPage case-sensitive de-duplication)

This commit is contained in:
Miroslav Štampar 2026-07-28 21:27:54 +02:00
parent f21a6ab88d
commit 1c869b7430
2 changed files with 13 additions and 5 deletions

View file

@ -2009,7 +2009,10 @@ def parseUnionPage(page):
entry = entry.split(kb.chars.start)[-1]
if kb.unionDuplicates:
key = entry.lower()
# Note: de-dup on the EXACT entry, not entry.lower() - the doubled emission repeats each
# row verbatim, so case-folding here would silently drop genuinely case-distinct rows
# (e.g. 'Admin' vs 'admin'). Force-uppercased pages are already lower-cased before parsing.
key = entry
if key not in keys:
keys.add(key)
else:
@ -3859,7 +3862,7 @@ def joinValue(value, delimiter=','):
"""
if isListLike(value):
retVal = delimiter.join(getText(_ if _ is not None else "None") for _ in value)
retVal = delimiter.join(getText(getUnicode(_) if _ is not None else "None") for _ in value)
else:
retVal = value
@ -4264,9 +4267,14 @@ def decodeStringEscape(value):
retVal = value
if value and '\\' in value:
charset = "\\%s" % string.whitespace.replace(" ", "")
for _ in charset:
# Note: shield an escaped backslash ('\\\\') behind a marker BEFORE decoding the whitespace
# escapes, then restore it - otherwise decoding '\\\\' -> '\\' first turns a literal '\\n'
# into a newline (i.e. the round-trip with encodeStringEscape was not lossless)
_marker = "\x00"
retVal = retVal.replace("\\\\", _marker)
for _ in string.whitespace.replace(" ", ""):
retVal = retVal.replace(repr(_).strip("'"), _)
retVal = retVal.replace(_marker, "\\")
return retVal

View file

@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.7.230"
VERSION = "1.10.7.231"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)