SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Bug fixes
smicallef0d357b42250c
diff --git a/modules/sfp_crt.py b/modules/sfp_crt.pyindex b5a31b11..efc4d5c7 100644--- a/modules/sfp_crt.py+++ b/modules/sfp_crt.py@@ -12,7 +12,7 @@# -------------------------------------------------------------------------------import json-import urllib.request, urllib.parse, urllib.error+import urllib.parsefrom sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent@@ -68,7 +68,7 @@ class sfp_crt(SpiderFootPlugin):}res = self.sf.fetchUrl('https://crt.sh/?' + urllib.parse.urlencode(params),- timeout=15,+ timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])if res['content'] is None:@@ -91,15 +91,19 @@ class sfp_crt(SpiderFootPlugin):domains = list()for cert_info in data:- cert_id = cert_info.get('min_cert_id')+ cert_id = cert_info.get('id')if cert_id:cert_ids.append(cert_id)domain = cert_info.get('name_value')-- if domain and domain != eventData:- domains.append(domain.replace("*.", ""))+ if '\n' in domain:+ doms = domain.split("\n")+ for d in doms:+ domains.append(d.replace("*.", ""))+ else:+ if domain and domain != eventData:+ domains.append(domain.replace("*.", ""))if self.opts['verify'] and len(domains) > 0:self.sf.info("Resolving " + str(len(set(domains))) + " domains ...")@@ -137,7 +141,7 @@ class sfp_crt(SpiderFootPlugin):}res = self.sf.fetchUrl('https://crt.sh/?' + urllib.parse.urlencode(params),- timeout=15,+ timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])try:diff --git a/modules/sfp_names.py b/modules/sfp_names.pyindex a72c7621..76894b40 100644--- a/modules/sfp_names.py+++ b/modules/sfp_names.py@@ -69,9 +69,10 @@ class sfp_names(SpiderFootPlugin):# or CSS, in which case optionally ignore it.if eventName == "TARGET_WEB_CONTENT":url = event.actualSource- if self.opts['filterjscss'] and (".js" in url or ".css" in url):- self.sf.debug("Ignoring web content from CSS/JS.")- return None+ if url is not None:+ if self.opts['filterjscss'] and (".js" in url or ".css" in url):+ self.sf.debug("Ignoring web content from CSS/JS.")+ return Noneif eventName == "EMAILADDR" and self.opts['emailtoname']:if "." in eventData.split("@")[0]:diff --git a/modules/sfp_pgp.py b/modules/sfp_pgp.pyindex c6237561..ec62c6cd 100644--- a/modules/sfp_pgp.py+++ b/modules/sfp_pgp.py@@ -13,10 +13,8 @@# -------------------------------------------------------------------------------import re-from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent-class sfp_pgp(SpiderFootPlugin):"""PGP Key Look-up:Footprint,Investigate,Passive:Public Registries::Look up e-mail addresses in PGP public key servers."""@@ -76,12 +74,12 @@ class sfp_pgp(SpiderFootPlugin):timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])- if res['content'] is None:+ if res['content'] is None or res['code'] == "503":res = self.sf.fetchUrl(self.opts['keyserver_search2'] + eventData,timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])- if res['content'] is not None:+ if res['content'] is not None and res['code'] != "503":emails = self.sf.parseEmails(res['content'])for email in emails:evttype = "EMAILADDR"@@ -99,12 +97,12 @@ class sfp_pgp(SpiderFootPlugin):timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])- if res['content'] is None:+ if res['content'] is None or res['code'] == "503":res = self.sf.fetchUrl(self.opts['keyserver_fetch2'] + eventData,timeout=self.opts['_fetchtimeout'],useragent=self.opts['_useragent'])- if res['content'] is not None:+ if res['content'] is not None and res['code'] != "503":pat = re.compile("(-----BEGIN.*END.*BLOCK-----)", re.MULTILINE | re.DOTALL)matches = re.findall(pat, res['content'])for match in matches:diff --git a/modules/sfp_sslcert.py b/modules/sfp_sslcert.pyindex 276c2924..4ada7bcf 100644--- a/modules/sfp_sslcert.py+++ b/modules/sfp_sslcert.py@@ -77,12 +77,16 @@ class sfp_sslcert(SpiderFootPlugin):if not eventData.lower().startswith("https://") and not self.opts['tryhttp']:return None- # Handle URLs containing port numbers- u = urlparse(eventData)- port = 443- if u.port:- port = u.port- fqdn = self.sf.urlFQDN(eventData.lower())+ try:+ # Handle URLs containing port numbers+ u = urlparse(eventData)+ port = 443+ if u.port:+ port = u.port+ fqdn = self.sf.urlFQDN(eventData.lower())+ except BaseException as e:+ self.sf.debug("Couldn't parse URL: " + eventData)+ return Noneelse:fqdn = eventDataport = 443diff --git a/modules/sfp_ssltools.py b/modules/sfp_ssltools.pyindex 8a09231e..69477f03 100644--- a/modules/sfp_ssltools.py+++ b/modules/sfp_ssltools.py@@ -173,7 +173,7 @@ class sfp_ssltools(SpiderFootPlugin):return Noneif not cert.get('text'):- self.sf.info("Failed to parse the SSL cert for " + fqdn)+ self.sf.info("Failed to parse the SSL cert for " + eventData)return Noneevt = SpiderFootEvent('SSL_CERTIFICATE_RAW', cert['text'], self.__name__, event)diff --git a/modules/sfp_wikipediaedits.py b/modules/sfp_wikipediaedits.pyindex a945d717..d10db883 100644--- a/modules/sfp_wikipediaedits.py+++ b/modules/sfp_wikipediaedits.py@@ -12,7 +12,6 @@import datetimeimport re-from html.parser import HTMLParserfrom sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent@@ -69,6 +68,9 @@ class sfp_wikipediaedits(SpiderFootPlugin):links = list()try:parser = HTMLParser()+ if not res['content']:+ return None+for line in res['content'].split("\n"):matches = re.findall("<link>(.*?)</link>", line, re.IGNORECASE)for m in matches:diff --git a/requirements.txt b/requirements.txtindex 51951ad8..2dd6e438 100644--- a/requirements.txt+++ b/requirements.txt@@ -21,3 +21,4 @@ pyOpenSSL>=16.2.0python-docx>=0.8.10python-pptx>=0.6.18networkx==2.3+cryptography>=2.5diff --git a/sflib.py b/sflib.pyindex 4423e954..8f2839b1 100644--- a/sflib.py+++ b/sflib.py@@ -776,10 +776,14 @@ class SpiderFoot:# Simple way to verify IPv4 addresses.def validIP(self, address):+ if not address:+ return Falsereturn netaddr.valid_ipv4(address)# Simple way to verify IPv6 addresses.def validIP6(self, address):+ if not address:+ return Falsereturn netaddr.valid_ipv6(address)# Simple way to verify netblock.