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

Skip to content

Commit 7a6433b

Browse files
committed
Proper implementation for #4184
1 parent 4e7f0b1 commit 7a6433b

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

lib/core/common.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,17 +675,21 @@ def walk(head, current=None):
675675
elif isinstance(current, dict):
676676
for key in current.keys():
677677
value = current[key]
678-
if isinstance(value, (list, tuple, set, dict)):
679-
if value:
680-
walk(head, value)
681-
elif isinstance(value, (bool, int, float, six.string_types)):
678+
if isinstance(value, (bool, int, float, six.string_types)) or value in (None, []):
682679
original = current[key]
683680
if isinstance(value, bool):
684681
current[key] = "%s%s" % (getUnicode(value).lower(), BOUNDED_INJECTION_MARKER)
682+
elif value is None:
683+
current[key] = "%s%s" % (randomInt(), BOUNDED_INJECTION_MARKER)
684+
elif value == []:
685+
current[key] = ["%s%s" % (randomInt(), BOUNDED_INJECTION_MARKER)]
685686
else:
686687
current[key] = "%s%s" % (value, BOUNDED_INJECTION_MARKER)
687688
candidates["%s (%s)" % (parameter, key)] = re.sub(r"\b(%s\s*=\s*)%s" % (re.escape(parameter), re.escape(testableParameters[parameter])), r"\g<1>%s" % json.dumps(deserialized, separators=(',', ':') if ", " not in testableParameters[parameter] else None), parameters)
688689
current[key] = original
690+
elif isinstance(value, (list, tuple, set, dict)):
691+
if value:
692+
walk(head, value)
689693

690694
deserialized = json.loads(testableParameters[parameter])
691695
walk(deserialized)

lib/core/settings.py

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

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

0 commit comments

Comments
 (0)