SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Handle bad certificate dates and other issues.
Steve5ddae0e29591
diff --git a/modules/sfp_sslcert.py b/modules/sfp_sslcert.pyindex 0111c917..c61218bf 100644--- a/modules/sfp_sslcert.py+++ b/modules/sfp_sslcert.py@@ -151,10 +151,14 @@ class sfp_sslcert(SpiderFootPlugin):# Check if the expiration date is in the futuredef checkExpiry(self, cert, sevt):- exp = int(time.mktime(cert.get_not_after().get_datetime().timetuple()))- expstr = cert.get_not_after().get_datetime().strftime("%Y-%m-%d %H:%M:%S")- now = int(time.time())- warnexp = now + self.opts['certexpiringdays'] * 86400+ try:+ exp = int(time.mktime(cert.get_not_after().get_datetime().timetuple()))+ expstr = cert.get_not_after().get_datetime().strftime("%Y-%m-%d %H:%M:%S")+ now = int(time.time())+ warnexp = now + self.opts['certexpiringdays'] * 86400+ except ValueError as e:+ self.sf.error("Couldn't process date in certificate.", False)+ return Noneif exp <= now:evt = SpiderFootEvent("SSL_CERTIFICATE_EXPIRED", expstr, self.__name__, sevt)