Skip to content

Commit be79104

Browse files
authored
Updated GWEN and fixed a problem in WHAG discovered during gameplay
1 parent 2062f30 commit be79104

File tree

2 files changed

+2694
-0
lines changed

2 files changed

+2694
-0
lines changed

GWEN0p04.py

+284
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
#GWEN (Generator of Wordlists for ENdeavors) 0.04
2+
#by stringzzz, Ghostwarez Co.
3+
#Date completed (0.01): 01-19-2024
4+
#Date completed (0.02): 01-19-2024 (Cleaned up the code quite a bit)
5+
#Date completed (0.03): 01-21-2024 (Added prompt for user to continue or not after showing exact size of wordlist)
6+
#Added new wordlist pattern option
7+
8+
#Makes generating wordlists with common patterns easier
9+
10+
import itertools
11+
import math
12+
13+
nogen = False
14+
choice = 'none'
15+
while(choice != 'exit'):
16+
print("Welcome to GWEN (Generator of Wordlists for ENdeavors) 0.04\nMakes generating wordlists with common patterns easier\n")
17+
choice = input("All size and length estimates below were from using 15char words, and 10 base words.\nAfter entering the base words, you will be given exact sizes for your list\n\nEnter a # choice\n1) [word][0-6#s][word2] 40MB 1,111,111Lines\n2) (Need base word file) [word][0-5#s or '!@#$%&*'] 302MB 15,085,980Lines\n3) (Need base word file) [0-2#s or '!@#$%&*'][word][0-3#s or '!@#$%&*'] 302MB 15,085,980Lines\n4) (Need base word file) [word1][word2][0-4#s or '!@#$%&*'] 267MB 7,986,690Lines\n5) (Need base word file) [word1][word2][word3][3-4#s] 377MB 7,920,000Lines\n6) (Need base word file) Concat list words, generate every permutation of them 523MB 3,628,800Lines\n7) [All 7 digit phone numbers] 77MB 10,000,000Lines\n'exit': Exit GWEN\n\nChoice: ").strip()
18+
if (choice == '1'):
19+
list_name = input("Enter the name for the list: ").strip()
20+
word = input("Enter the start word (Press ENTER to skip): ").strip()
21+
end_word = input("Enter the end word (Press ENTER to skip): ").strip()
22+
23+
#Get wordlist size and length
24+
line_count = math.pow(10, 6) + math.pow(10, 5) + math.pow(10, 4) + math.pow(10, 3) + math.pow(10, 2) + 10 + 1
25+
line_bytes_count = (len(word) + len(end_word) + 1) * line_count + (math.pow(10, 6)*6 + math.pow(10, 5)*5 + math.pow(10, 4)*4 + math.pow(10, 3)*3 + math.pow(10, 2)*2 + 10)
26+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
27+
if (yn != 'y'):
28+
nogen = True
29+
break
30+
31+
print("\nGenerating wordlist...\n")
32+
33+
wordlist_file = open(list_name + "_wordlist01.txt", 'w')
34+
wordlist_file.write(word + end_word + "\n")
35+
chars = "0123456789"
36+
for a in range(0, 10):
37+
wordlist_file.write(word + chars[a] + end_word + "\n")
38+
for n in range(2, 7):
39+
p = list(itertools.product(chars, repeat=n))
40+
for line in p:
41+
wordlist_file.write(word + "".join(line) + end_word + "\n")
42+
wordlist_file.close()
43+
print("Wordlist '" + list_name + "_wordlist01.txt' generation complete.")
44+
break
45+
46+
elif (choice == '2'):
47+
list_name = input("Enter the name for the list: ").strip()
48+
word_fn = input("Enter the name of the base word file (>30 base words not recommended): ").strip()
49+
baseword_file=open(word_fn, "r")
50+
words = baseword_file.read().splitlines()
51+
baseword_file.close()
52+
if (words[len(words) - 1] == ""):
53+
words.pop()
54+
55+
#Get wordlist size and length
56+
lines = math.pow(17, 5) + math.pow(17, 4) + math.pow(17, 3) + math.pow(17, 2) + 17 + 1
57+
line_count = len(words) * lines
58+
line_bytes_count = 0
59+
for word in words:
60+
line_bytes_count += (len(word) + 1) * lines + (math.pow(17, 5)*5 + math.pow(17, 4)*4 + math.pow(17, 3)*3 + math.pow(17, 2)*2 + 17)
61+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
62+
if (yn != 'y'):
63+
nogen = True
64+
break
65+
66+
print("\nGenerating wordlist...\n")
67+
wordlist_file = open(list_name + "_wordlist02.txt", 'w')
68+
69+
chars = "0123456789!@#$%&*"
70+
for word in words:
71+
wordlist_file.write(word + "\n")
72+
for a in range(0, 17):
73+
wordlist_file.write(word + chars[a] + "\n")
74+
for n in range(2, 6):
75+
p = list(itertools.product(chars, repeat=n))
76+
for line in p:
77+
wordlist_file.write(word + "".join(line) + "\n")
78+
wordlist_file.close()
79+
print("Wordlist '" + list_name + "_wordlist02.txt' generation complete.")
80+
break
81+
82+
elif (choice == '3'):
83+
list_name = input("Enter the name for the list: ").strip()
84+
word_fn = input("Enter the name of the base word file (>30 base words not recommended): ").strip()
85+
baseword_file=open(word_fn, "r")
86+
words = baseword_file.read().splitlines()
87+
baseword_file.close()
88+
if (words[len(words) - 1] == ""):
89+
words.pop()
90+
91+
#Get wordlist size and length
92+
lines = math.pow(17, 5) + math.pow(17, 4) + math.pow(17, 3) + math.pow(17, 2) + 17 + 1
93+
line_count = len(words) * lines
94+
line_bytes_count = 0
95+
for word in words:
96+
line_bytes_count += (len(word) + 1) * lines + (math.pow(17, 5)*5 + math.pow(17, 4)*4 + math.pow(17, 3)*3 + math.pow(17, 2)*2 + 17)
97+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
98+
if (yn != 'y'):
99+
nogen = True
100+
break
101+
102+
print("\nGenerating wordlist...\n")
103+
wordlist_file = open(list_name + "_wordlist03.txt", 'w')
104+
105+
chars = "0123456789!@#$%&*"
106+
for word in words:
107+
wordlist_file.write(word + "\n")
108+
for a in range(0, 17):
109+
wordlist_file.write(chars[a] + word + "\n")
110+
p2 = list(itertools.product(chars, repeat=2))
111+
for line in p2:
112+
wordlist_file.write("".join(line) + word + "\n")
113+
for line in p2:
114+
for c in range(0, 17):
115+
wordlist_file.write("".join(line) + word + chars[c] + "\n")
116+
for n in range(2, 4):
117+
p = list(itertools.product(chars, repeat=n))
118+
for line2 in p2:
119+
for line in p:
120+
wordlist_file.write("".join(line2) + word + "".join(line) + "\n")
121+
wordlist_file.close()
122+
print("Wordlist '" + list_name + "_wordlist03.txt' generation complete.")
123+
break
124+
125+
elif (choice == '4'):
126+
list_name = input("Enter the name for the list: ").strip()
127+
word_fn = input("Enter the name of the base word file (>30 base words not recommended): ").strip()
128+
baseword_file=open(word_fn, "r")
129+
words = baseword_file.read().splitlines()
130+
baseword_file.close()
131+
if (words[len(words) - 1] == ""):
132+
words.pop()
133+
words2 = words[:]
134+
135+
#Get wordlist size and length
136+
lines = math.pow(17, 4) + math.pow(17, 3) + math.pow(17, 2) + 17 + 1
137+
combo_count = 0
138+
for word in words:
139+
for word2 in words2:
140+
if (word == word2):
141+
continue
142+
combo_count += 1
143+
line_count = combo_count * lines
144+
line_bytes_count = 0
145+
for word in words:
146+
for word2 in words2:
147+
if (word == word2):
148+
continue
149+
line_bytes_count += (len(word) + len(word2) + 1) * lines + (math.pow(17, 4)*4 + math.pow(17, 3)*3 + math.pow(17, 2)*2 + 17)
150+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
151+
if (yn != 'y'):
152+
nogen = True
153+
break
154+
155+
print("\nGenerating wordlist...\n")
156+
wordlist_file = open(list_name + "_wordlist04.txt", 'w')
157+
158+
chars = "0123456789!@#$%&*"
159+
for word in words:
160+
for word2 in words2:
161+
if (word == word2):
162+
continue
163+
wordlist_file.write(word + word2 + "\n")
164+
for a in range(0, 17):
165+
wordlist_file.write(word + word2 + chars[a] + "\n")
166+
for n in range(2, 5):
167+
p = list(itertools.product(chars, repeat=n))
168+
for line in p:
169+
wordlist_file.write(word + word2 + "".join(line) + "\n")
170+
171+
172+
wordlist_file.close()
173+
print("Wordlist '" + list_name + "_wordlist04.txt' generation complete.")
174+
break
175+
176+
elif (choice == '5'):
177+
list_name = input("Enter the name for the list: ").strip()
178+
word_fn = input("Enter the name of the base word file (>20 base words not recommended): ").strip()
179+
baseword_file=open(word_fn, "r")
180+
words = baseword_file.read().splitlines()
181+
baseword_file.close()
182+
if (words[len(words) - 1] == ""):
183+
words.pop()
184+
words2 = words[:]
185+
words3 = words2[:]
186+
187+
#Get wordlist size and length
188+
lines = math.pow(10, 4) + math.pow(10, 3)
189+
combo_count = 0
190+
for word in words:
191+
for word2 in words2:
192+
if (word == word2):
193+
continue
194+
for word3 in words3:
195+
if (word == word3 or word2 == word3):
196+
continue
197+
combo_count += 1
198+
line_count = combo_count * lines
199+
line_bytes_count = 0
200+
for word in words:
201+
for word2 in words2:
202+
if (word == word2):
203+
continue
204+
for word3 in words3:
205+
if (word == word3 or word2 == word3):
206+
continue
207+
line_bytes_count += (len(word) + len(word2) + len(word3) + 1) * lines + (math.pow(10, 4)*4 + math.pow(10, 3)*3)
208+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
209+
if (yn != 'y'):
210+
nogen = True
211+
break
212+
213+
print("\nGenerating wordlist...\n")
214+
wordlist_file = open(list_name + "_wordlist05.txt", 'w')
215+
216+
chars = "0123456789"
217+
for word in words:
218+
for word2 in words2:
219+
if (word == word2):
220+
continue
221+
for word3 in words3:
222+
if (word == word3 or word2 == word3):
223+
continue
224+
for n in range(3, 5):
225+
p = list(itertools.product(chars, repeat=n))
226+
for line in p:
227+
wordlist_file.write(word + word2 + word3 + "".join(line) + "\n")
228+
229+
230+
wordlist_file.close()
231+
print("Wordlist '" + list_name + "_wordlist05.txt' generation complete.")
232+
break
233+
234+
elif (choice == '6'):
235+
list_name = input("Enter the name for the list: ").strip()
236+
word_fn = input("Enter the name of the base word file (>10 base words not recommended): ").strip()
237+
baseword_file=open(word_fn, "r")
238+
words = baseword_file.read().splitlines()
239+
baseword_file.close()
240+
if (words[len(words) - 1] == ""):
241+
words.pop()
242+
243+
#Get wordlist size and length
244+
permuted_words = list(itertools.permutations(words, len(words)))
245+
line_count = len(permuted_words)
246+
permute_size = 0
247+
for word in words:
248+
permute_size += len(word)
249+
line_bytes_count = (permute_size + 1) * line_count
250+
yn = input("Will generate " + str(math.ceil(line_bytes_count/1024/1024)) + "MB and " + f'{(int(line_count)):,}' + "Lines of data, continue? (y/n): ").strip().lower()
251+
if (yn != 'y'):
252+
nogen = True
253+
break
254+
255+
print("\nGenerating wordlist...\n")
256+
wordlist_file = open(list_name + "_wordlist06.txt", 'w')
257+
for line in permuted_words:
258+
wordlist_file.write("".join(line) + "\n")
259+
wordlist_file.close()
260+
print("Wordlist '" + list_name + "_wordlist06.txt' generation complete.")
261+
break
262+
263+
264+
elif (choice == '7'):
265+
print("\nGenerating wordlist...\n")
266+
267+
wordlist_file = open("phonenumbers7digits_wordlist.txt", 'w')
268+
chars = "0123456789"
269+
p = list(itertools.product(chars, repeat=7))
270+
for line in p:
271+
wordlist_file.write("".join(line) + "\n")
272+
wordlist_file.close()
273+
print("Wordlist 'phonenumbers7digits_wordlist.txt' generation complete.")
274+
break
275+
elif (choice == 'exit'):
276+
nogen = True
277+
break
278+
else:
279+
print("Invalid choice!\n")
280+
281+
if (not(nogen)):
282+
print("\nThank you for working with GWEN, happy cracking! ;3\n")
283+
else:
284+
print("\nAwww, maybe next time... :C\n")

0 commit comments

Comments
 (0)