From 5c9dd1eda02565e082bcd84c243c59e4a5877718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 8 Jan 2024 16:35:59 +0100 Subject: [PATCH] fix: Avoid exception when IPs are empty lists --- lookyloo/lookyloo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 2b476ab2..d5c6e7e0 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -699,7 +699,7 @@ class Lookyloo(): 'asns': {}, # ASN: [list of contacts from whois] 'all_emails': set() } - to_return['ips'] = {ip: self.uwhois.whois(ip, contact_email_only=True) for ip in hostnode.resolved_ips['v4'] | hostnode.resolved_ips['v6']} + to_return['ips'] = {ip: self.uwhois.whois(ip, contact_email_only=True) for ip in set(hostnode.resolved_ips['v4']) | set(hostnode.resolved_ips['v6'])} to_return['asns'] = {asn['asn']: self.uwhois.whois(f'AS{asn["asn"]}', contact_email_only=True) for asn in hostnode.ipasn.values()} # try to get contact from security.txt file