From 3f07e22a735af9ed247beafcfe97d91a3073f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 5 Nov 2024 10:15:42 +0100 Subject: [PATCH] fix: exception in MISP module when a domain cannot be resolved --- lookyloo/modules/misp.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lookyloo/modules/misp.py b/lookyloo/modules/misp.py index 47242189..d97c7ef4 100644 --- a/lookyloo/modules/misp.py +++ b/lookyloo/modules/misp.py @@ -257,10 +257,11 @@ class MISP(AbstractModule): tld = self.psl.publicsuffix(hostnode.name) domain = re.sub(f'.{tld}$', '', hostnode.name).split('.')[-1] to_lookup = [node.name, hostnode.name, f'{domain}.{tld}'] - if 'v4' in hostnode.resolved_ips: - to_lookup += hostnode.resolved_ips['v4'] - if 'v6' in hostnode.resolved_ips: - to_lookup += hostnode.resolved_ips['v6'] + if hasattr(hostnode, 'resolved_ips'): + if 'v4' in hostnode.resolved_ips: + to_lookup += hostnode.resolved_ips['v4'] + if 'v6' in hostnode.resolved_ips: + to_lookup += hostnode.resolved_ips['v6'] if hasattr(hostnode, 'cnames'): to_lookup += hostnode.cnames if not node.empty_response: