Merge pull request #87 from NotoriousRebel/master

Updated how domains are printed and stored.
This commit is contained in:
J.Townsend 2020-02-17 18:16:45 +00:00 committed by GitHub
commit 5f816485ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -425,12 +425,11 @@ async def handler(lst):
print('\n[*] Hosts found: ' + str(len(all_hosts))) print('\n[*] Hosts found: ' + str(len(all_hosts)))
print('---------------------') print('---------------------')
all_hosts = sorted(list(set(all_hosts))) all_hosts = sorted(list(set(all_hosts)))
"""full_host = hostchecker.Checker(all_hosts)
full, ips = await full_host.check()"""
db = stash.StashManager() db = stash.StashManager()
full = [host if ':' in host and word in host else word in host.split(':')[0] and host for host in full]
full = [host for host in full if host]
full.sort(key=lambda el: el.split(':')[0]) full.sort(key=lambda el: el.split(':')[0])
for host in full: for host in full:
host = str(host)
print(host) print(host)
host_ip = [netaddr_ip.format() for netaddr_ip in sorted([netaddr.IPAddress(ip) for ip in ips])] host_ip = [netaddr_ip.format() for netaddr_ip in sorted([netaddr.IPAddress(ip) for ip in ips])]
await db.store_all(word, host_ip, 'ip', 'DNS-resolver') await db.store_all(word, host_ip, 'ip', 'DNS-resolver')

View file

@ -28,7 +28,7 @@ async def query(host, resolver) -> Tuple[str, Any]:
else: else:
return f"{host}:{', '.join(map(str, addresses))}", addresses return f"{host}:{', '.join(map(str, addresses))}", addresses
except Exception: except Exception:
return f"{host}:", tuple() return f"{host}", tuple()
async def query_all(self, resolver) -> list: async def query_all(self, resolver) -> list:
results = await asyncio.gather(*[asyncio.create_task(self.query(host, resolver)) results = await asyncio.gather(*[asyncio.create_task(self.query(host, resolver))