mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-23 01:56:36 +03:00
fix for Bug #202
This commit is contained in:
parent
683184cc8f
commit
aaebb4336e
|
@ -1031,6 +1031,7 @@ def __setKnowledgeBaseAttributes():
|
||||||
|
|
||||||
kb.absFilePaths = set()
|
kb.absFilePaths = set()
|
||||||
kb.assumeEmpty = False
|
kb.assumeEmpty = False
|
||||||
|
kb.authHeader = None
|
||||||
kb.bannerFp = advancedDict()
|
kb.bannerFp = advancedDict()
|
||||||
|
|
||||||
kb.cache = advancedDict()
|
kb.cache = advancedDict()
|
||||||
|
|
|
@ -286,6 +286,7 @@ def initTargetEnv():
|
||||||
conf.parameters = {}
|
conf.parameters = {}
|
||||||
conf.sessionFile = None
|
conf.sessionFile = None
|
||||||
|
|
||||||
|
kb.authHeader = None
|
||||||
kb.dbms = None
|
kb.dbms = None
|
||||||
kb.dbmsDetected = False
|
kb.dbmsDetected = False
|
||||||
kb.dbmsVersion = [ "Unknown" ]
|
kb.dbmsVersion = [ "Unknown" ]
|
||||||
|
|
|
@ -121,6 +121,9 @@ class Connect:
|
||||||
|
|
||||||
headers["Referer"] = "%s://%s" % (conf.scheme, conf.hostname)
|
headers["Referer"] = "%s://%s" % (conf.scheme, conf.hostname)
|
||||||
|
|
||||||
|
if kb.authHeader:
|
||||||
|
headers["Authorization"] = kb.authHeader
|
||||||
|
|
||||||
if auxHeaders:
|
if auxHeaders:
|
||||||
for key, item in auxHeaders.items():
|
for key, item in auxHeaders.items():
|
||||||
headers[key] = item
|
headers[key] = item
|
||||||
|
@ -163,6 +166,9 @@ class Connect:
|
||||||
|
|
||||||
conn = urllib2.urlopen(req)
|
conn = urllib2.urlopen(req)
|
||||||
|
|
||||||
|
if req.has_header("Authorization"):
|
||||||
|
kb.authHeader = req.headers["Authorization"]
|
||||||
|
|
||||||
if hasattr(conn, "redurl") and hasattr(conn, "redcode") and not conf.redirectHandled:
|
if hasattr(conn, "redurl") and hasattr(conn, "redcode") and not conf.redirectHandled:
|
||||||
msg = "sqlmap got a %d redirect to " % conn.redcode
|
msg = "sqlmap got a %d redirect to " % conn.redcode
|
||||||
msg += "%s - What target address do you " % conn.redurl
|
msg += "%s - What target address do you " % conn.redurl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user