Skip to content

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

Removed dead modules.

smicalleffccbf4a9e143
diff --git a/modules/sfp_bitcash.py b/modules/sfp_bitcash.py
deleted file mode 100644
index 155cd3b7..00000000
--- a/modules/sfp_bitcash.py
+++ /dev/null
@@ -1,271 +0,0 @@
-# -*- coding: utf-8 -*-
-# -------------------------------------------------------------------------------
-# Name: sfp_bitcash
-# Purpose: Checks if an ASN, IP or domain is malicious.
-#
-#
-# Created: 14/12/2013
-# Copyright: (c) Steve Micallef, 2013
-# Licence: GPL
-# -------------------------------------------------------------------------------
-
-from netaddr import IPAddress, IPNetwork
-import re
-from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
-
-malchecks = {
- 'bitcash.cz Blacklist': {
- 'id': '_bitcash',
- 'type': 'list',
- 'checks': [ 'ip' ],
- 'url': 'http://bitcash.cz/misc/log/blacklist',
- 'regex': '{0}\s+.*'
- }
-}
-
-
-class sfp_bitcash(SpiderFootPlugin):
- """Bitcash.cz Malicious IPs:Investigate,Passive:Reputation Systems::Check if an IP is malicious according to Bitcash.cz Malicious IPs."""
-
-
-
-
- # Default options
- opts = {
- '_bitcash': True,
- 'checkaffiliates': True,
- 'cacheperiod': 18
- }
-
- # Option descriptions
- optdescs = {
- 'checkaffiliates': "Apply checks to affiliates?",
- 'cacheperiod': "Hours to cache list data before re-fetching."
- }
-
- # Be sure to completely clear any class variables in setup()
- # or you run the risk of data persisting between scan runs.
-
- results = dict()
-
- def setup(self, sfc, userOpts=dict()):
- self.sf = sfc
- self.results = dict()
-
- # Clear / reset any other class member variables here
- # or you risk them persisting between threads.
-
- for opt in userOpts.keys():
- self.opts[opt] = userOpts[opt]
-
- # What events is this module interested in for input
- # * = be notified about all events.
- def watchedEvents(self):
- return ["IP_ADDRESS", "AFFILIATE_IPADDR"]
-
-
- # What events this module produces
- # This is to support the end user in selecting modules based on events
- # produced.
- 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 malchecks.keys():
- cid = malchecks[check]['id']
- if id == cid and malchecks[check]['type'] == "query":
- url = unicode(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 resources
- def resourceList(self, id, target, targetType):
- targetDom = ''
- # Get the base domain if we're supplied a domain
- if targetType == "domain":
- targetDom = self.sf.hostDomain(target, self.opts['_internettlds'])
-
- for check in malchecks.keys():
- cid = malchecks[check]['id']
- if id == cid and malchecks[check]['type'] == "list":
- data = dict()
- url = malchecks[check]['url']
- data['content'] = self.sf.cacheGet("sfmal_" + cid, self.opts.get('cacheperiod', 0))
- if data['content'] is None:
- data = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent=self.opts['_useragent'])
- if data['content'] is None:
- self.sf.error("Unable to fetch " + url, False)
- return None
- else:
- self.sf.cachePut("sfmal_" + cid, data['content'])
-
- # If we're looking at netblocks
- if targetType == "netblock":
- iplist = list()
- # Get the regex, replace {0} with an IP address matcher to
- # build a list of IP.
- # Cycle through each IP and check if it's in the netblock.
- if 'regex' in malchecks[check]:
- rx = malchecks[check]['regex'].replace("{0}",
- "(\d+\.\d+\.\d+\.\d+)")
- pat = re.compile(rx, re.IGNORECASE)
- self.sf.debug("New regex for " + check + ": " + rx)
- for line in data['content'].split('\n'):
- grp = re.findall(pat, line)
- if len(grp) > 0:
- #self.sf.debug("Adding " + grp[0] + " to list.")
- iplist.append(grp[0])
- else:
- iplist = data['content'].split('\n')
-
- for ip in iplist:
- if len(ip) < 8 or ip.startswith("#"):
- continue
- ip = ip.strip()
-
- try:
- if IPAddress(ip) in IPNetwork(target):
- self.sf.debug(ip + " found within netblock/subnet " +
- target + " in " + check)
- return url
- except Exception as e:
- self.sf.debug("Error encountered parsing: " + str(e))
- continue
-
- return None
-
- # If we're looking at hostnames/domains/IPs
- if 'regex' not in malchecks[check]:
- for line in data['content'].split('\n'):
- if line == target or (targetType == "domain" and line == targetDom):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
- return url
- else:
- # Check for the domain and the hostname
- try:
- rxDom = unicode(malchecks[check]['regex']).format(targetDom)
- rxTgt = unicode(malchecks[check]['regex']).format(target)
- for line in data['content'].split('\n'):
- if (targetType == "domain" and re.match(rxDom, line, re.IGNORECASE)) or \
- re.match(rxTgt, line, re.IGNORECASE):
- self.sf.debug(target + "/" + targetDom + " found in " + check + " list.")
- return url
- except BaseException as e:
- self.sf.debug("Error encountered parsing 2: " + str(e))
- continue
-
- return None
-
- def lookupItem(self, resourceId, itemType, target):
- for check in 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)
-
- return None
-
- # Handle events sent to this module
- def handleEvent(self, event):
- eventName = event.eventType
- srcModuleName = event.module
- eventData = event.data
-
- self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
-
- if eventData in self.results:
- self.sf.debug("Skipping " + eventData + ", already checked.")
- return None
- else:
- self.results[eventData] = True
-
- if eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):
- return None
- if eventName == 'AFFILIATE_IPADDR' \
- and not self.opts.get('checkaffiliates', False):
- return None
- if eventName == 'NETBLOCK_OWNER' and not self.opts.get('checknetblocks', False):
- return None
- if eventName == 'NETBLOCK_MEMBER' and not self.opts.get('checksubnets', False):
- return None
-
- for check in malchecks.keys():
- cid = malchecks[check]['id']
- # If the module is enabled..
- if self.opts[cid]:
- if eventName in ['IP_ADDRESS', 'AFFILIATE_IPADDR']:
- typeId = 'ip'
- if eventName == 'IP_ADDRESS':
- evtType = 'MALICIOUS_IPADDR'
- else:
- evtType = 'MALICIOUS_AFFILIATE_IPADDR'
-
- if eventName in ['BGP_AS_OWNER', 'BGP_AS_MEMBER']:
- typeId = 'asn'
- evtType = 'MALICIOUS_ASN'
-
- if eventName in ['INTERNET_NAME', 'CO_HOSTED_SITE',
- 'AFFILIATE_INTERNET_NAME', ]:
- typeId = 'domain'
- if eventName == "INTERNET_NAME":
- evtType = "MALICIOUS_INTERNET_NAME"
- if eventName == 'AFFILIATE_INTERNET_NAME':
- evtType = 'MALICIOUS_AFFILIATE_INTERNET_NAME'
- if eventName == 'CO_HOSTED_SITE':
- evtType = 'MALICIOUS_COHOST'
-
- if eventName == 'NETBLOCK_OWNER':
- typeId = 'netblock'
- evtType = 'MALICIOUS_NETBLOCK'
- if eventName == 'NETBLOCK_MEMBER':
- typeId = 'netblock'
- evtType = 'MALICIOUS_SUBNET'
-
- url = self.lookupItem(cid, typeId, eventData)
- if self.checkForStop():
- return None
-
- # Notify other modules of what you've found
- if url is not None:
- text = check + " [" + eventData + "]\n" + "<SFURL>" + url + "</SFURL>"
- evt = SpiderFootEvent(evtType, text, self.__name__, event)
- self.notifyListeners(evt)
-
- return None
-
-# End of sfp_bitcash class
diff --git a/modules/sfp_gotcha.py b/modules/sfp_gotcha.py
deleted file mode 100644
index 81e747fd..00000000
--- a/modules/sfp_gotcha.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#-------------------------------------------------------------------------------
-# Name: sfp_gotcha
-# Purpose: Query gotcha.pw to see if an e-mail account has been hacked.
-#
-# Author: Steve Micallef <[email protected]>
-#
-# Created: 17/02/2018
-# Copyright: (c) Steve Micallef
-# Licence: GPL
-#-------------------------------------------------------------------------------
-
-import sys
-import json
-import time
-from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
-
-class sfp_gotcha(SpiderFootPlugin):
- """Gotcha.pw:Footprint,Investigate,Passive:Leaks, Dumps and Breaches::Check Gotcha.pw for hacked e-mail addresses identified."""
-
-
- # Default options
- opts = {
- }
-
- # Option descriptions
- optdescs = {
- }
-
- # Be sure to completely clear any class variables in setup()
- # or you run the risk of data persisting between scan runs.
-
- results = dict()
- errorState = False
-
- def setup(self, sfc, userOpts=dict()):
- self.sf = sfc
- self.results = dict()
- self.errorState = False
-
- # Clear / reset any other class member variables here
- # or you risk them persisting between threads.
-
- for opt in userOpts.keys():
- self.opts[opt] = userOpts[opt]
-
- # What events is this module interested in for input
- def watchedEvents(self):
- return ["EMAILADDR"]
-
- # What events this module produces
- def producedEvents(self):
- return ["EMAILADDR_COMPROMISED"]
-
- def query(self, qry):
- ret = None
- url = "https://gotcha.pw/search/" + qry
- retry = 0
-
- while retry < 2:
- res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
- useragent="SpiderFoot")
- if res['code'] == "200":
- break
- if res['code'] == "404":
- return None
- if res['code'] == "429":
- # Back off a little further
- time.sleep(2)
- retry += 1
-
- try:
- if "big-font text-danger font-weight-bold text-center\">Found" in res['content']:
- return True
- except Exception as e:
- self.sf.error("Error processing response from gotcha.pw: " + str(e), False)
- self.errorState = True
- return None
-
- # Handle events sent to this module
- def handleEvent(self, event):
- eventName = event.eventType
- srcModuleName = event.module
- eventData = event.data
-
- self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
-
- if self.errorState:
- self.sf.error("Gotcha.pw is having problems, so not processing any further events.", False)
- return None
-
- # Don't look up stuff twice
- if eventData in self.results:
- self.sf.debug("Skipping " + eventData + " as already mapped.")
- return None
- else:
- self.results[eventData] = True
-
- data = self.query(eventData)
- if not data:
- return None
- else:
- # Notify other modules of what you've found
- e = SpiderFootEvent("EMAILADDR_COMPROMISED", "Unknown breach",
- self.__name__, event)
- self.notifyListeners(e)
-
-# End of sfp_gotcha class
diff --git a/modules/sfp_pastie.py b/modules/sfp_pastie.py
deleted file mode 100644
index 7d3bca6f..00000000
--- a/modules/sfp_pastie.py
+++ /dev/null
@@ -1,126 +0,0 @@
-# -*- coding: utf-8 -*-
-# -------------------------------------------------------------------------------
-# Name: sfp_pastie
-# Purpose: Searches Google for Pastie.org content related to the domain in
-# question.
-#
-# Author: Steve Micallef <[email protected]> and ShellCodeNoobx
-#
-# Created: 20/03/2014
-# Copyright: (c) Steve Micallef 2014
-# Licence: GPL
-# -------------------------------------------------------------------------------
-
-import re
-from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
-
-
-class sfp_pastie(SpiderFootPlugin):
- """Pastie.org:Footprint,Investigate,Passive:Leaks, Dumps and Breaches:errorprone:Pastie.org scraping (via Google) to identify related content."""
-
-
- # Default options
- opts = {
- 'searchpages': 20 # Number of google results pages to iterate
- }
-
- # Option descriptions
- optdescs = {
- 'searchpages': "Number of search results pages to iterate through."
- }
-
- domains = {
- 'pastie': "pastie.org"
- }
-
- results = list()
-
- def setup(self, sfc, userOpts=dict()):
- self.sf = sfc
- self.results = list()
-
- for opt in userOpts.keys():
- self.opts[opt] = userOpts[opt]
-
- # What events is this module interested in for input
- def watchedEvents(self):
- return ["DOMAIN_NAME", "INTERNET_NAME", "EMAILADDR"]
-
- # What events this module produces
- # This is to support the end user in selecting modules based on events
- # produced.
- def producedEvents(self):
- return ["LEAKSITE_CONTENT", "LEAKSITE_URL"]
-
- def handleEvent(self, event):
- eventName = event.eventType
- srcModuleName = event.module
- eventData = event.data
-
- if eventData in self.results:
- return None
- else:
- self.results.append(eventData)
-
- for dom in self.domains.keys():
- links = list()
- target = self.domains[dom]
- pages = self.sf.googleIterate("site:" + target + "%20+\"" + eventData + "\"",
- dict(limit=self.opts['searchpages'],
- useragent=self.opts['_useragent'],
- timeout=self.opts['_fetchtimeout']))
-
- if pages is None:
- self.sf.info("No results returned from Google search of " + target + ".")
- return None
-
- for page in pages.keys():
- if page in self.results:
- continue
- else:
- self.results.append(page)
-
- # Check if we've been asked to stop
- if self.checkForStop():
- return None
-
- # Fetch the paste site content
- links += self.sf.parseLinks(page, pages[page], target)
-
- for link in links:
- if link in self.results:
- continue
- else:
- self.results.append(link)
-
- self.sf.debug("Found a link: " + link)
- if self.sf.urlBaseUrl(link).endswith(target):
- if self.checkForStop():
- return None
-
- res = self.sf.fetchUrl(link, timeout=self.opts['_fetchtimeout'],
- useragent=self.opts['_useragent'])
-
- if res['content'] is None:
- self.sf.debug("Ignoring " + link + " as no data returned")
- continue
-
- # Sometimes pastes search results false positives
- if re.search("[^a-zA-Z\-\_0-9]" + re.escape(eventData) +
- "[^a-zA-Z\-\_0-9]", res['content'], re.IGNORECASE) is None:
- continue
-
- try:
- startIndex = res['content'].index(eventData)
- except BaseException as e:
- self.sf.debug("String not found in pastes content.")
- continue
-
- evt1 = SpiderFootEvent("LEAKSITE_URL", link, self.__name__, event)
- self.notifyListeners(evt1)
-
- evt2 = SpiderFootEvent("LEAKSITE_CONTENT", res['content'], self.__name__, evt1)
- self.notifyListeners(evt2)
-
-
-# End of sfp_pastie class