mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-08-04 06:50:14 +00:00
improved redirection mechanism
This commit is contained in:
parent
128a012121
commit
a536bf210f
3 changed files with 19 additions and 23 deletions
|
|
@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
|||
"""
|
||||
|
||||
import urllib2
|
||||
import urlparse
|
||||
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
|
|
@ -52,6 +53,10 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
|||
elif "uri" in headers:
|
||||
result.redurl = headers.getheaders("uri")[0].split("?")[0]
|
||||
|
||||
if hasattr(result, 'redurl'):
|
||||
if result.redurl.startswith('.') or result.redurl.startswith('/'):
|
||||
result.redurl = urlparse.urljoin(conf.url, result.redurl)
|
||||
|
||||
if "set-cookie" in headers:
|
||||
result.setcookie = headers["set-cookie"].split("; path")[0]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue