Skip to content

Commit 02dcf2a

Browse files
committed
Fixes #5203
1 parent 5c55602 commit 02dcf2a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.6.10.6"
23+
VERSION = "1.6.10.7"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

tamper/htmlencode.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ def tamper(payload, **kwargs):
2020
2121
>>> tamper("1' AND SLEEP(5)#")
2222
'1&#39;&#32;AND&#32;SLEEP&#40;5&#41;&#35;'
23+
>>> tamper("1&#39;&#32;AND&#32;SLEEP&#40;5&#41;&#35;")
24+
'1&#39;&#32;AND&#32;SLEEP&#40;5&#41;&#35;'
2325
"""
2426

25-
return re.sub(r"[^\w]", lambda match: "&#%d;" % ord(match.group(0)), payload) if payload else payload
27+
if payload:
28+
payload = re.sub(r"&#(\d+);", lambda match: chr(int(match.group(1))), payload) # NOTE: https://github.com/sqlmapproject/sqlmap/issues/5203
29+
payload = re.sub(r"[^\w]", lambda match: "&#%d;" % ord(match.group(0)), payload)
30+
31+
return payload

0 commit comments

Comments
 (0)