Created
September 30, 2018 21:55
-
-
Save davidtavarez/10153cfab5a15608e9c6353e1ca4223c 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 | |
"""Generate a dictionary for mobile WiFi router of Altice Dominicana | |
We're going to create a file with all possible outcomes based on the | |
suffix present in the SSID. | |
""" | |
import argparse | |
import itertools | |
import random | |
def main(suffix, filename): | |
base = 'QAZWSXEDCRFVTGBYHNUJMIKOLP0129834756' | |
product = itertools.product(base, repeat=4) | |
keys = [] | |
for product in product: | |
keys.append('{}{}'.format(''.join(product), suffix)) | |
random.shuffle(keys) | |
with open(filename, 'w') as f: | |
for key in keys: | |
f.write("%s\n" % key) | |
if __name__== "__main__": | |
parser = argparse.ArgumentParser() | |
parser.add_argument("suffix", help="Final 4 chars of the SSID.") | |
parser.add_argument("file", help="Dictionary filename.") | |
args = parser.parse_args() | |
main(args.suffix, args.file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment