SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
sfp_stevenblack_hosts: Report blocked hosts as blacklisted (#1516)
bcolesf0e49e186fc5
diff --git a/modules/sfp_stevenblack_hosts.py b/modules/sfp_stevenblack_hosts.pyindex e138b109..0c206879 100644--- a/modules/sfp_stevenblack_hosts.py+++ b/modules/sfp_stevenblack_hosts.py@@ -53,7 +53,6 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):for opt in list(userOpts.keys()):self.opts[opt] = userOpts[opt]- # What events is this module interested in for inputdef watchedEvents(self):return ["INTERNET_NAME",@@ -61,9 +60,11 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):"CO_HOSTED_SITE"]- # What events this module producesdef producedEvents(self):return [+ "BLACKLISTED_INTERNET_NAME",+ "BLACKLISTED_AFFILIATE_INTERNET_NAME",+ "BLACKLISTED_COHOST","MALICIOUS_INTERNET_NAME","MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"@@ -137,13 +138,11 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):return hosts- # Handle events sent to this moduledef handleEvent(self, event):eventName = event.eventType- srcModuleName = event.moduleeventData = event.data- self.debug(f"Received event, {eventName}, from {srcModuleName}")+ self.debug(f"Received event, {eventName}, from {event.module}")if eventData in self.results:self.debug(f"Skipping {eventData}, already checked.")@@ -155,24 +154,34 @@ class sfp_stevenblack_hosts(SpiderFootPlugin):self.results[eventData] = Trueif eventName == "INTERNET_NAME":- evtType = "MALICIOUS_INTERNET_NAME"- elif eventName == 'AFFILIATE_INTERNET_NAME':+ malicious_type = "MALICIOUS_INTERNET_NAME"+ blacklist_type = "BLACKLISTED_INTERNET_NAME"+ elif eventName == "AFFILIATE_INTERNET_NAME":if not self.opts.get('checkaffiliates', False):return- evtType = 'MALICIOUS_AFFILIATE_INTERNET_NAME'- elif eventName == 'CO_HOSTED_SITE':+ malicious_type = "MALICIOUS_AFFILIATE_INTERNET_NAME"+ blacklist_type = "BLACKLISTED_AFFILIATE_INTERNET_NAME"+ elif eventName == "CO_HOSTED_SITE":if not self.opts.get('checkcohosts', False):return- evtType = 'MALICIOUS_COHOST'+ malicious_type = "MALICIOUS_COHOST"+ blacklist_type = "BACKLISTED_COHOST"else:+ self.debug(f"Unexpected event type {eventName}, skipping")returnself.debug(f"Checking maliciousness of {eventData} ({eventName}) with Steven Black Hosts blocklist")- if self.queryBlocklist(eventData):- url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"- text = f"Steven Black Hosts Blocklist [{eventData}]\n<SFURL>{url}</SFURL>"- evt = SpiderFootEvent(evtType, text, self.__name__, event)- self.notifyListeners(evt)+ if not self.queryBlocklist(eventData):+ return++ url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"+ text = f"Steven Black Hosts Blocklist [{eventData}]\n<SFURL>{url}</SFURL>"++ evt = SpiderFootEvent(malicious_type, text, self.__name__, event)+ self.notifyListeners(evt)++ evt = SpiderFootEvent(blacklist_type, text, self.__name__, event)+ self.notifyListeners(evt)# End of sfp_stevenblack_hosts class