mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-20 07:00:25 +00:00
Fixes #6185
This commit is contained in:
parent
8b78b676c1
commit
5db2e62884
3 changed files with 29 additions and 1 deletions
|
|
@ -19,7 +19,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.11.88"
|
||||
VERSION = "1.10.11.89"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import re
|
|||
import time
|
||||
import types
|
||||
|
||||
from lib.core.common import checkSameHost
|
||||
from lib.core.common import getHostHeader
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.common import logHTTPTraffic
|
||||
|
|
@ -180,6 +181,10 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
|||
if conf.authRefresh and not authrefresh.sameOrigin(req.get_full_url(), redurl):
|
||||
req.headers = authrefresh.stripHeaders(req.headers)
|
||||
req.unredirected_hdrs = authrefresh.stripHeaders(req.unredirected_hdrs)
|
||||
|
||||
# Note: credentials are not to be forwarded to a different host (like browsers, curl and requests do) (#6185)
|
||||
if not checkSameHost(req.get_full_url(), redurl):
|
||||
req.headers = dict((key, value) for key, value in req.headers.items() if key.upper() not in (HTTP_HEADER.COOKIE.upper(), HTTP_HEADER.AUTHORIZATION.upper()))
|
||||
result = _urllib.request.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
||||
except _urllib.error.HTTPError as ex:
|
||||
result = error = ex
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue