SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Removed badips.com and Watchguard modules since they appear to be dead.
smicallefcf304b8f42f7
diff --git a/README.md b/README.mdindex 7a809e58..dd0ec48a 100644--- a/README.md+++ b/README.md@@ -138,7 +138,6 @@ Archive.org|Identifies historic versions of interesting files/pages from the WayARIN|Queries ARIN registry for contact information.|[https://www.arin.net/](https://www.arin.net/)|Free APIAzure Blob Finder|Search for potential Azure blobs associated with the target and attempt to list their contents.|[https://azure.microsoft.com/en-in/services/storage/blobs/](https://azure.microsoft.com/en-in/services/storage/blobs/)|Free APIBad Packets|Obtain information about any malicious activities involving IP addresses found|[https://badpackets.net](https://badpackets.net)|Commercial API-badips.com|Check if an IP address is malicious according to BadIPs.com.|[https://www.badips.com/](https://www.badips.com/)|Free APIBambenek C&C List|Check if a host/domain or IP appears on Bambenek Consulting's C&C tracker lists.|[http://www.bambenekconsulting.com/](http://www.bambenekconsulting.com/)|Free APIBase64 Decoder|Identify Base64-encoded strings in URLs, often revealing interesting hidden information.|N/A|InternalBGPView|Obtain network information from BGPView API.|[https://bgpview.io/](https://bgpview.io/)|Free API@@ -328,7 +327,6 @@ ViewDNS.info|Reverse Whois lookups using ViewDNS.info.|[https://viewdns.info/](hVirusTotal|Obtain information from VirusTotal about identified IP addresses.|[https://www.virustotal.com/](https://www.virustotal.com/)|Tiered APIVoIPBL OpenPBX IPs|Check if an IP or netblock is an open PBX according to VoIPBL OpenPBX IPs.|[http://www.voipbl.org/](http://www.voipbl.org/)|Free APIVXVault.net|Check if a domain or IP is malicious according to VXVault.net.|[http://vxvault.net/](http://vxvault.net/)|Free API-Watchguard|Check if an IP is malicious according to Watchguard's reputationauthority.org.|[http://reputationauthority.org/](http://reputationauthority.org/)|Free APIWeb Analytics Extractor|Identify web analytics IDs in scraped webpages and DNS TXT records.|N/A|InternalWeb Framework Identifier|Identify the usage of popular web frameworks like jQuery, YUI and others.|N/A|InternalWeb Server Identifier|Obtain web server banners to identify versions of web servers being used.|N/A|Internaldiff --git a/modules/sfp_badipscom.py b/modules/sfp_badipscom.pydeleted file mode 100644index 24e6fec7..00000000--- a/modules/sfp_badipscom.py+++ /dev/null@@ -1,138 +0,0 @@-# -*- coding: utf-8 -*--# --------------------------------------------------------------------------------# Name: sfp_badipscom-# Purpose: Checks if an IP address is malicious according to BadIPs.com.-#-# Author: [email protected]-#-# Created: 14/12/2013-# Copyright: (c) Steve Micallef, 2013-# Licence: GPL-# ---------------------------------------------------------------------------------from spiderfoot import SpiderFootEvent, SpiderFootPlugin---class sfp_badipscom(SpiderFootPlugin):-- meta = {- 'name': "badips.com",- 'summary': "Check if an IP address is malicious according to BadIPs.com.",- 'flags': [""],- 'useCases': ["Investigate", "Passive"],- 'categories': ["Reputation Systems"],- 'dataSource': {- 'website': "https://www.badips.com/",- 'model': "FREE_NOAUTH_UNLIMITED",- 'references': [- "https://www.badips.com/documentation",- "https://www.badips.com/info"- ],- 'favIcon': "https://www.google.com/s2/favicons?domain=https://www.badips.com/",- 'logo': "https://www.badips.com/img/badips.com-lm.png",- 'description': "badips.com is a community based IP blacklist service. "- "You can report malicious IPs and you can download blacklists or query our API to find out if a IP is listed. "- "We're also offering some eye-candy: Get personalized stats and graphs of attackers trying to brute-force your systems, "- "see where the bad guys come from and share your knowledge!",- }- }-- # Default options- opts = {- 'checkaffiliates': True,- 'cacheperiod': 18- }-- # Option descriptions- optdescs = {- 'checkaffiliates': "Apply checks to affiliate IP addresses?",- 'cacheperiod': "Hours to cache list data before re-fetching."- }-- results = None- errorState = False-- def setup(self, sfc, userOpts=dict()):- self.sf = sfc- self.results = self.tempStorage()- self.errorState = False-- for opt in list(userOpts.keys()):- self.opts[opt] = userOpts[opt]-- # What events is this module interested in for input- def watchedEvents(self):- return ["IP_ADDRESS", "AFFILIATE_IPADDR"]-- # What events this module produces- def producedEvents(self):- return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR"]-- def query(self, qry):- cid = "_badips"- url = "https://www.badips.com/get/list/any/1?age=24h"-- data = dict()- 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["code"] != "200":- self.sf.error("Unable to fetch %s" % url)- self.errorState = True- return None-- if data["content"] is None:- self.sf.error("Unable to fetch %s" % url)- self.errorState = True- return None-- self.sf.cachePut("sfmal_" + cid, data['content'])-- for line in data["content"].split('\n'):- if qry.lower() == line.lower():- self.sf.debug("%s found in BadIPS.com IP Reputation List." % (qry))- return url-- return None-- # Handle events sent to this module- def handleEvent(self, event):- eventName = event.eventType- srcModuleName = event.module- eventData = event.data-- self.sf.debug(f"Received event, {eventName}, from {srcModuleName}")-- if eventData in self.results:- self.sf.debug(f"Skipping {eventData}, already checked.")- return-- if self.errorState:- return-- if eventName not in ['IP_ADDRESS', 'AFFILIATE_IPADDR']:- return-- self.results[eventData] = True-- evtType = 'MALICIOUS_IPADDR'-- if eventName == 'AFFILIATE_IPADDR':- if not self.opts.get('checkaffiliates', False):- return- evtType = 'MALICIOUS_AFFILIATE_IPADDR'-- self.sf.debug("Checking maliciousness of IP address %s with BadIPs.com" % eventData)-- url = self.query(eventData)-- if not url:- return-- text = "BadIPs.com IP Reputation List [%s]\n<SFURL>%s</SFURL>" % (eventData, url)- evt = SpiderFootEvent(evtType, text, self.__name__, event)- self.notifyListeners(evt)--# End of sfp_badipscom classdiff --git a/modules/sfp_watchguard.py b/modules/sfp_watchguard.pydeleted file mode 100644index f3e665c5..00000000--- a/modules/sfp_watchguard.py+++ /dev/null@@ -1,200 +0,0 @@-# -*- coding: utf-8 -*--# --------------------------------------------------------------------------------# Name: sfp_watchguard-# Purpose: Checks if an ASN, IP or domain is malicious.-#-# Author: [email protected]-#-# Created: 14/12/2013-# Copyright: (c) Steve Micallef, 2013-# Licence: GPL-# ---------------------------------------------------------------------------------import re--from spiderfoot import SpiderFootEvent, SpiderFootPlugin--malchecks = {- 'Watchguard Reputation Authority Lookup': {- 'id': '_watchguard',- 'checks': ['ip'],- 'url': 'http://reputationauthority.org/lookup?ip={0}',- 'badregex': ['.*>[6-9][0-9]/100 </td>.*', '.*>100/100 </td>.*'],- 'goodregex': []- }-}---class sfp_watchguard(SpiderFootPlugin):-- meta = {- 'name': "Watchguard",- 'summary': "Check if an IP is malicious according to Watchguard's reputationauthority.org.",- 'flags': [""],- 'useCases': ["Investigate", "Passive"],- 'categories': ["Reputation Systems"],- 'dataSource': {- 'website': "http://reputationauthority.org/",- 'model': "FREE_NOAUTH_UNLIMITED",- 'references': [- "http://www.reputationauthority.org/faq.php"- ],- 'favIcon': "http://reputationauthority.org/images/favicon.ico",- 'logo': "http://reputationauthority.org/images/ripley/footer_logo.gif",- 'description': "WatchGuard ReputationAuthority is the world's most effective reputation service for email and web security, "- "providing critical protection and a better performing network to businesses, government organizations, "- "ISPs, and other security vendors.",- }- }-- # Default options- opts = {- 'checkaffiliates': True- }-- # Option descriptions- optdescs = {- 'checkaffiliates': "Apply checks to affiliates?"- }-- # Be sure to completely clear any class variables in setup()- # or you run the risk of data persisting between scan runs.-- results = None-- def setup(self, sfc, userOpts=dict()):- self.sf = sfc- self.results = self.tempStorage()-- # Clear / reset any other class member variables here- # or you risk them persisting between threads.-- for opt in list(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(f"Querying {id} for maliciousness of {target}")-- for check in list(malchecks.keys()):- cid = malchecks[check]['id']- if id == cid:- 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))- return None-- if self.contentMalicious(res['content'], malchecks[check]['goodregex'], malchecks[check]['badregex']):- return url.format(target)-- 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(f"Checking maliciousness of {target} ({itemType}) with: {cid}")- return self.resourceQuery(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(f"Received event, {eventName}, from {srcModuleName}")-- if eventData in self.results:- self.sf.debug(f"Skipping {eventData}, already checked.")- return-- self.results[eventData] = True-- if eventName == 'CO_HOSTED_SITE' and not self.opts.get('checkcohosts', False):- return- if eventName == 'AFFILIATE_IPADDR' \- and not self.opts.get('checkaffiliates', False):- return- if eventName == 'NETBLOCK_OWNER' and not self.opts.get('checknetblocks', False):- return- if eventName == 'NETBLOCK_MEMBER' and not self.opts.get('checksubnets', False):- return-- for check in list(malchecks.keys()):- cid = malchecks[check]['id']-- 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-- # Notify other modules of what you've found- if url is not None:- text = f"{check} [{eventData}]\n<SFURL>{url}</SFURL>"- evt = SpiderFootEvent(evtType, text, self.__name__, event)- self.notifyListeners(evt)--# End of sfp_watchguard classdiff --git a/test/unit/modules/test_sfp_badipscom.py b/test/unit/modules/test_sfp_badipscom.pydeleted file mode 100644index ad71ec46..00000000--- a/test/unit/modules/test_sfp_badipscom.py+++ /dev/null@@ -1,59 +0,0 @@-# test_sfp_badipscom.py-import pytest-import unittest--from modules.sfp_badipscom import sfp_badipscom-from sflib import SpiderFoot-from spiderfoot import SpiderFootEvent, SpiderFootTarget---class TestModulebadipscom(unittest.TestCase):- """- Test modules.sfp_badipscom- """-- def test_opts(self):- module = sfp_badipscom()- self.assertEqual(len(module.opts), len(module.optdescs))-- def test_setup(self):- """- Test setup(self, sfc, userOpts=dict())- """- sf = SpiderFoot(self.default_options)-- module = sfp_badipscom()- module.setup(sf, dict())-- def test_watchedEvents_should_return_list(self):- module = sfp_badipscom()- self.assertIsInstance(module.watchedEvents(), list)-- def test_producedEvents_should_return_list(self):- module = sfp_badipscom()- self.assertIsInstance(module.producedEvents(), list)-- def test_handleEvent(self):- """- Test handleEvent(self, event)- """- sf = SpiderFoot(self.default_options)-- module = sfp_badipscom()- module.setup(sf, dict())-- target_value = 'example target value'- target_type = 'IP_ADDRESS'- target = SpiderFootTarget(target_value, target_type)- module.setTarget(target)-- event_type = 'ROOT'- event_data = 'example data'- event_module = ''- source_event = ''- evt = SpiderFootEvent(event_type, event_data, event_module, source_event)-- result = module.handleEvent(evt)-- self.assertIsNone(result)diff --git a/test/unit/modules/test_sfp_watchguard.py b/test/unit/modules/test_sfp_watchguard.pydeleted file mode 100644index ab7ece0e..00000000--- a/test/unit/modules/test_sfp_watchguard.py+++ /dev/null@@ -1,60 +0,0 @@-# test_sfp_watchguard.py-import pytest-import unittest--from modules.sfp_watchguard import sfp_watchguard-from sflib import SpiderFoot-from spiderfoot import SpiderFootEvent, SpiderFootTarget---class TestModulewatchguard(unittest.TestCase):- """- Test modules.sfp_watchguard- """-- def test_opts(self):- module = sfp_watchguard()- self.assertEqual(len(module.opts), len(module.optdescs))-- def test_setup(self):- """- Test setup(self, sfc, userOpts=dict())- """- sf = SpiderFoot(self.default_options)-- module = sfp_watchguard()- module.setup(sf, dict())-- def test_watchedEvents_should_return_list(self):- module = sfp_watchguard()- self.assertIsInstance(module.watchedEvents(), list)-- def test_producedEvents_should_return_list(self):- module = sfp_watchguard()- self.assertIsInstance(module.producedEvents(), list)-- @unittest.skip("todo")- def test_handleEvent(self):- """- Test handleEvent(self, event)- """- sf = SpiderFoot(self.default_options)-- module = sfp_watchguard()- module.setup(sf, dict())-- target_value = 'example target value'- target_type = 'IP_ADDRESS'- target = SpiderFootTarget(target_value, target_type)- module.setTarget(target)-- event_type = 'ROOT'- event_data = 'example data'- event_module = ''- source_event = ''- evt = SpiderFootEvent(event_type, event_data, event_module, source_event)-- result = module.handleEvent(evt)-- self.assertIsNone(result)