SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
modules: remove unused malchecks code
Brendan Coles1809a975952e
diff --git a/modules/sfp_abusech.py b/modules/sfp_abusech.pyindex 011f2ca0..a21f9d46 100644--- a/modules/sfp_abusech.py+++ b/modules/sfp_abusech.py@@ -18,39 +18,33 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'abuse.ch Zeus Tracker (Domain)': {'id': 'abusezeusdomain',- 'type': 'list','checks': ['domain'],'url': 'https://zeustracker.abuse.ch/blocklist.php?download=baddomains'},'abuse.ch Zeus Tracker (IP)': {'id': 'abusezeusip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://zeustracker.abuse.ch/blocklist.php?download=badips'},'abuse.ch Feodo Tracker (IP)': {'id': 'abusefeodoip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://feodotracker.abuse.ch/downloads/ipblocklist.txt'},'abuse.ch SSL Blacklist (IP)': {'id': 'abusesslblip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://sslbl.abuse.ch/blacklist/sslipblacklist.csv','regex': '{0},.*'},'abuse.ch URLhaus (Domain)': {'id': 'abuseurlhaus',- 'type': 'list','checks': ['domain'],'url': 'https://urlhaus.abuse.ch/downloads/csv/','regex': '.*//{0}/.*'},'abuse.ch Ransomware Blocklist (Domain)': {'id': 'abuseransomdom',- 'type': 'list','checks': ['domain'],'url': 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt','regex': '^{0}$'@@ -160,44 +154,6 @@ class sfp_abusech(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -209,7 +165,7 @@ class sfp_abusech(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -282,12 +238,8 @@ class sfp_abusech(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -302,8 +254,8 @@ class sfp_abusech(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_abuseipdb.py b/modules/sfp_abuseipdb.pyindex e8f911e2..81b524e8 100644--- a/modules/sfp_abuseipdb.py+++ b/modules/sfp_abuseipdb.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'AbuseIPDB': {'id': 'abuseipdbip',- 'type': 'list','checks': ['ip'],'url': 'https://api.abuseipdb.com/api/v2/blacklist?confidenceMinimum={0}&plaintext=1'}@@ -106,34 +105,12 @@ class sfp_abuseipdb(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-def lookupItem(self, resourceId, itemType, target):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None# Look up 'list' type resources@@ -147,7 +124,7 @@ class sfp_abuseipdb(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url'].format(self.opts['confidenceminimum'])hdr = {@@ -188,8 +165,7 @@ class sfp_abuseipdb(SpiderFootPlugin):try:if IPAddress(ip) in IPNetwork(target):- self.sf.debug(ip + " found within netblock/subnet " +- target + " in " + check)+ self.sf.debug(ip + " found within netblock/subnet " + target + " in " + check)return urlexcept Exception as e:self.sf.debug("Error encountered parsing: " + str(e))@@ -230,8 +206,8 @@ class sfp_abuseipdb(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'AFFILIATE_IPADDR' \and not self.opts.get('checkaffiliates', False):diff --git a/modules/sfp_alienvaultiprep.py b/modules/sfp_alienvaultiprep.pyindex 775dad72..a83cfa76 100644--- a/modules/sfp_alienvaultiprep.py+++ b/modules/sfp_alienvaultiprep.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'AlienVault IP Reputation Database': {'id': '_alienvault',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://reputation.alienvault.com/reputation.generic','regex': '{0} #.*'@@ -97,44 +96,6 @@ class sfp_alienvaultiprep(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -146,7 +107,7 @@ class sfp_alienvaultiprep(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -219,12 +180,8 @@ class sfp_alienvaultiprep(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -239,8 +196,8 @@ class sfp_alienvaultiprep(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_bambenek.py b/modules/sfp_bambenek.pyindex 87c92e40..a8ed3291 100644--- a/modules/sfp_bambenek.py+++ b/modules/sfp_bambenek.py@@ -18,14 +18,12 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'Bambenek C&C IP List': {'id': 'bambip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'http://osint.bambenekconsulting.com/feeds/c2-ipmasterlist.txt','regex': '^{0},.*'},'Bambenek C&C Domain List': {'id': 'bambdom',- 'type': 'list','checks': ['domain'],'url': 'http://osint.bambenekconsulting.com/feeds/c2-dommasterlist.txt','regex': '^{0},.*'@@ -112,44 +110,6 @@ class sfp_bambenek(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -161,7 +121,7 @@ class sfp_bambenek(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -234,12 +194,8 @@ class sfp_bambenek(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -254,8 +210,8 @@ class sfp_bambenek(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_blocklistde.py b/modules/sfp_blocklistde.pyindex 33b15ac9..74617eff 100644--- a/modules/sfp_blocklistde.py+++ b/modules/sfp_blocklistde.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'blocklist.de List': {'id': '_blocklistde',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'http://lists.blocklist.de/lists/all.txt'}@@ -97,44 +96,6 @@ class sfp_blocklistde(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -146,7 +107,7 @@ class sfp_blocklistde(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -219,12 +180,8 @@ class sfp_blocklistde(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -239,8 +196,8 @@ class sfp_blocklistde(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_botvrij.py b/modules/sfp_botvrij.pyindex 43c67155..2e2401ed 100644--- a/modules/sfp_botvrij.py+++ b/modules/sfp_botvrij.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'botvrij.eu Domain Blocklist': {'id': '_botvrij',- 'type': 'list','checks': ['domain'],'url': 'https://www.botvrij.eu/data/blocklist/blocklist_full.csv','regex': '{0},.*'@@ -81,44 +80,6 @@ class sfp_botvrij(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -130,7 +91,7 @@ class sfp_botvrij(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -203,12 +164,8 @@ class sfp_botvrij(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -223,8 +180,8 @@ class sfp_botvrij(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_coinblocker.py b/modules/sfp_coinblocker.pyindex 48d1dc95..dbe9134f 100644--- a/modules/sfp_coinblocker.py+++ b/modules/sfp_coinblocker.py@@ -18,14 +18,12 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'CoinBlocker IP List': {'id': 'coinip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://zerodot1.gitlab.io/CoinBlockerLists/MiningServerIPList.txt','regex': '^{0}$'},'CoinBlocker Domain List': {'id': 'coindom',- 'type': 'list','checks': ['domain'],'url': 'https://zerodot1.gitlab.io/CoinBlockerLists/list.txt','regex': '^{0}$'@@ -110,44 +108,6 @@ class sfp_coinblocker(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -159,7 +119,7 @@ class sfp_coinblocker(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -232,12 +192,8 @@ class sfp_coinblocker(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -252,8 +208,8 @@ class sfp_coinblocker(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_customfeed.py b/modules/sfp_customfeed.pyindex 2de0d2f1..36561afa 100644--- a/modules/sfp_customfeed.py+++ b/modules/sfp_customfeed.py@@ -82,26 +82,6 @@ class sfp_customfeed(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -211,8 +191,8 @@ class sfp_customfeed(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_cybercrimetracker.py b/modules/sfp_cybercrimetracker.pyindex 74d9edf0..2442f12b 100644--- a/modules/sfp_cybercrimetracker.py+++ b/modules/sfp_cybercrimetracker.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'cybercrime-tracker.net Malicious Submissions': {'id': '_cybercrime',- 'type': 'list','checks': ['ip', 'domain'],'url': 'http://cybercrime-tracker.net/all.php','regex': '^{0}[/$]'@@ -93,44 +92,6 @@ class sfp_cybercrimetracker(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -142,7 +103,7 @@ class sfp_cybercrimetracker(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -214,12 +175,8 @@ class sfp_cybercrimetracker(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -234,8 +191,8 @@ class sfp_cybercrimetracker(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_malwaredomainlist.py b/modules/sfp_malwaredomainlist.pyindex 52a68002..d8824f73 100644--- a/modules/sfp_malwaredomainlist.py+++ b/modules/sfp_malwaredomainlist.py@@ -18,13 +18,11 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'malwaredomainlist.com IP List': {'id': 'malwaredomainlistip',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'http://www.malwaredomainlist.com/hostslist/ip.txt'},'malwaredomainlist.com Domain List': {'id': 'malwaredomainlistdomain',- 'type': 'list','checks': ['domain'],'url': 'http://www.malwaredomainlist.com/hostslist/hosts.txt','regex': '.*\s+{0}[\s$]'@@ -107,44 +105,6 @@ class sfp_malwaredomainlist(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_SUBNET", "MALICIOUS_COHOST", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -156,7 +116,7 @@ class sfp_malwaredomainlist(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -229,12 +189,8 @@ class sfp_malwaredomainlist(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -249,8 +205,8 @@ class sfp_malwaredomainlist(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_malwaredomains.py b/modules/sfp_malwaredomains.pyindex 725967f3..382ce672 100644--- a/modules/sfp_malwaredomains.py+++ b/modules/sfp_malwaredomains.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'malwaredomains.com Domains': {'id': '_malwaredomains',- 'type': 'list','checks': ['domain'],'url': 'https://mirror.cedia.org.ec/malwaredomains/justdomains','regex': '^{0}$'@@ -93,44 +92,6 @@ class sfp_malwaredomains(SpiderFootPlugin):return ["MALICIOUS_INTERNET_NAME", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -142,7 +103,7 @@ class sfp_malwaredomains(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -215,12 +176,8 @@ class sfp_malwaredomains(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -235,8 +192,8 @@ class sfp_malwaredomains(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_multiproxy.py b/modules/sfp_multiproxy.pyindex 7ee1b171..7b58094d 100644--- a/modules/sfp_multiproxy.py+++ b/modules/sfp_multiproxy.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'multiproxy.org Open Proxies': {'id': '_multiproxy',- 'type': 'list','checks': ['ip'],'url': 'http://multiproxy.org/txt_all/proxy.txt','regex': '{0}:.*'@@ -94,44 +93,6 @@ class sfp_multiproxy(SpiderFootPlugin):def producedEvents(self):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -143,7 +104,7 @@ class sfp_multiproxy(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -216,12 +177,8 @@ class sfp_multiproxy(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -236,8 +193,8 @@ class sfp_multiproxy(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_openphish.py b/modules/sfp_openphish.pyindex 336d3c34..943de082 100644--- a/modules/sfp_openphish.py+++ b/modules/sfp_openphish.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'OpenPhish': {'id': '_openphish',- 'type': 'list','checks': ['domain'],'url': 'https://www.openphish.com/feed.txt','regex': '\w+://(.*\.)?[^a-zA-Z0-9]?{0}.*'@@ -92,44 +91,6 @@ class sfp_openphish(SpiderFootPlugin):return ["MALICIOUS_INTERNET_NAME", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -141,7 +102,7 @@ class sfp_openphish(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -214,12 +175,8 @@ class sfp_openphish(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -234,8 +191,8 @@ class sfp_openphish(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_phishtank.py b/modules/sfp_phishtank.pyindex 5a924877..1af13bd6 100644--- a/modules/sfp_phishtank.py+++ b/modules/sfp_phishtank.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'PhishTank': {'id': '_phishtank',- 'type': 'list','checks': ['domain'],'url': 'http://data.phishtank.com/data/online-valid.csv','regex': '\d+,\w+://(.*\.)?[^a-zA-Z0-9]?{0}.*,http://www.phishtank.com/.*'@@ -88,44 +87,6 @@ class sfp_phishtank(SpiderFootPlugin):return ["MALICIOUS_INTERNET_NAME", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -137,7 +98,7 @@ class sfp_phishtank(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -210,12 +171,8 @@ class sfp_phishtank(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -230,8 +187,8 @@ class sfp_phishtank(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_talosintel.py b/modules/sfp_talosintel.pyindex 3d5e4c16..2a507ab7 100644--- a/modules/sfp_talosintel.py+++ b/modules/sfp_talosintel.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'talosintelligence.com List': {'id': '_talosintel',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://talosintelligence.com/documents/ip-blacklist'}@@ -97,44 +96,6 @@ class sfp_talosintel(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -146,7 +107,7 @@ class sfp_talosintel(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -219,12 +180,8 @@ class sfp_talosintel(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -239,8 +196,8 @@ class sfp_talosintel(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_torexits.py b/modules/sfp_torexits.pyindex a93b8e9f..2d1ea5e1 100644--- a/modules/sfp_torexits.py+++ b/modules/sfp_torexits.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'TOR Exist List': {'id': '_torexits',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'https://check.torproject.org/exit-addresses','regex': '^ExitAddress\s+{0}\s+'@@ -82,44 +81,6 @@ class sfp_torexits(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -131,7 +92,7 @@ class sfp_torexits(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -204,12 +165,8 @@ class sfp_torexits(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -224,8 +181,8 @@ class sfp_torexits(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_voipbl.py b/modules/sfp_voipbl.pyindex 59c98e3d..cbccfd95 100644--- a/modules/sfp_voipbl.py+++ b/modules/sfp_voipbl.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'VOIPBL Publicly Accessible PBX List': {'id': '_voipbl',- 'type': 'list','checks': ['ip', 'netblock'],'url': 'http://www.voipbl.org/update','regex': '{0}\/'@@ -94,44 +93,6 @@ class sfp_voipbl(SpiderFootPlugin):return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR","MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -143,7 +104,7 @@ class sfp_voipbl(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -216,12 +177,8 @@ class sfp_voipbl(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -236,8 +193,8 @@ class sfp_voipbl(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return Nonediff --git a/modules/sfp_vxvault.py b/modules/sfp_vxvault.pyindex 58112dc1..daa48e4d 100644--- a/modules/sfp_vxvault.py+++ b/modules/sfp_vxvault.py@@ -18,7 +18,6 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventmalchecks = {'VXVault Malicious URL List': {'id': '_vxvault',- 'type': 'list','checks': ['ip', 'domain'],'url': 'http://vxvault.net/URL_List.php','regex': '.*\/{0}/.*'@@ -95,44 +94,6 @@ class sfp_vxvault(SpiderFootPlugin):"MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME","MALICIOUS_COHOST"]- # Check the regexps to see whether the content indicates maliciousness- def contentMalicious(self, content, goodregex, badregex):- # First, check for the bad indicators- if len(badregex) > 0:- for rx in badregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be bad against bad regex: " + rx)- return True-- # Finally, check for good indicators- if len(goodregex) > 0:- for rx in goodregex:- if re.match(rx, content, re.IGNORECASE | re.DOTALL):- self.sf.debug("Found to be good againt good regex: " + rx)- return False-- # If nothing was matched, reply None- self.sf.debug("Neither good nor bad, unknown.")- return None-- # Look up 'query' type sources- def resourceQuery(self, id, target, targetType):- self.sf.debug("Querying " + id + " for maliciousness of " + target)- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "query":- url = str(malchecks[check]['url'])- res = self.sf.fetchUrl(url.format(target), timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])- if res['content'] is None:- self.sf.error("Unable to fetch " + url.format(target), False)- return None- if self.contentMalicious(res['content'],- malchecks[check]['goodregex'],- malchecks[check]['badregex']):- return url.format(target)-- return None-# Look up 'list' type resourcesdef resourceList(self, id, target, targetType):targetDom = ''@@ -144,7 +105,7 @@ class sfp_vxvault(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']- if id == cid and malchecks[check]['type'] == "list":+ if id == cid:data = dict()url = malchecks[check]['url']data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))@@ -217,12 +178,8 @@ class sfp_vxvault(SpiderFootPlugin):for check in list(malchecks.keys()):cid = malchecks[check]['id']if cid == resourceId and itemType in malchecks[check]['checks']:- self.sf.debug("Checking maliciousness of " + target + " (" +- itemType + ") with: " + cid)- if malchecks[check]['type'] == "query":- return self.resourceQuery(cid, target, itemType)- if malchecks[check]['type'] == "list":- return self.resourceList(cid, target, itemType)+ self.sf.debug("Checking maliciousness of " + target + " (" + itemType + ") with: " + cid)+ return self.resourceList(cid, target, itemType)return None@@ -237,8 +194,8 @@ class sfp_vxvault(SpiderFootPlugin):if eventData in self.results:self.sf.debug("Skipping " + eventData + ", already checked.")return None- else:- self.results[eventData] = True++ self.results[eventData] = Trueif eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):return None