Skip to content

Commit 0b775b6

Browse files
committed
Fix for json/eval bug (#5013)
1 parent b188112 commit 0b775b6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
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.3.4"
23+
VERSION = "1.6.3.5"
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)

lib/request/connect.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,17 @@ def _randomizeParameter(paramString, randomParameter):
13571357
found = True
13581358
post = re.sub(r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re.escape(name), re.escape(name)), r"\g<1>%s\g<3>" % value.replace('\\', r'\\'), post)
13591359

1360+
elif kb.postHint in (POST_HINT.JSON, POST_HINT.JSON_LIKE):
1361+
match = re.search(r"['\"]%s['\"]:" % re.escape(name), post)
1362+
if match:
1363+
quote = match.group(0)[0]
1364+
post = post.replace("\\%s" % quote, BOUNDARY_BACKSLASH_MARKER)
1365+
match = re.search(r"(%s%s%s:\s*)(\d+|%s[^%s]*%s)" % (quote, re.escape(name), quote, quote, quote, quote), post)
1366+
if match:
1367+
found = True
1368+
post = post.replace(match.group(0), "%s%s" % (match.group(1), value if value.isdigit() else "%s%s%s" % (match.group(0)[0], value, match.group(0)[0])))
1369+
post = post.replace(BOUNDARY_BACKSLASH_MARKER, "\\%s" % quote)
1370+
13601371
regex = r"\b(%s)\b([^\w]+)(\w+)" % re.escape(name)
13611372
if not found and re.search(regex, (post or "")):
13621373
found = True

0 commit comments

Comments
 (0)