From 6e24941294f681631a631b4ada957294fabb4e0d Mon Sep 17 00:00:00 2001 From: Jay Townsend Date: Wed, 25 Sep 2019 21:22:43 +0100 Subject: [PATCH] fix build --- theHarvester/__main__.py | 4 +--- theHarvester/discovery/otxsearch.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index f86edce3..cbc255de 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -434,10 +434,8 @@ def start(): else: print('\n[*] IPs found: ' + str(len(all_ip))) print('-------------------') - # ips = sorted(ipaddress.ip_address(line.strip()) for line in set(all_ip)) - # print('\n'.join(map(str, ips))) - ip_list = sorted([netaddr.IPAddress(ip.strip()) for ip in set(all_ip)]) # use netaddr as the list may contain ipv4 and ipv6 addresses + ip_list = sorted([netaddr.IPAddress(ip.strip()) for ip in set(all_ip)]) print('\n'.join(map(str, ip_list))) if len(all_emails) == 0: diff --git a/theHarvester/discovery/otxsearch.py b/theHarvester/discovery/otxsearch.py index 7d0da415..44b5c781 100644 --- a/theHarvester/discovery/otxsearch.py +++ b/theHarvester/discovery/otxsearch.py @@ -25,12 +25,12 @@ def do_search(self): self.totalresults += self.results dct = json.loads(self.totalresults) self.totalhosts: set = {host['hostname'] for host in dct['passive_dns']} - self.totalips: set = {ip['address'] for ip in dct['passive_dns'] if 'NXDOMAIN' not in ip['address']} # filter out ips that are just called NXDOMAIN + self.totalips: set = {ip['address'] for ip in dct['passive_dns'] if 'NXDOMAIN' not in ip['address']} def get_hostnames(self) -> set: return self.totalhosts - + def get_ips(self) -> set: return self.totalips