mirror of
https://github.com/laramies/theHarvester.git
synced 2024-09-22 00:06:30 +08:00
commit
72e46af124
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
|
||||||
class SearchOtx:
|
class SearchOtx:
|
||||||
|
|
||||||
def __init__(self, word):
|
def __init__(self, word):
|
||||||
self.word = word
|
self.word = word
|
||||||
self.totalhosts = set()
|
self.totalhosts = set()
|
||||||
|
@ -14,10 +15,8 @@ async def do_search(self):
|
||||||
client = aiohttp.ClientSession(headers=headers, timeout=aiohttp.ClientTimeout(total=20))
|
client = aiohttp.ClientSession(headers=headers, timeout=aiohttp.ClientTimeout(total=20))
|
||||||
responses = await AsyncFetcher.fetch(client, url, json=True)
|
responses = await AsyncFetcher.fetch(client, url, json=True)
|
||||||
await client.close()
|
await client.close()
|
||||||
|
|
||||||
dct = responses
|
dct = responses
|
||||||
import pprint as p
|
|
||||||
# p.pprint(dct, indent=4)
|
|
||||||
# exit(-2)
|
|
||||||
self.totalhosts: set = {host['hostname'] for host in dct['passive_dns']}
|
self.totalhosts: set = {host['hostname'] for host in dct['passive_dns']}
|
||||||
# filter out ips that are just called NXDOMAIN
|
# filter out ips that are just called NXDOMAIN
|
||||||
self.totalips: set = {ip['address'] for ip in dct['passive_dns']
|
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):
|
async def process(self):
|
||||||
await self.do_search()
|
await self.do_search()
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
|
||||||
x = SearchOtx(word="yale.edu")
|
|
||||||
await x.do_search()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
asyncio.run(main())
|
|
||||||
|
|
Loading…
Reference in a new issue