diff --git a/doc/THANKS b/doc/THANKS index 892c65747..57eb2e380 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -33,6 +33,9 @@ Pierre Chifflier and Mark Hymers Ulises U. Cune for reporting a bug +Alessandro Curio + for reporting a minor bug + Stefano Di Paola for suggesting good features diff --git a/lib/core/option.py b/lib/core/option.py index c38f09148..c7df45e96 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -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 ))