Skip to content

Instantly share code, notes, and snippets.

@JoyGhoshs
Last active September 16, 2021 14:49
Show Gist options
  • Save JoyGhoshs/1bf2a31634e8ccf355dcac46eff332e4 to your computer and use it in GitHub Desktop.
Save JoyGhoshs/1bf2a31634e8ccf355dcac46eff332e4 to your computer and use it in GitHub Desktop.
Collect Subdomains From Three different source
#!/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