Created
December 18, 2017 08:55
-
-
Save p3t3r67x0/008f50c839466abdc303f04c21806d31 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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