Last active
September 16, 2021 14:49
-
-
Save JoyGhoshs/1bf2a31634e8ccf355dcac46eff332e4 to your computer and use it in GitHub Desktop.
Collect Subdomains From Three different source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
import json | |
import sys | |
import os | |
execute=os.system | |
__Author__="Joy Ghosh [System00 Security]" | |
def passive(domain): | |
bufferoverrun=requests.get(f'https://dns.bufferover.run/dns?q={domain}').json() | |
buff_dump=json.dumps(bufferoverrun) | |
buff_load=json.loads(buff_dump) | |
for subs in buff_load['FDNS_A']: | |
ip,urls=subs.split(',') | |
print(urls) | |
for subs in buff_load['RDNS']: | |
ip,urls=subs.split(',') | |
print(urls) | |
hackertarget=requests.get(f'https://api.hackertarget.com/hostsearch/?q={domain}').text | |
hostnames = [result.split(",")[0]for result in hackertarget.split("\n")] | |
for hostname in hostnames: | |
print(hostname) | |
threatcrowd=requests.get(f'https://www.threatcrowd.org/searchApi/v2/domain/report/?domain={domain}').json() | |
threatcrowd_dumps=json.dumps(threatcrowd) | |
threatcrowd_loads=json.loads(threatcrowd_dumps) | |
for subs in threatcrowd_loads['subdomains']: | |
print(subs) | |
passive('target.com') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment