diff --git a/theHarvester/__main__.py b/theHarvester/__main__.py index 7680030e..71629ae2 100644 --- a/theHarvester/__main__.py +++ b/theHarvester/__main__.py @@ -489,11 +489,11 @@ async def handler(lst): analyzed_ranges.append(ip_range) else: continue - for entries in res: - if entries.count(word): - dnsrev.append(entries) - if entries not in full: - full.append(entries) + for entry in res: + if word in entry: + dnsrev.append(entry) + if entry not in full: + full.append(entry) print('[*] Hosts found after reverse lookup (in target domain):') print('--------------------------------------------------------') for xh in dnsrev: diff --git a/theHarvester/discovery/dnssearch.py b/theHarvester/discovery/dnssearch.py index 37deccff..545ac62a 100644 --- a/theHarvester/discovery/dnssearch.py +++ b/theHarvester/discovery/dnssearch.py @@ -64,7 +64,7 @@ def run(self, ip): ptr_record_answer = dns.resolver.query(dns_record_from_ip_answer, 'PTR') a_record_answer = dns.resolver.query(ptr_record_answer[0].to_text(), 'A') print(a_record_answer.canonical_name) - return a_record_answer.canonical_name + return str(a_record_answer.canonical_name) except Exception: pass @@ -76,4 +76,4 @@ def process(self): if host is not None: # print(' : ' + host.split(':')[1]) results.append(host) - return results \ No newline at end of file + return results