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

Skip to content

Commit 2bb5ba7

Browse files
committed
Bug fix (payload escaping in XML payloads)
1 parent 8d608df commit 2bb5ba7

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

extra/vulnserver/vulnserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def do_REQUEST(self):
103103
if self.data.startswith('{') and self.data.endswith('}'):
104104
params.update(json.loads(self.data))
105105
elif self.data.startswith('<') and self.data.endswith('>'):
106-
params.update(dict(re.findall(r'name="([^"]+)" value="([^"]*)"', self.data)))
106+
params.update(dict((_[0], _[1].replace("&apos;", "'").replace("&quot;", '"').replace("&lt;", '<').replace("&gt;", '>').replace("&amp;", '&')) for _ in re.findall(r'name="([^"]+)" value="([^"]*)"', self.data)))
107107
else:
108108
params.update(parse_qs(self.data))
109109

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.3.11.46"
21+
VERSION = "1.3.11.47"
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)

lib/request/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
932932
if kb.postHint in (POST_HINT.SOAP, POST_HINT.XML):
933933
# payloads in SOAP/XML should have chars > and < replaced
934934
# with their HTML encoded counterparts
935-
payload = payload.replace('>', "&gt;").replace('<', "&lt;")
935+
payload = payload.replace('&', "&amp;").replace('>', "&gt;").replace('<', "&lt;").replace('"', "&quot;").replace("'", "&apos;") # Reference: https://stackoverflow.com/a/1091953
936936
elif kb.postHint == POST_HINT.JSON:
937937
payload = escapeJsonValue(payload)
938938
elif kb.postHint == POST_HINT.JSON_LIKE:

0 commit comments

Comments
 (0)