Skip to content

Commit 9312d26

Browse files
authored
Make XML/HTML encoding in SOAP requests optional (#6015)
Co-authored-by: soffensive <soffensive>
1 parent 2b6115c commit 9312d26

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

lib/core/optiondict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"safeReqFile": "string",
6464
"safeFreq": "integer",
6565
"skipUrlEncode": "boolean",
66+
"skipXmlEncode": "boolean",
6667
"csrfToken": "string",
6768
"csrfUrl": "string",
6869
"csrfMethod": "string",

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ def cmdLineParser(argv=None):
276276
request.add_argument("--skip-urlencode", dest="skipUrlEncode", action="store_true",
277277
help="Skip URL encoding of payload data")
278278

279+
request.add_argument("--skip-xml-encode", dest="skipXmlEncode", action="store_true",
280+
help="Skip HTML encoding of payload data for SOAP/XML")
281+
279282
request.add_argument("--csrf-token", dest="csrfToken",
280283
help="Parameter used to hold anti-CSRF token")
281284

lib/request/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
11161116
logger.log(CUSTOM_LOGGING.PAYLOAD, safecharencode(payload.replace('\\', BOUNDARY_BACKSLASH_MARKER)).replace(BOUNDARY_BACKSLASH_MARKER, '\\'))
11171117

11181118
if place == PLACE.CUSTOM_POST and kb.postHint:
1119-
if kb.postHint in (POST_HINT.SOAP, POST_HINT.XML):
1119+
if kb.postHint in (POST_HINT.SOAP, POST_HINT.XML) and not conf.skipXmlEncode:
11201120
# payloads in SOAP/XML should have chars > and < replaced
11211121
# with their HTML encoded counterparts
11221122
payload = payload.replace("&#", SAFE_HEX_MARKER)

sqlmap.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ safeFreq = 0
198198
# Valid: True or False
199199
skipUrlEncode = False
200200

201+
# Skip HTML encoding of payload data for SOAP/XML.
202+
# Valid: True or False
203+
skipXmlEncode = False
204+
201205
# Parameter used to hold anti-CSRF token.
202206
csrfToken =
203207

0 commit comments

Comments
 (0)