mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-09 02:03:46 +03:00
Major bug fix to parse and store all HTTP headers from the request file (-r)
This commit is contained in:
parent
7cad3cbda6
commit
ea45d75f2d
|
@ -159,9 +159,12 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
||||||
|
|
||||||
getPostReq = True
|
getPostReq = True
|
||||||
|
|
||||||
|
# POST parameters
|
||||||
|
elif data is not None and params:
|
||||||
|
data += line
|
||||||
|
|
||||||
# GET parameters
|
# GET parameters
|
||||||
elif "?" in line and "=" in line and ": " not in line:
|
elif "?" in line and "=" in line and ": " not in line:
|
||||||
data = line
|
|
||||||
params = True
|
params = True
|
||||||
|
|
||||||
# Cookie and Host headers
|
# Cookie and Host headers
|
||||||
|
@ -173,11 +176,13 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
||||||
elif key.lower() == "host":
|
elif key.lower() == "host":
|
||||||
host = value
|
host = value
|
||||||
|
|
||||||
# POST parameters
|
if key == "Content-Length":
|
||||||
elif method is not None and method == "POST" and "=" in line:
|
data = ""
|
||||||
data = line
|
|
||||||
params = True
|
params = True
|
||||||
|
|
||||||
|
elif key not in ( "Proxy-Connection", "Connection" ):
|
||||||
|
conf.httpHeaders.append((str(key), str(value)))
|
||||||
|
|
||||||
if conf.scope:
|
if conf.scope:
|
||||||
getPostReq &= re.search(conf.scope, host) is not None
|
getPostReq &= re.search(conf.scope, host) is not None
|
||||||
|
|
||||||
|
@ -188,7 +193,7 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
||||||
port = None
|
port = None
|
||||||
|
|
||||||
if not kb.targetUrls or url not in addedTargetUrls:
|
if not kb.targetUrls or url not in addedTargetUrls:
|
||||||
kb.targetUrls.add(( url, method, data, cookie ))
|
kb.targetUrls.add((url, method, data, cookie))
|
||||||
addedTargetUrls.add(url)
|
addedTargetUrls.add(url)
|
||||||
|
|
||||||
def __setMultipleTargets():
|
def __setMultipleTargets():
|
||||||
|
@ -714,7 +719,7 @@ def __setHTTPExtraHeaders():
|
||||||
|
|
||||||
if header and value:
|
if header and value:
|
||||||
conf.httpHeaders.append((header, value))
|
conf.httpHeaders.append((header, value))
|
||||||
else:
|
elif not conf.httpHeaders:
|
||||||
conf.httpHeaders.append(("Accept", "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"))
|
conf.httpHeaders.append(("Accept", "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"))
|
||||||
conf.httpHeaders.append(("Accept-Language", "en-us,en;q=0.5"))
|
conf.httpHeaders.append(("Accept-Language", "en-us,en;q=0.5"))
|
||||||
conf.httpHeaders.append(("Accept-Charset", "ISO-8859-15,utf-8;q=0.7,*;q=0.7"))
|
conf.httpHeaders.append(("Accept-Charset", "ISO-8859-15,utf-8;q=0.7,*;q=0.7"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user