mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 13:14:13 +03:00
Patch for an Issue #347
This commit is contained in:
parent
a38b3e397c
commit
f7eda07d92
|
@ -86,6 +86,7 @@ from lib.core.settings import DEFAULT_GET_POST_DELIMITER
|
||||||
from lib.core.settings import DEFAULT_MSSQL_SCHEMA
|
from lib.core.settings import DEFAULT_MSSQL_SCHEMA
|
||||||
from lib.core.settings import DEPRECATED_OPTIONS
|
from lib.core.settings import DEPRECATED_OPTIONS
|
||||||
from lib.core.settings import DESCRIPTION
|
from lib.core.settings import DESCRIPTION
|
||||||
|
from lib.core.settings import DOLLAR_MARKER
|
||||||
from lib.core.settings import DUMMY_SQL_INJECTION_CHARS
|
from lib.core.settings import DUMMY_SQL_INJECTION_CHARS
|
||||||
from lib.core.settings import DUMMY_USER_INJECTION
|
from lib.core.settings import DUMMY_USER_INJECTION
|
||||||
from lib.core.settings import DYNAMICITY_MARK_LENGTH
|
from lib.core.settings import DYNAMICITY_MARK_LENGTH
|
||||||
|
@ -2041,6 +2042,10 @@ def urlencode(value, safe="%&=", convall=False, limit=False):
|
||||||
if all(map(lambda x: '%' in x, [safe, value])) and not kb.tamperFunctions:
|
if all(map(lambda x: '%' in x, [safe, value])) and not kb.tamperFunctions:
|
||||||
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value)
|
value = re.sub("%(?![0-9a-fA-F]{2})", "%25", value)
|
||||||
|
|
||||||
|
if '$' in value and '$' not in safe:
|
||||||
|
for match in re.finditer(r"\b([\w$]*\$[\w$]*)=", value):
|
||||||
|
value = value.replace(match.group(1), match.group(1).replace('$', DOLLAR_MARKER))
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
result = urllib.quote(utf8encode(value), safe)
|
result = urllib.quote(utf8encode(value), safe)
|
||||||
|
|
||||||
|
@ -2056,6 +2061,9 @@ def urlencode(value, safe="%&=", convall=False, limit=False):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if result:
|
||||||
|
result = result.replace(DOLLAR_MARKER, '$')
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def runningAsAdmin():
|
def runningAsAdmin():
|
||||||
|
|
|
@ -37,6 +37,7 @@ UPPER_RATIO_BOUND = 0.98
|
||||||
PARAMETER_AMP_MARKER = "__AMP__"
|
PARAMETER_AMP_MARKER = "__AMP__"
|
||||||
PARAMETER_SEMICOLON_MARKER = "__SEMICOLON__"
|
PARAMETER_SEMICOLON_MARKER = "__SEMICOLON__"
|
||||||
PARTIAL_VALUE_MARKER = "__PARTIAL__"
|
PARTIAL_VALUE_MARKER = "__PARTIAL__"
|
||||||
|
DOLLAR_MARKER = "__DOLLAR_MARK__"
|
||||||
URI_QUESTION_MARKER = "__QUESTION_MARK__"
|
URI_QUESTION_MARKER = "__QUESTION_MARK__"
|
||||||
ASTERISK_MARKER = "__ASTERISK_MARK__"
|
ASTERISK_MARKER = "__ASTERISK_MARK__"
|
||||||
|
|
||||||
|
|
|
@ -620,8 +620,8 @@ class Connect(object):
|
||||||
payload = json.dumps(payload)[1:-1]
|
payload = json.dumps(payload)[1:-1]
|
||||||
value = agent.replacePayload(value, payload)
|
value = agent.replacePayload(value, payload)
|
||||||
else:
|
else:
|
||||||
if not skipUrlEncode and place in (PLACE.GET, PLACE.COOKIE, PLACE.URI):
|
if not skipUrlEncode and place in (PLACE.GET, PLACE.POST, PLACE.COOKIE, PLACE.URI):
|
||||||
# GET, URI and Cookie need to be throughly URL encoded (POST is encoded down below)
|
# GET, POST, URI and Cookie payload needs to be throughly URL encoded
|
||||||
payload = urlencode(payload, '%', False, place != PLACE.URI)
|
payload = urlencode(payload, '%', False, place != PLACE.URI)
|
||||||
value = agent.replacePayload(value, payload)
|
value = agent.replacePayload(value, payload)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user