Minor bug fix in parsing Burp (WebScarab too?) log to correctly parse httpS urls

This commit is contained in:
Bernardo Damele 2009-06-03 15:04:40 +00:00
parent 02f6425db8
commit c7b72abc0e

View File

@ -96,7 +96,15 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
reqResList = fread.split("======================================================")
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)
if scheme:
scheme = scheme.group(1)
if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I):
continue
@ -151,7 +159,8 @@ def __feedTargetsDict(reqFile, addedTargetUrls):
if getPostReq and params:
if not url.startswith("http"):
url = "http://%s%s" % (host, url)
url = "%s://%s%s" % (scheme or "http", host, url)
scheme = None
if not kb.targetUrls or url not in addedTargetUrls:
kb.targetUrls.add(( url, method, data, cookie ))