packetfocus / BurpParser

Parser to convert BURP Pro .XML to .CSV and build a Word .Docx Template
13 stars 4 forks source link

Missing Issue Background XML tag stops script #18

Open stansteenhuis opened 4 years ago

stansteenhuis commented 4 years ago

Some of the Burp extensions do not generate verbiage. When the tag is missing, execution stops.
Traceback (most recent call last): File "BurpXMLParser.py", line 518, in main() File "BurpXMLParser.py", line 495, in main process(xmlFileIn) File "BurpXMLParser.py", line 217, in process issueBackground = i.find('issuebackground').text AttributeError: 'NoneType' object has no attribute 'text'

Caprico1 commented 2 years ago

line 217 on adding a try block seems to have worked.

         try:
            issueBackground = i.find('issuebackground').text
            issueBackground = str(issueBackground)

            # have to replace commas before making csv. Replaced with | for now.
            issueBackground = strip_tags(issueBackground)
            # this was a fix for the CSV outfile. Need to rethink the order of this.
            issueBackground = issueBackground.replace(',', "|")
        except:
            pass