SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Bug fixes, typos, etc.
Steve5837a507954c
diff --git a/modules/sfp_alienvault.py b/modules/sfp_alienvault.pyindex fc519f7f..db74f1ef 100644--- a/modules/sfp_alienvault.py+++ b/modules/sfp_alienvault.py@@ -145,17 +145,19 @@ class sfp_alienvault(SpiderFootPlugin):res = ret["passive_dns"]for rec in res:if "hostname" in rec:- last = rec.get("last", "")- last_dt = datetime.strptime(last, '%Y-%m-%d %H:%M:%S')- last_ts = int(time.mktime(last_dt.timetuple()))- age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])host = rec['hostname']- if self.opts['age_limit_days'] > 0 and last_ts < age_limit_ts:- self.sf.debug("Record found but too old, skipping.")- continue- else:- e = SpiderFootEvent(evtType, host, self.__name__, event)- self.notifyListeners(e)+ try:+ last = rec.get("last", "")+ last_dt = datetime.strptime(last, '%Y-%m-%d %H:%M:%S')+ last_ts = int(time.mktime(last_dt.timetuple()))+ age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])+ if self.opts['age_limit_days'] > 0 and last_ts < age_limit_ts:+ self.sf.debug("Record found but too old, skipping.")+ continue+ except BaseException as e:+ self.sf.debug("Couldn't parse date from AlienVault so assuming it's OK.")+ e = SpiderFootEvent(evtType, host, self.__name__, event)+ self.notifyListeners(e)for addr in qrylist:if self.checkForStop():@@ -185,14 +187,15 @@ class sfp_alienvault(SpiderFootPlugin):descr += "\n - " + result.get("name", "")created = result.get("last_date", "")# 2014-11-06T10:45:00.000- created_dt = datetime.strptime(created, '%Y-%m-%dT%H:%M:%S')- created_ts = int(time.mktime(created_dt.timetuple()))- age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])- if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:- self.sf.debug("Record found but too old, skipping.")- continue- cats_description = ""-+ try:+ created_dt = datetime.strptime(created, '%Y-%m-%dT%H:%M:%S')+ created_ts = int(time.mktime(created_dt.timetuple()))+ age_limit_ts = int(time.time()) - (86400 * self.opts['age_limit_days'])+ if self.opts['age_limit_days'] > 0 and created_ts < age_limit_ts:+ self.sf.debug("Record found but too old, skipping.")+ continue+ except BaseException as e:+ self.sf.debug("Couldn't parse date from AlienVault so assuming it's OK.")e = SpiderFootEvent(evtType, descr, self.__name__, event)self.notifyListeners(e)diff --git a/modules/sfp_blacklist.py b/modules/sfp_blacklist.pyindex 1a6427e1..399e94c1 100644--- a/modules/sfp_blacklist.py+++ b/modules/sfp_blacklist.py@@ -18,7 +18,7 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventclass sfp_blacklist(SpiderFootPlugin):- """Blacklist:Investigate,Passive:Blacklists::Query various blacklist database for open relays, open proxies, vulnerable servers, etc."""+ """Blacklist:Investigate,Passive:Blacklists::Query various blacklist databases for open relays, open proxies, vulnerable servers, etc."""# Default optionsopts = {diff --git a/modules/sfp_censys.py b/modules/sfp_censys.pyindex 722718ae..8196fdee 100644--- a/modules/sfp_censys.py+++ b/modules/sfp_censys.py@@ -164,6 +164,8 @@ class sfp_censys(SpiderFootPlugin):if 'protocols' in rec:for p in rec['protocols']:+ if 'ip' not in rec:+ continuedat = rec['ip'] + ":" + p.split("/")[0]e = SpiderFootEvent("TCP_PORT_OPEN", dat, self.__name__, event)self.notifyListeners(e)diff --git a/modules/sfp_defaced.py b/modules/sfp_defaced.pyindex 4989cc41..58ebc614 100644--- a/modules/sfp_defaced.py+++ b/modules/sfp_defaced.py@@ -17,7 +17,7 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventclass sfp_defaced(SpiderFootPlugin):- """Defacement Check:Investigate,Passive:Search Engines::Check if a hostname/domain appears on the zone-h.org 'special defacements' RSS feed/"""+ """Defacement Check:Investigate,Passive:Search Engines::Check if a hostname/domain appears on the zone-h.org 'special defacements' RSS feed."""# Default optionsopts = {diff --git a/modules/sfp_junkfiles.py b/modules/sfp_junkfiles.pyindex 7bd42064..2a2123c4 100644--- a/modules/sfp_junkfiles.py+++ b/modules/sfp_junkfiles.py@@ -113,7 +113,7 @@ class sfp_junkfiles(SpiderFootPlugin):if res['realurl'] != fetch:self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)continue- if res['code'] != "200":+ if res['code'] == "200":evt = SpiderFootEvent("JUNK_FILE", fetch,self.__name__, event)self.notifyListeners(evt)@@ -151,7 +151,7 @@ class sfp_junkfiles(SpiderFootPlugin):if res['realurl'] != fetch:self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)continue- if res['code'] != "200":+ if res['code'] == "200":evt = SpiderFootEvent("JUNK_FILE", fetch,self.__name__, event)self.notifyListeners(evt)@@ -174,7 +174,7 @@ class sfp_junkfiles(SpiderFootPlugin):if res['realurl'] != fetch:self.sf.debug("Skipping because " + res['realurl'] + " isn't the fetched URL of " + fetch)continue- if res['code'] != "200":+ if res['code'] == "200":evt = SpiderFootEvent("JUNK_FILE", fetch,self.__name__, event)self.notifyListeners(evt)diff --git a/modules/sfp_tldsearch.py b/modules/sfp_tldsearch.pyindex a5d33fc0..929b51b1 100644--- a/modules/sfp_tldsearch.py+++ b/modules/sfp_tldsearch.py@@ -92,7 +92,7 @@ class sfp_tldsearch(SpiderFootPlugin):time.sleep(2)for res in self.tldResults.keys():- if self.tldResults[res]:+ if self.tldResults[res] and res not in self.results:self.sendEvent(sourceEvent, res)# Store the result internally and notify listening modulesdiff --git a/modules/sfp_whois.py b/modules/sfp_whois.pyindex a6a22416..e6bff12e 100644--- a/modules/sfp_whois.py+++ b/modules/sfp_whois.py@@ -38,7 +38,7 @@ class sfp_whois(SpiderFootPlugin):# What events is this module interested in for inputdef watchedEvents(self):- return ["DOMAIN_NAME", "DOMAIN_NAME_PARENT", "NETBLOCK_OWNER"]+ return ["DOMAIN_NAME", "DOMAIN_NAME_PARENT", "NETBLOCK_OWNER" ]# What events this module produces# This is to support the end user in selecting modules based on events@@ -74,8 +74,8 @@ class sfp_whois(SpiderFootPlugin):else:typ = "NETBLOCK_WHOIS"- evt = SpiderFootEvent(typ, data, self.__name__, event)- self.notifyListeners(evt)+ rawevt = SpiderFootEvent(typ, data, self.__name__, event)+ self.notifyListeners(rawevt)try:info = pythonwhois.parse.parse_raw_whois(data, True)