mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Fixes #5536
This commit is contained in:
parent
e0ec2fcdbd
commit
1740f6332e
|
@ -20,7 +20,7 @@ from thirdparty import six
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.7.9.3"
|
VERSION = "1.7.10.0"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
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)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -641,7 +641,7 @@ class Connect(object):
|
||||||
responseHeaders = conn.info()
|
responseHeaders = conn.info()
|
||||||
responseHeaders[URI_HTTP_HEADER] = conn.geturl() if hasattr(conn, "geturl") else url
|
responseHeaders[URI_HTTP_HEADER] = conn.geturl() if hasattr(conn, "geturl") else url
|
||||||
|
|
||||||
if hasattr(conn, "redurl"):
|
if getattr(conn, "redurl", None) is not None:
|
||||||
responseHeaders[HTTP_HEADER.LOCATION] = conn.redurl
|
responseHeaders[HTTP_HEADER.LOCATION] = conn.redurl
|
||||||
|
|
||||||
responseHeaders = patchHeaders(responseHeaders)
|
responseHeaders = patchHeaders(responseHeaders)
|
||||||
|
|
|
@ -6,6 +6,7 @@ See the file 'LICENSE' for copying permission
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
import types
|
import types
|
||||||
|
|
||||||
|
@ -71,6 +72,7 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
||||||
def http_error_302(self, req, fp, code, msg, headers):
|
def http_error_302(self, req, fp, code, msg, headers):
|
||||||
start = time.time()
|
start = time.time()
|
||||||
content = None
|
content = None
|
||||||
|
forceRedirect = False
|
||||||
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
|
redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -111,12 +113,18 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
|
||||||
redurl = _urllib.parse.urljoin(req.get_full_url(), redurl)
|
redurl = _urllib.parse.urljoin(req.get_full_url(), redurl)
|
||||||
|
|
||||||
self._infinite_loop_check(req)
|
self._infinite_loop_check(req)
|
||||||
self._ask_redirect_choice(code, redurl, req.get_method())
|
if conf.scope:
|
||||||
|
if not re.search(conf.scope, redurl, re.I):
|
||||||
|
redurl = None
|
||||||
|
else:
|
||||||
|
forceRedirect = True
|
||||||
|
else:
|
||||||
|
self._ask_redirect_choice(code, redurl, req.get_method())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
redurl = None
|
redurl = None
|
||||||
result = fp
|
result = fp
|
||||||
|
|
||||||
if redurl and kb.choices.redirect == REDIRECTION.YES:
|
if redurl and (kb.choices.redirect == REDIRECTION.YES or forceRedirect):
|
||||||
parseResponse(content, headers)
|
parseResponse(content, headers)
|
||||||
|
|
||||||
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
req.headers[HTTP_HEADER.HOST] = getHostHeader(redurl)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user