Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Ability to export all records.

smicalleff76658e6cee3
diff --git a/sfdb.py b/sfdb.py
index fe316d0e..ebc1095d 100644
--- a/sfdb.py
+++ b/sfdb.py
@@ -136,11 +136,15 @@ class SpiderFootDb:
e.args[0])
# Obtain the data for a scan and event type
- def scanResultEvent(self, instanceId, eventType):
+ def scanResultEvent(self, instanceId, eventType='ALL'):
qry = "SELECT ROUND(generated/1000) AS generated, event_data, event_source, \
- event_data_source FROM tbl_scan_results WHERE scan_instance_id = ? AND \
- event = ?"
- qvars = [instanceId, eventType]
+ event_data_source FROM tbl_scan_results WHERE scan_instance_id = ?"
+ qvars = [instanceId]
+
+ if eventType != "ALL":
+ qry = qry + " AND event = ?"
+ qvars.append(eventType)
+
try:
self.dbh.execute(qry, qvars)
return self.dbh.fetchall()
diff --git a/sfwebui.py b/sfwebui.py
index 558411a1..9d411163 100644
--- a/sfwebui.py
+++ b/sfwebui.py
@@ -176,11 +176,12 @@ class SpiderFootWebUi:
def scaneventresultexport(self, id, type):
dbh = SpiderFootDb(self.config)
data = dbh.scanResultEvent(id, type)
- blob = "\"Updated\",\"Source\",\"Module\",\"Data\"\n"
+ blob = "\"Updated\",\"Type\",\"Source\",\"Module\",\"Data\"\n"
for row in data:
lastseen = time.strftime("%d/%m/%Y %H:%M:%S", time.localtime(row[0]))
- escaped = cgi.escape(row[1].replace("\n", "<LB>").replace("\r", "<LB>"))
- blob = blob + "\"" + lastseen + "\",\"" + row[2] + "\",\"" + row[3]
+ escaped = cgi.escape(row[1].replace("\n", "#LB#").replace("\r", "#LB#"))
+ blob = blob + "\"" + lastseen + "\",\"" + row[4] + "\",\""
+ blob = blob + row[2] + "\",\"" + row[3]
blob = blob + "\",\"" + escaped + "\"\n"
cherrypy.response.headers['Content-Disposition'] = "attachment; filename=SpiderFoot.csv"
cherrypy.response.headers['Content-Type'] = "application/csv"