From c7b72abc0ea212764aa6cc0291d97bd856a3a31e Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 3 Jun 2009 15:04:40 +0000 Subject: [PATCH] Minor bug fix in parsing Burp (WebScarab too?) log to correctly parse httpS urls --- lib/core/option.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index f60423638..14716ea6e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -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 ))