Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ce3af6

Browse files
committed
fixing support for parsing BURP logs
1 parent 6b7920d commit 7ce3af6

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

doc/THANKS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ Andrea Rossi <[email protected]>
417417
for reporting a minor bug
418418
for suggesting a feature
419419

420+
Mathew Rowley <[email protected]>
421+
for reporting a bug
422+
420423
Frederic Roy <[email protected]>
421424
for reporting a couple of bugs
422425

lib/core/option.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
from lib.core.settings import MAXDB_ALIASES
100100
from lib.core.settings import SYBASE_ALIASES
101101
from lib.core.settings import DB2_ALIASES
102-
from lib.core.settings import BURP_SPLITTER
102+
from lib.core.settings import BURP_REQUEST_REGEX
103103
from lib.core.settings import LOCALHOST
104104
from lib.core.settings import MAX_NUMBER_OF_THREADS
105105
from lib.core.settings import PARAMETER_SPLITTING_REGEX
@@ -211,20 +211,23 @@ def __parseBurpLog(content):
211211
port = None
212212
scheme = None
213213

214-
reqResList = content.split(BURP_SPLITTER)
214+
reqResList = re.findall(BURP_REQUEST_REGEX, content, re.I | re.S)
215+
216+
if not reqResList:
217+
reqResList = [content]
215218

216219
for request in reqResList:
217220
if scheme is None:
218-
schemePort = re.search("\d\d[\:|\.]\d\d[\:|\.]\d\d\s+(http[\w]*)\:\/\/.*?\:([\d]+)", request, re.I)
221+
schemePort = re.search("(http[\w]*)\:\/\/.*?\:([\d]+).+?={10,}", request, re.I | re.S)
219222

220223
if schemePort:
221224
scheme = schemePort.group(1)
222225
port = schemePort.group(2)
223226

224-
if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I):
227+
if not re.search ("^[\n]*(GET|POST).*?\sHTTP\/", request, re.I | re.M):
225228
continue
226229

227-
if re.search("^[\n]*(GET|POST).*?\.(gif|jpg|png)\sHTTP\/", request, re.I):
230+
if re.search("^[\n]*(GET|POST).*?\.(gif|jpg|png)\sHTTP\/", request, re.I | re.M):
228231
continue
229232

230233
getPostReq = False

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
WEBSCARAB_SPLITTER = "### Conversation"
268268

269269
# Splitter used between requests in BURP log files
270-
BURP_SPLITTER = "======================================================"
270+
BURP_REQUEST_REGEX = r"={10,}\s+[^=]+={10,}\s+.+?={10,}"
271271

272272
# Encoding used for Unicode data
273273
UNICODE_ENCODING = "utf8"

0 commit comments

Comments
 (0)