Created
September 15, 2014 07:12
-
-
Save rinti/93d88878c5243e3c32b3 to your computer and use it in GitHub Desktop.
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
""" | |
Check all possible permutations with a given length. | |
Dependencies: python-whois | |
Usage: | |
./domains.py <length> <timeout> <tld> | |
* Length: How many characters the domain name should be | |
* Timeout: How fast between checkups to whois (recommended: 2, to not get throttled) | |
* tld: tld. | |
""" | |
import whois | |
import itertools | |
import time | |
import sys | |
permutations = list(itertools.product(list("abcdefghijklmnopqrstuwxyz"), repeat=int(sys.argv[1]))) | |
available = [] | |
for p in permutations: | |
domain = "".join(p) + str(sys.argv[3]) | |
w = whois.whois(domain) | |
if not w.registrar: | |
available.append(domain) | |
print available | |
else: | |
print "Not available", domain, w.registrar | |
time.sleep(float(sys.argv[2])) | |
print available |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment