From 39c0e74dd24ac95307698bbfc764dfaa3fff980b Mon Sep 17 00:00:00 2001 From: Daniel Sagi Date: Fri, 21 Aug 2020 06:15:39 -0700 Subject: [PATCH] striping was incorrect due to multiple newlines in certificate returned from ssl.get_server_certificate --- kube_hunter/modules/hunting/certificates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kube_hunter/modules/hunting/certificates.py b/kube_hunter/modules/hunting/certificates.py index 8857ccd..9b8b87b 100644 --- a/kube_hunter/modules/hunting/certificates.py +++ b/kube_hunter/modules/hunting/certificates.py @@ -42,7 +42,7 @@ class CertificateDiscovery(Hunter): self.examine_certificate(cert) def examine_certificate(self, cert): - c = cert.strip(ssl.PEM_HEADER).strip(ssl.PEM_FOOTER) + c = cert.strip(ssl.PEM_HEADER).strip('\n').strip(ssl.PEM_FOOTER).strip('\n') certdata = base64.b64decode(c) emails = re.findall(email_pattern, certdata) for email in emails: