Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Reverted recent change.

smicallefd6340f737787
diff --git a/modules/sfp_malwarepatrol.py b/modules/sfp_malwarepatrol.py
index 11fffdb5..03d7196e 100644
--- a/modules/sfp_malwarepatrol.py
+++ b/modules/sfp_malwarepatrol.py
@@ -5,14 +5,14 @@
# potential malicious IPs/hostnames.
#
# Author: Steve Micallef <[email protected]>
-# Updated by: Immanuel George <[email protected]>
#
# Created: 25/07/2016
# Copyright: (c) Steve Micallef 2016
# Licence: GPL
# -------------------------------------------------------------------------------
-from sflib import SpiderFootPlugin, SpiderFootEvent
+import json
+from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
class sfp_malwarepatrol(SpiderFootPlugin):
@@ -45,45 +45,30 @@ class sfp_malwarepatrol(SpiderFootPlugin):
# This is to support the end user in selecting modules based on events
# produced.
def producedEvents(self):
- return [
- "MALICIOUS_IPADDR",
- "MALICIOUS_INTERNET_NAME",
- "MALICIOUS_AFFILIATE_IPADDR",
- "MALICIOUS_AFFILIATE_INTERNET_NAME",
- "MALICIOUS_COHOST"
- ]
+ return ["MALICIOUS_IPADDR", "MALICIOUS_INTERNET_NAME",
+ "MALICIOUS_AFFILIATE_IPADDR", "MALICIOUS_AFFILIATE_INTERNET_NAME",
+ "MALICIOUS_COHOST"]
def queryAddr(self, qaddr):
- block_list = [
- "clamav_basic",
- "firekeeper",
- "mailwasher",
- "mozilla_adblock",
- "spamassassin",
- "smoothwall"
- ]
-
- for block_name in block_list:
- data = dict()
- url = "http://lists.malwarepatrol.net/cgi/getfile?receipt={}&product=32&list={}"
- url = url.format(self.opts['api_key'], block_name)
-
- cache_name = "sfmalwarepatrol_{}".format(block_name)
- data['content'] = self.sf.cacheGet(cache_name, 72)
+ data = dict()
+ url = "http://lists.malwarepatrol.net/cgi/getfile?receipt=" + \
+ self.opts['api_key'] + "&product=8&list=smoothwall"
+
+ data['content'] = self.sf.cacheGet("sfmalwarepatrol", 72)
+ if data['content'] is None:
+ data = self.sf.fetchUrl(url, useragent=self.opts['_useragent'])
if data['content'] is None:
- data = self.sf.fetchUrl(url, useragent=self.opts['_useragent'])
- if data['content'] is None:
- self.sf.error("Unable to fetch " + url, False)
- return None
- else:
- self.sf.cachePut(cache_name, data['content'])
+ self.sf.error("Unable to fetch " + url, False)
+ return None
+ else:
+ self.sf.cachePut("sfmalwarepatrol", data['content'])
- for line in data['content'].split('\n'):
- if len(line) < 2 or line.startswith('#'):
- continue
+ for line in data['content'].split('\n'):
+ if len(line) < 2 or line.startswith('#'):
+ continue
- if line.startswith(qaddr):
- return True
+ if line.startswith(qaddr):
+ return True
return False
@@ -99,10 +84,7 @@ class sfp_malwarepatrol(SpiderFootPlugin):
self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
if not self.opts['api_key']:
- self.sf.error(
- "You enabled sfp_malwarepatrol but did not provide an receipt ID!",
- False
- )
+ self.sf.error("You enabled sfp_malwarepatrol but did not provide an receipt ID!", False)
self.errorState = True
return None
@@ -114,20 +96,14 @@ class sfp_malwarepatrol(SpiderFootPlugin):
self.results[eventData] = True
evtType = ""
- if eventName in [
- 'IP_ADDRESS',
- 'AFFILIATE_IPADDR'
- ]:
+ if eventName in ['IP_ADDRESS', 'AFFILIATE_IPADDR']:
if eventName == 'IP_ADDRESS':
evtType = 'MALICIOUS_IPADDR'
else:
evtType = 'MALICIOUS_AFFILIATE_IPADDR'
- if eventName in [
- 'INTERNET_NAME',
- 'CO_HOSTED_SITE',
- 'AFFILIATE_INTERNET_NAME'
- ]:
+ if eventName in ['INTERNET_NAME', 'CO_HOSTED_SITE',
+ 'AFFILIATE_INTERNET_NAME' ]:
if eventName == "INTERNET_NAME":
evtType = "MALICIOUS_INTERNET_NAME"
if eventName == 'AFFILIATE_INTERNET_NAME':