From 900cac7ce0a76589f9962161d4c5362191ad9b23 Mon Sep 17 00:00:00 2001 From: NotoriousRebel Date: Sun, 29 Dec 2019 23:00:17 -0500 Subject: [PATCH] Updated otx module. --- theHarvester/discovery/otxsearch.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/theHarvester/discovery/otxsearch.py b/theHarvester/discovery/otxsearch.py index 4c2ac8f7..dd8aae30 100644 --- a/theHarvester/discovery/otxsearch.py +++ b/theHarvester/discovery/otxsearch.py @@ -3,6 +3,7 @@ class SearchOtx: + def __init__(self, word): self.word = word self.totalhosts = set() @@ -14,10 +15,8 @@ async def do_search(self): client = aiohttp.ClientSession(headers=headers, timeout=aiohttp.ClientTimeout(total=20)) responses = await AsyncFetcher.fetch(client, url, json=True) await client.close() + dct = responses - import pprint as p - # p.pprint(dct, indent=4) - # exit(-2) self.totalhosts: set = {host['hostname'] for host in dct['passive_dns']} # filter out ips that are just called NXDOMAIN self.totalips: set = {ip['address'] for ip in dct['passive_dns'] @@ -31,14 +30,3 @@ async def get_ips(self) -> set: async def process(self): await self.do_search() - - -async def main(): - x = SearchOtx(word="yale.edu") - await x.do_search() - - -if __name__ == '__main__': - import asyncio - - asyncio.run(main())