Skip to content

Commit d175dec

Browse files
committed
Fix for an Issue sqlmapproject#190
1 parent a6eeebf commit d175dec

File tree

5 files changed

+7
-44
lines changed

5 files changed

+7
-44
lines changed

lib/core/common.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,30 +1301,6 @@ def searchEnvPath(filename):
13011301

13021302
return retVal
13031303

1304-
def urlEncodeCookieValues(cookieStr):
1305-
if cookieStr:
1306-
retVal = ""
1307-
1308-
for part in cookieStr.split(';'):
1309-
index = part.find('=') + 1
1310-
if index > 0:
1311-
name = part[:index - 1].strip()
1312-
value = urlencode(part[index:], convall=True)
1313-
retVal += "; %s=%s" % (name, value)
1314-
elif part.strip().lower() != "secure":
1315-
retVal += "%s%s" % ("%3B", urlencode(part, convall=True))
1316-
else:
1317-
retVal += "; secure"
1318-
1319-
if retVal.startswith('; '):
1320-
retVal = retVal[2:]
1321-
elif retVal.startswith('%3B'):
1322-
retVal = retVal[3:]
1323-
1324-
return retVal
1325-
else:
1326-
return None
1327-
13281304
def directoryPath(filepath):
13291305
"""
13301306
Returns directory path for a given filepath

lib/core/optiondict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"pDel": "string",
2626
"cookie": "string",
2727
"loadCookies": "string",
28-
"cookieUrlencode": "boolean",
2928
"dropSetCookie": "boolean",
3029
"agent": "string",
3130
"randomAgent": "boolean",

lib/parse/cmdline.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ def cmdLineParser():
8080
request.add_option("--load-cookies", dest="loadCookies",
8181
help="File containing cookies in Netscape/wget format")
8282

83-
request.add_option("--cookie-urlencode", dest="cookieUrlencode",
84-
action="store_true",
85-
help="URL Encode generated cookie injections")
86-
8783
request.add_option("--drop-set-cookie", dest="dropSetCookie",
8884
action="store_true",
8985
help="Ignore Set-Cookie header from response")

lib/request/connect.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from lib.core.common import removeReflectiveValues
3333
from lib.core.common import singleTimeWarnMessage
3434
from lib.core.common import stdev
35-
from lib.core.common import urlEncodeCookieValues
3635
from lib.core.common import wasLastRequestDelayed
3736
from lib.core.common import unicodeencode
3837
from lib.core.common import urlencode
@@ -577,7 +576,13 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
577576

578577
logger.log(CUSTOM_LOGGING.PAYLOAD, safecharencode(payload))
579578

580-
if place in (PLACE.GET, PLACE.POST, PLACE.URI, PLACE.CUSTOM_POST):
579+
if place == PLACE.SOAP:
580+
# payloads in SOAP should have chars > and < replaced
581+
# with their HTML encoded counterparts
582+
payload = payload.replace('>', "&gt;").replace('<', "&lt;")
583+
value = agent.replacePayload(value, payload)
584+
585+
else:
581586
# payloads in GET and/or POST need to be urlencoded
582587
# throughly without safe chars (especially & and =)
583588
# addendum: as we support url encoding in tampering
@@ -586,18 +591,9 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
586591
payload = urlencode(payload, '%', False, True) if place not in (PLACE.POST, PLACE.CUSTOM_POST) and not skipUrlEncode else payload
587592
value = agent.replacePayload(value, payload)
588593

589-
elif place == PLACE.SOAP:
590-
# payloads in SOAP should have chars > and < replaced
591-
# with their HTML encoded counterparts
592-
payload = payload.replace('>', "&gt;").replace('<', "&lt;")
593-
value = agent.replacePayload(value, payload)
594-
595594
if place:
596595
value = agent.removePayloadDelimiters(value)
597596

598-
if place == PLACE.COOKIE and conf.cookieUrlencode:
599-
value = urlEncodeCookieValues(value)
600-
601597
if conf.checkPayload:
602598
checkPayload(value)
603599

sqlmap.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ cookie =
4545
# File containing cookies in Netscape/wget format
4646
loadCookies =
4747

48-
# URL-encode generated cookie injections.
49-
# Valid: True or False
50-
cookieUrlencode = False
51-
5248
# Ignore Set-Cookie header from response
5349
# Valid: True or False
5450
dropSetCookie = False

0 commit comments

Comments
 (0)