SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Ensure `RAW_RIR_DATA` is only reported when valid data has been found.
smicallef6a6062c0594f
diff --git a/modules/sfp_apple_itunes.py b/modules/sfp_apple_itunes.pyindex 280dcb9d..872cb099 100644--- a/modules/sfp_apple_itunes.py+++ b/modules/sfp_apple_itunes.py@@ -121,11 +121,9 @@ class sfp_apple_itunes(SpiderFootPlugin):self.sf.info(f"No results found for {eventData}")return- evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(data), self.__name__, event)- self.notifyListeners(evt)-urls = list()hosts = list()+ found = Falsefor result in data:bundleId = result.get('bundleId')@@ -163,6 +161,7 @@ class sfp_apple_itunes(SpiderFootPlugin):evt = SpiderFootEvent('APPSTORE_ENTRY', app_data, self.__name__, event)self.notifyListeners(evt)+ found = TruesellerUrl = result.get('sellerUrl')@@ -180,6 +179,7 @@ class sfp_apple_itunes(SpiderFootPlugin):if self.getTarget().matches(host, includeChildren=True, includeParents=True):evt = SpiderFootEvent('LINKED_URL_INTERNAL', url, self.__name__, event)self.notifyListeners(evt)+ found = Truehosts.append(host)@@ -193,5 +193,10 @@ class sfp_apple_itunes(SpiderFootPlugin):else:evt = SpiderFootEvent('AFFILIATE_INTERNET_NAME', host, self.__name__, event)self.notifyListeners(evt)+ found = True++ if found:+ evt = SpiderFootEvent('RAW_RIR_DATA', json.dumps(data), self.__name__, event)+ self.notifyListeners(evt)# End of sfp_apple_itunes classdiff --git a/modules/sfp_c99.py b/modules/sfp_c99.pyindex 1af8bccd..2f995b83 100644--- a/modules/sfp_c99.py+++ b/modules/sfp_c99.py@@ -132,13 +132,12 @@ class sfp_c99(SpiderFootPlugin):self.notifyListeners(evt)def emitPhoneData(self, phoneData, event):- self.emitRawRirData(phoneData, event)-provider = phoneData.get("provider")carrier = phoneData.get("carrier")city = phoneData.get("city")countryName = phoneData.get("country_name")region = phoneData.get("region")+ found = Falseif provider or carrier:evt = SpiderFootEvent(@@ -148,6 +147,7 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = Trueif city or countryName or region:evt = SpiderFootEvent(@@ -157,9 +157,13 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = True++ if found:+ self.emitRawRirData(phoneData, event)def emitSubDomainData(self, subDomainData, event):- self.emitRawRirData(subDomainData, event)+ found = Falsefor subDomainElem in subDomainData:if self.checkForStop():@@ -169,9 +173,13 @@ class sfp_c99(SpiderFootPlugin):if subDomain:self.emitHostname(subDomain, event)+ found = True++ if found:+ self.emitRawRirData(subDomainData, event)def emitDomainHistoryData(self, domainHistoryData, event):- self.emitRawRirData(domainHistoryData, event)+ found = Falsefor domainHistoryElem in domainHistoryData:if self.checkForStop():@@ -187,10 +195,12 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = True- def emitIpToSkypeData(self, data, event):- self.emitRawRirData(data, event)+ if found:+ self.emitRawRirData(domainHistoryData, event)+ def emitIpToSkypeData(self, data, event):skype = data.get("skype")if skype:@@ -210,10 +220,11 @@ class sfp_c99(SpiderFootPlugin):)self.notifyListeners(evt)- def emitIpToDomainsData(self, data, event):- self.emitRawRirData(data, event)+ self.emitRawRirData(data, event)+ def emitIpToDomainsData(self, data, event):domains = data.get("domains")+ found = Falseif isinstance(domains, list):for domain in domains:@@ -223,9 +234,12 @@ class sfp_c99(SpiderFootPlugin):domain = domain.strip()if domain:self.emitHostname(domain, event)+ found = True++ if found:+ self.emitRawRirData(data, event)def emitProxyDetectionData(self, data, event):- self.emitRawRirData(data, event)isProxy = data.get("proxy")if isProxy:@@ -236,13 +250,15 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ self.emitRawRirData(data, event)def emitGeoIPData(self, data, event):- self.emitRawRirData(data, event)+ found = FalsehostName = data.get("hostname", "").strip()if hostName:self.emitHostname(hostName, event)+ found = Truerecord = data.get("records")@@ -263,6 +279,7 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = Trueif latitude and longitude:evt = SpiderFootEvent(@@ -272,6 +289,7 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = Trueif region or country or city or postalCode:evt = SpiderFootEvent(@@ -281,12 +299,15 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = True- def emitSkypeResolverData(self, data, event):- self.emitRawRirData(data, event)+ if found:+ self.emitRawRirData(data, event)+ def emitSkypeResolverData(self, data, event):ip = data.get("ip")ips = data.get("ips")+ found = Falseif ip and ip not in ips:evt = SpiderFootEvent(@@ -296,8 +317,10 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ found = Trueif isinstance(ips, list):+ found = Truefor ipElem in ips:if self.checkForStop():return None@@ -310,8 +333,10 @@ class sfp_c99(SpiderFootPlugin):)self.notifyListeners(evt)+ if found:+ self.emitRawRirData(data, event)+def emitWafDetectorData(self, data, event):- self.emitRawRirData(data, event)firewall = data.get("result")if firewall:@@ -322,6 +347,7 @@ class sfp_c99(SpiderFootPlugin):event,)self.notifyListeners(evt)+ self.emitRawRirData(data, event)def emitHostname(self, data, event):if not self.sf.validHost(data, self.opts['_internettlds']):diff --git a/modules/sfp_darksearch.py b/modules/sfp_darksearch.pyindex c83daa3a..b354b7d7 100644--- a/modules/sfp_darksearch.py+++ b/modules/sfp_darksearch.py@@ -119,17 +119,19 @@ class sfp_darksearch(SpiderFootPlugin):page = 1pages = self.opts['max_pages']while page <= pages:+ found = False+if self.checkForStop():return None- res = self.query(eventData, page)+ query_results = self.query(eventData, page)- if res is None:+ if query_results is None:return Nonepage += 1- last_page = res.get('last_page')+ last_page = query_results.get('last_page')if last_page is None:pages = 0@@ -137,7 +139,7 @@ class sfp_darksearch(SpiderFootPlugin):if last_page < pages:pages = last_page- data = res.get('data')+ data = query_results.get('data')if data is None:return None@@ -146,9 +148,6 @@ class sfp_darksearch(SpiderFootPlugin):if result is None:continue- evt = SpiderFootEvent("RAW_RIR_DATA", str(result), self.__name__, event)- self.notifyListeners(evt)-link = result.get('link')if link is None:@@ -179,6 +178,7 @@ class sfp_darksearch(SpiderFootPlugin):evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)self.notifyListeners(evt)+ found = True# extract content excerpttry:@@ -198,6 +198,7 @@ class sfp_darksearch(SpiderFootPlugin):else:evt = SpiderFootEvent("DARKNET_MENTION_URL", link, self.__name__, event)self.notifyListeners(evt)+ found = Trueif result.get('title') is None and result.get('description') is None:self.sf.debug("Ignoring " + link + " as no mention of " + eventData)@@ -210,4 +211,8 @@ class sfp_darksearch(SpiderFootPlugin):event)self.notifyListeners(evt)+ if found:+ evt = SpiderFootEvent("RAW_RIR_DATA", str(query_results), self.__name__, event)+ self.notifyListeners(evt)+# End of sfp_darksearch class