SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Various `RAW_RIR_DATA` changes to ensure it is only reported when data has been found.
smicallefe4ec0f560041
diff --git a/modules/sfp_arin.py b/modules/sfp_arin.pyindex 3958797f..1721f854 100644--- a/modules/sfp_arin.py+++ b/modules/sfp_arin.py@@ -53,13 +53,11 @@ class sfp_arin(SpiderFootPlugin):results = NonecurrentEventSrc = None- memCache = dict()keywords = Nonedef setup(self, sfc, userOpts=dict()):self.sf = sfcself.results = self.tempStorage()- self.memCache = dict()self.currentEventSrc = Nonefor opt in list(userOpts.keys()):@@ -77,18 +75,12 @@ class sfp_arin(SpiderFootPlugin):# Fetch content and notify of the raw datadef fetchRir(self, url):- if url in self.memCache:- res = self.memCache[url]- else:- head = {"Accept": "application/json"}- res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],- useragent=self.opts['_useragent'], headers=head)- if res['content'] is not None and res['code'] != "404":- self.memCache[url] = res- evt = SpiderFootEvent("RAW_RIR_DATA", res['content'], self.__name__,- self.currentEventSrc)- self.notifyListeners(evt)- return res+ head = {"Accept": "application/json"}+ res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],+ useragent=self.opts['_useragent'], headers=head)+ if res['content'] is not None and res['code'] != "404":+ return res+ return None# Owner information about an ASdef query(self, qtype, value):@@ -113,12 +105,15 @@ class sfp_arin(SpiderFootPlugin):url = valueres = self.fetchRir(url)- if res['content'] is None:+ if not res:self.sf.debug("No info found/available for " + value + " at ARIN.")return Nonetry:j = json.loads(res['content'])+ evt = SpiderFootEvent("RAW_RIR_DATA", res['content'], self.__name__,+ self.currentEventSrc)+ self.notifyListeners(evt)return jexcept Exception as e:self.sf.debug(f"Error processing JSON response: {e}")diff --git a/modules/sfp_koodous.py b/modules/sfp_koodous.pyindex b4f25c9a..9b38546f 100644--- a/modules/sfp_koodous.py+++ b/modules/sfp_koodous.py@@ -122,6 +122,7 @@ class sfp_koodous(SpiderFootPlugin):max_pages = int(self.opts['max_pages'])page = 1cursor = ''+ found = Falsewhile page <= max_pages:if self.checkForStop():return@@ -134,9 +135,6 @@ class sfp_koodous(SpiderFootPlugin):self.errorState = Truereturn- evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(data), self.__name__, event)- self.notifyListeners(evt)-results = data.get('results')for result in results:@@ -175,6 +173,11 @@ class sfp_koodous(SpiderFootPlugin):evt = SpiderFootEvent('APPSTORE_ENTRY', app_data, self.__name__, event)self.notifyListeners(evt)+ found = True++ if found:+ evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(data), self.__name__, event)+ self.notifyListeners(evt)if not data.get('next'):breakdiff --git a/modules/sfp_zetalytics.py b/modules/sfp_zetalytics.pyindex abde6931..4d72019f 100644--- a/modules/sfp_zetalytics.py+++ b/modules/sfp_zetalytics.py@@ -177,8 +177,6 @@ class sfp_zetalytics(SpiderFootPlugin):if self.checkForStop():return None- events_generated = False-self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")if self.opts["api_key"] == "":@@ -196,24 +194,18 @@ class sfp_zetalytics(SpiderFootPlugin):if eventName == "INTERNET_NAME":data = self.query_hostname(eventData)if self.generate_hostname_events(data, event):- events_generated = True+ self.emit("RAW_RIR_DATA", json.dumps(data), event)elif eventName == "DOMAIN_NAME":data = self.query_subdomains(eventData)if self.generate_subdomains_events(data, event):- events_generated = True+ self.emit("RAW_RIR_DATA", json.dumps(data), event)data = self.query_email_domain(eventData)if self.generate_email_domain_events(data, event):- events_generated = True+ self.emit("RAW_RIR_DATA", json.dumps(data), event)elif eventName == "EMAILADDR":data = self.query_email_address(eventData)if self.generate_email_events(data, event):- events_generated = True-- else:- return-- if events_generated and not self.checkForStop():- self.emit("RAW_RIR_DATA", json.dumps(data), event)+ self.emit("RAW_RIR_DATA", json.dumps(data), event)