From 10b0fd21dc5829b15f3b95486af9be0c98399913 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 9 Oct 2012 11:27:19 +0200 Subject: [PATCH] Fix for an Issue #198 --- lib/core/option.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index e4992f561..88243f76b 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -217,20 +217,22 @@ def __feedTargetsDict(reqFile, addedTargetUrls): """ Parses burp logs """ - port = None - scheme = None - reqResList = re.findall(BURP_REQUEST_REGEX, content, re.I | re.S) - if not reqResList: + if not re.search(BURP_REQUEST_REGEX, content, re.I | re.S): reqResList = [content] + else: + reqResList = re.finditer(BURP_REQUEST_REGEX, content, re.I | re.S) - for request in reqResList: - if scheme is None: - schemePort = re.search(r"(http[\w]*)\:\/\/.*?\:([\d]+).+?={10,}", request, re.I | re.S) + for match in reqResList: + request = match if isinstance(match, basestring) else match.group(0) - if schemePort: - scheme = schemePort.group(1) - port = schemePort.group(2) + schemePort = re.search(r"(http[\w]*)\:\/\/.*?\:([\d]+).+?={10,}", request, re.I | re.S) + + if schemePort: + scheme = schemePort.group(1) + port = schemePort.group(2) + else: + scheme, port = None, None if not re.search (r"^[\n]*(GET|POST).*?\sHTTP\/", request, re.I | re.M): continue