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

Skip to content

Commit f82c049

Browse files
committed
Fixes #2447
1 parent 7157638 commit f82c049

3 files changed

Lines changed: 10 additions & 4 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.3.12"
22+
VERSION = "1.1.3.13"
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/redirecthandler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'doc/COPYING' for copying permission
66
"""
77

8+
import re
89
import types
910
import urllib2
1011
import urlparse
@@ -123,7 +124,12 @@ def http_error_302(self, req, fp, code, msg, headers):
123124

124125
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
125126
if headers and HTTP_HEADER.SET_COOKIE in headers:
126-
req.headers[HTTP_HEADER.COOKIE] = headers[HTTP_HEADER.SET_COOKIE].split(conf.cookieDel or DEFAULT_COOKIE_DELIMITER)[0]
127+
delimiter = conf.cookieDel or DEFAULT_COOKIE_DELIMITER
128+
_ = headers[HTTP_HEADER.SET_COOKIE].split(delimiter)[0]
129+
if HTTP_HEADER.COOKIE not in req.headers:
130+
req.headers[HTTP_HEADER.COOKIE] = _
131+
else:
132+
req.headers[HTTP_HEADER.COOKIE] = re.sub("%s{2,}" % delimiter, delimiter, ("%s%s%s" % (re.sub(r"\b%s=[^%s]*%s?" % (_.split('=')[0], delimiter, delimiter), "", req.headers[HTTP_HEADER.COOKIE]), delimiter, _)).strip(delimiter))
127133
try:
128134
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
129135
except urllib2.HTTPError, e:

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py
4545
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4646
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4747
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
48-
dd0604da8e23963396dbecfddb597016 lib/core/settings.py
48+
ba6399c8321f618d237051e1e7110aeb lib/core/settings.py
4949
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5050
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5151
afd0636d2e93c23f4f0a5c9b6023ea17 lib/core/target.py
@@ -76,7 +76,7 @@ e68e1f00c7bb47b2c4ea6201995c56fb lib/request/inject.py
7676
dc1e0af84ee8eb421797d61c8cb8f172 lib/request/methodrequest.py
7777
bb9c165b050f7696b089b96b5947fac3 lib/request/pkihandler.py
7878
602d4338a9fceaaee40c601410d8ac0b lib/request/rangehandler.py
79-
e687a727b641211dfae7346b671059c5 lib/request/redirecthandler.py
79+
b581e0c5e27cd927883f2c7f1705bf4e lib/request/redirecthandler.py
8080
20a0e6dac2edcf98fa8c47ee9a332c28 lib/request/templates.py
8181
36518b36ae0cf199490457916a85b367 lib/takeover/abstraction.py
8282
c6bc7961a186baabe0a9f5b7e0d8974b lib/takeover/icmpsh.py

0 commit comments

Comments
 (0)