Skip to content

Instantly share code, notes, and snippets.

@bandrel
Created August 24, 2017 21:02
Show Gist options
  • Save bandrel/d0169b51616241608328da58318c44db to your computer and use it in GitHub Desktop.
Save bandrel/d0169b51616241608328da58318c44db to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import requests
import sys
import re
domain = sys.argv[1]
r = requests.get('https://crt.sh/?q=%.'+domain)
hostnames = re.findall(r'<TD>(\S+\.'+domain+r')',r.text)
uniq_hostnames = set(hostnames)
for host in uniq_hostnames:
print(host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment