Burp Suite User Forum

VirusTotal Extention

yeffel | Last updated: Jul 06, 2015 10:45AM UTC

Greetings- I've been writing an extension that will take a URL that is intercepted by burp and submit it to VirusTotal for analysis. Here is a snippet: def changeSelection(self, row, col, toggle, extend): # show the log entry for the selected row logEntry = self._extender._log.get(row) myVT = virusTotalAnalysis(logEntry._requestResponse.getUrl()) self._extender._requestViewer.setMessage(logEntry._requestResponse.getRequest(), True) self._extender._responseViewer.setMessage(logEntry._requestResponse.getResponse(), False) ######this populates the virtustotal tab with a reseponse from the function myVT.setURL() self._extender._VirusTotalViewer.setMessage(myVT.setURL(), True) self._extender._currentlyDisplayedItem = logEntry._requestResponse JTable.changeSelection(self, row, col, toggle, extend) return # # class to hold details of each log entry # class virusTotalAnalysis(): def __init__(self, url): self.url = url return def setURL(self): fileType = ['jpg', 'png', 'css'] myVTAPI = "YOU NEED A VT API KEY" print "Get URL =>" + self.url.getHost() + self.url.toString() if re.search('(.+jpg)|(.+png)(.+css)|(.+js)', self.url.toString()): print "Dont Check this File" return "Link Not Analyzed =>" + self.url.toString() else: print "Check this file" vtURL = "https://www.virustotal.com/vtapi/v2/url/scan" parameters = {"url": self.url.toString(), "apikey": myVTAPI} data = urllib.urlencode(parameters) print "Try VT SCAN" try: req = urllib2.Request(vtURL, data) response = urllib2.urlopen(req) json = response.read() debugjson = json.loads(json) #This is where all errors are being thrown. I want to analyze the JSON response and make another URL call and return the report's contents return json except: print "EXCEPTION!" print sys.exc_info()[0] https://gist.githubusercontent.com/yeffel/2eb9bec5af5cdbdd7a38/raw/56da780a1033f79ecf3ff7950e8c5b451fa8feea/virbpe.py

You need to Log in to post a reply. Or register here, for free.