Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
2 changes: 1 addition & 1 deletion wordlists/5list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -683,4 +683,4 @@ yield
young
devil
yours
youth
youth
2 changes: 1 addition & 1 deletion wordlists/6list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,4 @@ reveal
device
review
devote
reward
reward
2 changes: 1 addition & 1 deletion wordlists/numbers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9997,4 +9997,4 @@
9996
9997
9998
9999
9999
35 changes: 0 additions & 35 deletions xfinity-keyspace - Reverse.py

This file was deleted.

116 changes: 85 additions & 31 deletions xfinity-keyspace.py
Original file line number Diff line number Diff line change
@@ -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()