Minor adjustment to get also the port when parsing burp logs

This commit is contained in:
Bernardo Damele 2009-06-04 14:36:31 +00:00
parent 966f34f381
commit cfd8a83655
2 changed files with 10 additions and 4 deletions

View File

@ -33,6 +33,9 @@ Pierre Chifflier <pollux@debian.org> and Mark Hymers <ftpmaster@debian.org>
Ulises U. Cune <ulises2k@gmail.com> Ulises U. Cune <ulises2k@gmail.com>
for reporting a bug for reporting a bug
Alessandro Curio <alessandro.curio@gmail.com>
for reporting a minor bug
Stefano Di Paola <stefano.dipaola@wisec.it> Stefano Di Paola <stefano.dipaola@wisec.it>
for suggesting good features for suggesting good features

View File

@ -96,14 +96,16 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
reqResList = fread.split("======================================================") reqResList = fread.split("======================================================")
port = None
scheme = None scheme = None
for request in reqResList: for request in reqResList:
if scheme is None: 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: if schemePort:
scheme = scheme.group(1) scheme = schemePort.group(1)
port = schemePort.group(2)
if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I): if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I):
continue continue
@ -159,8 +161,9 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
if getPostReq and params: if getPostReq and params:
if not url.startswith("http"): 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 scheme = 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 ))