Skip to content

Instantly share code, notes, and snippets.

@p3t3r67x0
Created December 18, 2017 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p3t3r67x0/008f50c839466abdc303f04c21806d31 to your computer and use it in GitHub Desktop.
Save p3t3r67x0/008f50c839466abdc303f04c21806d31 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import socket
def load_document(filename):
with open(filename, 'rb') as f:
return f.readlines()
def get_ip(subdomain, domainname):
try:
ip = socket.gethostbyname('{}.{}'.format(subdomain, domainname))
print u'{}.{}: {}'.format(subdomain, domainname, ip)
except socket.gaierror as e:
pass
def main():
lines = load_document('subdomains_wordlist.txt')
domainname = sys.argv[1]
for i in lines:
get_ip(i.strip(), domainname)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment