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

Skip to content

Commit ec83837

Browse files
committed
Fixes #2786
1 parent 2333903 commit ec83837

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.11.23"
22+
VERSION = "1.1.11.24"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
796796
raise404 = place != PLACE.URI if raise404 is None else raise404
797797
method = method or conf.method
798798

799-
pushValue(kb.postUrlEncode)
799+
postUrlEncode = kb.postUrlEncode
800800

801801
value = agent.adjustLateValues(value)
802802
payload = agent.extractPayload(value)
@@ -806,8 +806,8 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
806806
headers = OrderedDict(conf.httpHeaders)
807807
contentType = max(headers[_] if _.upper() == HTTP_HEADER.CONTENT_TYPE.upper() else None for _ in headers.keys())
808808

809-
if (kb.postHint or conf.skipUrlEncode) and kb.postUrlEncode:
810-
kb.postUrlEncode = False
809+
if (kb.postHint or conf.skipUrlEncode) and postUrlEncode:
810+
postUrlEncode = False
811811
conf.httpHeaders = [_ for _ in conf.httpHeaders if _[1] != contentType]
812812
contentType = POST_HINT_CONTENT_TYPES.get(kb.postHint, PLAIN_TEXT_CONTENT_TYPE)
813813
conf.httpHeaders.append((HTTP_HEADER.CONTENT_TYPE, contentType))
@@ -851,7 +851,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
851851
value = agent.replacePayload(value, payload)
852852
else:
853853
# GET, POST, URI and Cookie payload needs to be thoroughly URL encoded
854-
if (place in (PLACE.GET, PLACE.URI, PLACE.COOKIE) or place == PLACE.CUSTOM_HEADER and value.split(',')[0] == HTTP_HEADER.COOKIE) and not conf.skipUrlEncode or place in (PLACE.POST, PLACE.CUSTOM_POST) and kb.postUrlEncode:
854+
if (place in (PLACE.GET, PLACE.URI, PLACE.COOKIE) or place == PLACE.CUSTOM_HEADER and value.split(',')[0] == HTTP_HEADER.COOKIE) and not conf.skipUrlEncode or place in (PLACE.POST, PLACE.CUSTOM_POST) and postUrlEncode:
855855
skip = False
856856

857857
if place == PLACE.COOKIE or place == PLACE.CUSTOM_HEADER and value.split(',')[0] == HTTP_HEADER.COOKIE:
@@ -864,7 +864,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
864864
if not skip:
865865
payload = urlencode(payload, '%', False, place != PLACE.URI) # spaceplus is handled down below
866866
value = agent.replacePayload(value, payload)
867-
kb.postUrlEncode = False
867+
postUrlEncode = False
868868

869869
if conf.hpp:
870870
if not any(conf.url.lower().endswith(_.lower()) for _ in (WEB_API.ASP, WEB_API.ASPX)):
@@ -1151,7 +1151,7 @@ def _randomizeParameter(paramString, randomParameter):
11511151
if post is not None:
11521152
if place not in (PLACE.POST, PLACE.CUSTOM_POST) and hasattr(post, UNENCODED_ORIGINAL_VALUE):
11531153
post = getattr(post, UNENCODED_ORIGINAL_VALUE)
1154-
elif kb.postUrlEncode:
1154+
elif postUrlEncode:
11551155
post = urlencode(post, spaceplus=kb.postSpaceToPlus)
11561156

11571157
if timeBasedCompare and not conf.disableStats:
@@ -1248,8 +1248,6 @@ def _randomizeParameter(paramString, randomParameter):
12481248

12491249
kb.originalCode = kb.originalCode or code
12501250

1251-
kb.postUrlEncode = popValue()
1252-
12531251
if kb.testMode:
12541252
kb.testQueryCount += 1
12551253

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ e1c000db9be27f973569b1a430629037 lib/core/option.py
4646
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
4848
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49-
71ad4ba8829df91c6250b0f70116c7cd lib/core/settings.py
49+
260554b4e0f00d84cb68da079c04d4b4 lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
d5a04d672a18f78deb2839c3745ff83c lib/core/target.py
@@ -68,7 +68,7 @@ d8d9bcf9e7107a5e2cf2dd10f115ac28 lib/parse/payloads.py
6868
d2f13a0e2fef5273d419d06e516122e1 lib/request/basicauthhandler.py
6969
9ef264b5c0f9e7989b8c2ab91d40400d lib/request/basic.py
7070
28348595147a731677c8bef470c6f57a lib/request/comparison.py
71-
4015dee29a0d2bfc7820e828bfe96b91 lib/request/connect.py
71+
28aa66ecdd5c03513829cb73a47658e4 lib/request/connect.py
7272
ad6f76839408d827abfcdc57813f8518 lib/request/direct.py
7373
4853bd0d523646315607a6a9a4c0b745 lib/request/dns.py
7474
effa0c3e4efceaf4932855e8e6677bf7 lib/request/httpshandler.py

0 commit comments

Comments
 (0)