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

Skip to content

Commit b8f88a0

Browse files
committed
Fixes #2659
1 parent a761e1d commit b8f88a0

3 files changed

Lines changed: 11 additions & 7 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.8.6"
22+
VERSION = "1.1.8.7"
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: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,12 +934,14 @@ def _adjustParameter(paramString, parameter, newValue):
934934
return retVal
935935

936936
page, headers, code = Connect.getPage(url=conf.csrfUrl or conf.url, data=conf.data if conf.csrfUrl == conf.url else None, method=conf.method if conf.csrfUrl == conf.url else None, cookie=conf.parameters.get(PLACE.COOKIE), direct=True, silent=True, ua=conf.parameters.get(PLACE.USER_AGENT), referer=conf.parameters.get(PLACE.REFERER), host=conf.parameters.get(PLACE.HOST))
937-
match = re.search(r"<input[^>]+name=[\"']?%s[\"']?\s[^>]*value=(\"([^\"]+)|'([^']+)|([^ >]+))" % re.escape(conf.csrfToken), page or "")
938-
token = (match.group(2) or match.group(3) or match.group(4)) if match else None
937+
token = extractRegexResult(r"(?i)<input[^>]+\bname=[\"']?%s[\"']?[^>]*\bvalue=(?P<result>(\"([^\"]+)|'([^']+)|([^ >]+)))" % re.escape(conf.csrfToken), page or "")
939938

940939
if not token:
941-
match = re.search(r"%s[\"']:[\"']([^\"']+)" % re.escape(conf.csrfToken), page or "")
942-
token = match.group(1) if match else None
940+
token = extractRegexResult(r"(?i)<input[^>]+\bvalue=(?P<result>(\"([^\"]+)|'([^']+)|([^ >]+)))[^>]+\bname=[\"']?%s[\"']?" % re.escape(conf.csrfToken), page or "")
941+
942+
if not token:
943+
match = re.search(r"%s[\"']:[\"']([^\"']+)" % re.escape(conf.csrfToken), page or "")
944+
token = match.group(1) if match else None
943945

944946
if not token:
945947
if conf.csrfUrl != conf.url and code == httplib.OK:
@@ -967,6 +969,8 @@ def _adjustParameter(paramString, parameter, newValue):
967969
raise SqlmapTokenException, errMsg
968970

969971
if token:
972+
token = token.strip("'\"")
973+
970974
for place in (PLACE.GET, PLACE.POST):
971975
if place in conf.parameters:
972976
if place == PLACE.GET and get:

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ a44d7a4cc6c9a67a72d6af2f25f4ddac lib/core/exception.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
7fba5bfabbc94b29a9998869faca440f lib/core/settings.py
49+
9bcb7d67515332060766ce65d17cb88d lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
4a6ecdd8a6e44bb4737bd9bc7f9b5743 lib/core/target.py
@@ -68,7 +68,7 @@ ad74fc58fc7214802fd27067bce18dd2 lib/core/unescaper.py
6868
403d873f1d2fd0c7f73d83f104e41850 lib/request/basicauthhandler.py
6969
a06eddbdb529d4253c57250decb8e960 lib/request/basic.py
7070
ef48de622b0a6b4a71df64b0d2785ef8 lib/request/comparison.py
71-
38515a786ff9839436a864fb33dbc27b lib/request/connect.py
71+
e9aa99ead32887dcfe935044c15aa9bc lib/request/connect.py
7272
fb6b788d0016ab4ec5e5f661f0f702ad lib/request/direct.py
7373
cc1163d38e9b7ee5db2adac6784c02bb lib/request/dns.py
7474
5dcdb37823a0b5eff65cd1018bcf09e4 lib/request/httpshandler.py

0 commit comments

Comments
 (0)