SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
fix: fix csv export
Amr Awad3d6f12bbb487
diff --git a/sfwebui.py b/sfwebui.pyindex b0f70d8b..65de74fe 100644--- a/sfwebui.py+++ b/sfwebui.py@@ -24,7 +24,7 @@ from mako.template import Templatefrom sfdb import SpiderFootDbfrom sflib import SpiderFoot, globalScanStatusfrom sfscan import SpiderFootScanner-from io import BytesIO+from io import StringIOclass SpiderFootWebUi:@@ -139,7 +139,7 @@ class SpiderFootWebUi:def scaneventresultexport(self, id, type, dialect="excel"):dbh = SpiderFootDb(self.config)data = dbh.scanResultEvent(id, type)- fileobj = BytesIO()+ fileobj = StringIO()parser = csv.writer(fileobj, dialect=dialect)parser.writerow(["Updated", "Type", "Module", "Source", "F/P", "Data"])for row in data:@@ -151,7 +151,7 @@ class SpiderFootWebUi:cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.csv"cherrypy.response.headers['Content-Type'] = "application/csv"cherrypy.response.headers['Pragma'] = "no-cache"- return fileobj.getvalue()+ return fileobj.getvalue().encode("utf-8")scaneventresultexport.exposed = True@@ -164,7 +164,7 @@ class SpiderFootWebUi:scaninfo[id] = dbh.scanInstanceGet(id)data = data + dbh.scanResultEvent(id)- fileobj = BytesIO()+ fileobj = StringIO()parser = csv.writer(fileobj, dialect=dialect)parser.writerow(["Scan Name", "Updated", "Type", "Module", "Source", "F/P", "Data"])for row in data:@@ -177,14 +177,14 @@ class SpiderFootWebUi:cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.csv"cherrypy.response.headers['Content-Type'] = "application/csv"cherrypy.response.headers['Pragma'] = "no-cache"- return fileobj.getvalue()+ return fileobj.getvalue().encode("Utf-8")scaneventresultexportmulti.exposed = True# Get search result data in CSV formatdef scansearchresultexport(self, id, eventType=None, value=None, dialect="excel"):data = self.searchBase(id, eventType, value)- fileobj = BytesIO()+ fileobj = StringIO()parser = csv.writer(fileobj, dialect=dialect)parser.writerow(["Updated", "Type", "Module", "Source", "F/P", "Data"])if not data:@@ -197,7 +197,7 @@ class SpiderFootWebUi:cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.csv"cherrypy.response.headers['Content-Type'] = "application/csv"cherrypy.response.headers['Pragma'] = "no-cache"- return fileobj.getvalue()+ return fileobj.getvalue().encode("Utf-8")scansearchresultexport.exposed = True