diff --git a/README.md b/README.md index f116977..bde73e5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ex: fever4759harbor xfinity-keyspace.py - quick code to generate a wordlist for xfinity wifi passwords -wordlists - contains common 6 letter and 5 letter words as well as all 4 character numbers +wordlists - contains common 6-letter and 5-letter words as well as all 4 character numbers sources and tools - contains original wordlists, source file on where to find words, as well as scripts to manipulate them. For the 5list.txt and 6list.txt wordlists, I downloaded the top 4000 english words and pulled out all the 5 and 6 character words into lists. @@ -14,11 +14,10 @@ sources and tools - contains original wordlists, source file on where to find wo 1. Download the .zip 2. Install python 3. Run xfinity-keyspace.py -4. Run xfinity-keypace reverse.py (to start with 6 letter words) 4. Sit back and wait! # sizes -keyspace.txt will come out to 75.2 GB or 150.4 GB (if you run both) in size. 12.2 GB as compressed tar.gz file. +xfinity_forward.txt / xfinity_backward.txt will come out to 75.2 GB or 150.4 GB (if you run both) in size. 12.2 GB as compressed tar.gz file. (If you choose to use the big lists, just rename the files in the Python scripts, please note the files will be huge) diff --git a/wordlists/5list.txt b/wordlists/5list.txt index 3b83575..3d5536e 100644 --- a/wordlists/5list.txt +++ b/wordlists/5list.txt @@ -683,4 +683,4 @@ yield young devil yours -youth +youth \ No newline at end of file diff --git a/wordlists/6list.txt b/wordlists/6list.txt index d0b424b..de12e73 100644 --- a/wordlists/6list.txt +++ b/wordlists/6list.txt @@ -682,4 +682,4 @@ reveal device review devote -reward +reward \ No newline at end of file diff --git a/wordlists/numbers.txt b/wordlists/numbers.txt index 77dbaaa..0a6ca22 100644 --- a/wordlists/numbers.txt +++ b/wordlists/numbers.txt @@ -9997,4 +9997,4 @@ 9996 9997 9998 -9999 +9999 \ No newline at end of file diff --git a/xfinity-keyspace - Reverse.py b/xfinity-keyspace - Reverse.py deleted file mode 100644 index 93b2475..0000000 --- a/xfinity-keyspace - Reverse.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -# example xfinity wifi password: harbor7538fever -import os - -print("Creating temp list... Stand by.") -templist = open("temp.txt", "w") - -with open("wordlists/6list.txt") as sixlist: - with open("wordlists/numbers.txt") as numblist: - slist = sixlist.readlines() - nlist = numblist.readlines() - for fword in slist: - for numb in nlist: - comb = fword.strip() + numb.strip() + "\n" - templist.write(comb) -sixlist.close() -numblist.close() -templist.close() -print("\tdone") - -print("Creating final keyspace... Grab a beer!") -keyspace = open("keyspace6letter.txt", "w") -with open("temp.txt") as templist: - with open("wordlists/5list.txt") as fivelist: - tlist = templist.readlines() - flist = fivelist.readlines() - for tword in tlist: - for sword in flist: - comb = tword.strip() + sword.strip() + "\n" - keyspace.write(comb) -templist.close() -fivelist.close() -keyspace.close() -os.remove("temp.txt") -print("\tdone") diff --git a/xfinity-keyspace.py b/xfinity-keyspace.py index a55ec7f..17756c5 100644 --- a/xfinity-keyspace.py +++ b/xfinity-keyspace.py @@ -1,35 +1,89 @@ #!/usr/bin/python # example xfinity wifi password: fever7538harbor import os +import sys +import logging -print("Creating temp list... Stand by.") -templist = open("temp.txt", "w") - -with open("wordlists/5list.txt") as fivelist: - with open("wordlists/numbers.txt") as numblist: - flist = fivelist.readlines() - nlist = numblist.readlines() - for fword in flist: - for numb in nlist: - comb = fword.strip() + numb.strip() + "\n" - templist.write(comb) -fivelist.close() -numblist.close() -templist.close() -print("\tdone") - -print("Creating final keyspace... Grab a beer.") -keyspace = open("keyspace.txt", "w") -with open("temp.txt") as templist: - with open("wordlists/6list.txt") as sixlist: - tlist = templist.readlines() - slist = sixlist.readlines() - for tword in tlist: - for sword in slist: - comb = tword.strip() + sword.strip() + "\n" - keyspace.write(comb) -templist.close() -sixlist.close() -keyspace.close() -os.remove("temp.txt") -print("\tdone") +log = logging.getLogger() +log.setLevel(logging.INFO) + +stream_handler = logging.StreamHandler(sys.stdout) +stream_handler.setLevel(logging.INFO) +formatter = logging.Formatter('%(asctime)s - %(threadName)s - %(levelname)s | %(message)s') +stream_handler.setFormatter(formatter) +log.addHandler(stream_handler) + + +FIVE_LIST = "wordlists/5list.txt" +FIVE_LIST_BIG = "wordlists/5list-big.txt" +SIX_LIST = "wordlists/6list.txt" +SIX_LIST_BIG = "wordlists/6list-big.txt" +NUM_LIST = "wordlists/numbers.txt" +FORWARD = "xfinity_forward.txt" +BACKWARD = "xfinity_backward.txt" + + +def open_word_list(file_name): + with open(file_name) as f_in: + return [item.strip() for item in f_in.readlines()] + + +def write_list(file_name, list_data): + with open(file_name, 'a') as f_out: + f_out.write('\n'.join(list_data)) + + +class XfinityWiFiPassword: + def __init__(self, big_list=False): + log.info("Xfinity WiFi Password Generator Started") + self.batch_size_threshold = 5000000 # ~5MB + # Remove pre-existing files as to not create duplicates + # TODO: Implement a way to pick-up where left off. + if os.path.exists(FORWARD): + os.remove(FORWARD) + if os.path.exists(BACKWARD): + os.remove(BACKWARD) + + if big_list: + self.five_list = open_word_list(FIVE_LIST_BIG) + self.six_list_big = open_word_list(SIX_LIST_BIG) + else: + self.five_list = open_word_list(FIVE_LIST) + self.six_list = open_word_list(SIX_LIST) + + self.numbers = open_word_list(NUM_LIST) + self.forward_list = [] + self.backward_list = [] + + def add_forward(self, password): + if sys.getsizeof(self.forward_list) >= self.batch_size_threshold: + write_list(FORWARD, self.forward_list) + self.forward_list.clear() + self.forward_list.append(password) + + def add_backward(self, password): + if sys.getsizeof(self.backward_list) >= self.batch_size_threshold: + write_list(FORWARD, self.backward_list) + self.backward_list.clear() + self.backward_list.append(password) + + def forward(self): + log.info("Creating forward passwords list") + for word1 in self.five_list: + for number in self.numbers: + for word2 in self.six_list: + self.add_forward(word1 + number + word2) + + def backward(self): + log.info("Creating backward passwords list") + for word1 in self.six_list: + for number in self.numbers: + for word2 in self.five_list: + self.add_backward(word1 + number + word2) + + +if __name__ == "__main__": + # If you want the big list to process, change big_list to True + pass_gen = XfinityWiFiPassword(big_list=False) + pass_gen.forward() + pass_gen.backward()