mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 09:36:35 +03:00
Minor adjustment to get also the port when parsing burp logs
This commit is contained in:
parent
966f34f381
commit
cfd8a83655
|
@ -33,6 +33,9 @@ Pierre Chifflier <pollux@debian.org> and Mark Hymers <ftpmaster@debian.org>
|
|||
Ulises U. Cune <ulises2k@gmail.com>
|
||||
for reporting a bug
|
||||
|
||||
Alessandro Curio <alessandro.curio@gmail.com>
|
||||
for reporting a minor bug
|
||||
|
||||
Stefano Di Paola <stefano.dipaola@wisec.it>
|
||||
for suggesting good features
|
||||
|
||||
|
|
|
@ -96,14 +96,16 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
|||
|
||||
reqResList = fread.split("======================================================")
|
||||
|
||||
port = None
|
||||
scheme = None
|
||||
|
||||
for request in reqResList:
|
||||
if scheme is None:
|
||||
scheme = re.search("\d\d[\:|\.]\d\d[\:|\.]\d\d\s+(http[\w]*)\:", request, re.I)
|
||||
schemePort = re.search("\d\d[\:|\.]\d\d[\:|\.]\d\d\s+(http[\w]*)\:([\d]+)", request, re.I)
|
||||
|
||||
if scheme:
|
||||
scheme = scheme.group(1)
|
||||
if schemePort:
|
||||
scheme = schemePort.group(1)
|
||||
port = schemePort.group(2)
|
||||
|
||||
if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I):
|
||||
continue
|
||||
|
@ -159,8 +161,9 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
|
|||
|
||||
if getPostReq and params:
|
||||
if not url.startswith("http"):
|
||||
url = "%s://%s%s" % (scheme or "http", host, url)
|
||||
url = "%s://%s:%s%s" % (scheme or "http", host, port or "80", url)
|
||||
scheme = None
|
||||
port = None
|
||||
|
||||
if not kb.targetUrls or url not in addedTargetUrls:
|
||||
kb.targetUrls.add(( url, method, data, cookie ))
|
||||
|
|
Loading…
Reference in New Issue
Block a user