SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Fix SSL processing errors.
smicallef63fed4d982b4
diff --git a/modules/sfp_dnsresolve.py b/modules/sfp_dnsresolve.pyindex 67cc8af8..572f72b5 100644--- a/modules/sfp_dnsresolve.py+++ b/modules/sfp_dnsresolve.py@@ -126,11 +126,19 @@ class sfp_dnsresolve(SpiderFootPlugin):# Simply translates these to their domainsif eventName in ["CO_HOSTED_SITE", "AFFILIATE_INTERNET_NAME"]:+ # If the co-host or affiliate is a domain name, generate+ # a domain event.+ if self.sf.isDomain(eventData, self.opts['_internettlds']):+ if "AFFILIATE_" in eventName:+ ev = "AFFILIATE_DOMAIN_NAME"+ else:+ ev = "CO_HOSTED_SITE_DOMAIN"+ evt = SpiderFootEvent(ev, eventData, self.__name__, parentEvent)+ self.notifyListeners(evt)+dom = self.sf.hostDomain(eventData, self.opts['_internettlds'])- if "AFFILIATE_" in eventName:- ev = "AFFILIATE_DOMAIN_NAME"- else:- ev = "CO_HOSTED_SITE_DOMAIN"+ if dom == eventData:+ return Noneevt = SpiderFootEvent(ev, dom, self.__name__, parentEvent)self.notifyListeners(evt)return None@@ -320,6 +328,8 @@ class sfp_dnsresolve(SpiderFootPlugin):if htype == "AFFILIATE_INTERNET_NAME":dom = self.sf.hostDomain(host, self.opts['_internettlds'])+ if dom == host and not self.sf.isDomain(dom, self.opts['_internettlds']):+ return evtself.processDomain(dom, evt, True)return evtdiff --git a/sflib.py b/sflib.pyindex f6a3b3c9..c781d4a9 100644--- a/sflib.py+++ b/sflib.py@@ -1106,7 +1106,7 @@ class SpiderFoot:ext = cert.extensions.get_extension_for_class(cryptography.x509.SubjectAlternativeName)for x in ext.value:if isinstance(x, cryptography.x509.DNSName):- ret['altnames'].append(x.value.lower().encode('raw_unicode_escape'))+ ret['altnames'].append(x.value.lower().encode('raw_unicode_escape').decode("ascii", errors='replace'))except BaseException as e:self.debug("Problem processing certificate: " + str(e))pass@@ -1119,7 +1119,7 @@ class SpiderFoot:name = attrs[0].value.lower()# CN often duplicates one of the SANs, don't add it thenif name not in ret['altnames']:- certhosts.append(name.encode('raw_unicode_escape'))+ certhosts.append(name)except BaseException as e:self.debug("Problem processing certificate: " + str(e))pass@@ -1135,7 +1135,7 @@ class SpiderFoot:# Extract subject alternative namesfor host in ret['altnames']:- certhosts.append(host.decode("ascii", errors='replace').replace("dns:", ""))+ certhosts.append(host.replace("dns:", ""))ret['hosts'] = certhosts