mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 04:31:30 +00:00
Cleaning up cases with Set-Cookie (conf.cj is handling it automatically; also, default redirector needed to be patched)
This commit is contained in:
@@ -19,6 +19,7 @@ from lib.core.enums import HTTPHEADER
|
||||
from lib.core.enums import HTTPMETHOD
|
||||
from lib.core.enums import REDIRECTION
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
from lib.core.settings import DEFAULT_COOKIE_DELIMITER
|
||||
from lib.core.settings import MAX_CONNECTION_CHUNK_SIZE
|
||||
from lib.core.settings import MAX_CONNECTION_TOTAL_SIZE
|
||||
from lib.core.settings import MAX_SINGLE_URL_REDIRECTIONS
|
||||
@@ -110,13 +111,12 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||
|
||||
if redurl and kb.redirectChoice == REDIRECTION.YES:
|
||||
req.headers[HTTPHEADER.HOST] = getHostHeader(redurl)
|
||||
if headers and HTTPHEADER.SET_COOKIE in headers:
|
||||
req.headers[HTTPHEADER.COOKIE] = headers[HTTPHEADER.SET_COOKIE].split(DEFAULT_COOKIE_DELIMITER)[0]
|
||||
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
||||
else:
|
||||
result = fp
|
||||
|
||||
if HTTPHEADER.SET_COOKIE in headers:
|
||||
kb.redirectSetCookie = headers.get(HTTPHEADER.SET_COOKIE).split("; path")[0]
|
||||
|
||||
result.redcode = code
|
||||
result.redurl = redurl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user