-
Notifications
You must be signed in to change notification settings - Fork 1
/
wordlistGenerator.py
118 lines (102 loc) · 3.79 KB
/
wordlistGenerator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
def option1 (charSet):
newList = charSet
tempList = list()
mixedList = list()
num=0
myWordlist = open(f"./custom_char_wl.txt", "w")
while(num<len(charSet)):
for i in newList:
if i not in mixedList:
mixedList.append(i)
myWordlist.write(f'{i}\n')
for j in charSet:
tempList.append(i+j)
newList=tempList
tempList=list()
num+=1
myWordlist.close()
def option2 (charLen, charSet):
myWordList = open("./custom_len_wl.txt", "w")
word=""
tempWord = list()
for i in range(charLen):
tempWord.append(0)
word+=charSet[0]
myWordList.write(f'{word}\n')
while sum(tempWord) < (len(charSet)-1)*charLen:
if tempWord[charLen-1] < len(charSet)-1:
tempWord[charLen-1]+=1
else:
tempWord[charLen-1] = 0
for i in range(charLen-2, -1, -1):
if tempWord[i] < len(charSet)-1:
tempWord[i]+=1
break
else:
tempWord[i] = 0
word = ""
for j in tempWord:
word+=charSet[j]
myWordList.write(f'{word}\n')
myWordList.close()
def option3 (charSet):
newList = charSet
tempList = list()
num=0
myWordList = open("./max_limit_wl.txt", "w")
while(num<len(charSet)):
for i in newList:
myWordList.write(f'{i}\n')
for j in charSet:
tempList.append(i+j)
newList=tempList
tempList=list()
num+=1
myWordList.close()
def option4(charSet, minLen, maxLen):
newList = charSet
tempList = list()
num=0
myWordList = open("./min_max_wl.txt", "w")
while(num<len(charSet)):
for i in newList:
if len(i)<=maxLen and len(i)>=minLen:
myWordList.write(f'{i}\n')
elif len(i) > maxLen:
break
for j in charSet:
tempList.append(i+j)
newList=tempList
tempList=list()
num+=1
myWordList.close()
def main ():
charSet = list("""abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-,./';][<>?":|}{\\ """)
while True:
option = input("""1. Enter custom characters\n2. Enter a word length.\n3. Use pre-existing character set\n (word length starts from 1 ends at 97)\n (Choose wisely)\n4. Use <min> and <max> length\n5. Enter q to Exit!\n\n Option number: """)
if option == "1":
charSet = list(input("Enter characters (space will be considered a character): \n"))
option1(charSet)
elif option == "2":
charLen = int(input("Enter desired word length: "))
option2(charLen, charSet)
elif option == "3":
option3(charSet)
elif option == "4":
minLen = int(input("Enter <min> length: "))
maxLen = int(input("Enter <max> length: "))
option4(charSet, minLen, maxLen)
elif option == "q":
quit(f"\n\t====Thanks for using WORDLIST GENERATOR====\n")
else:
print("Choose a valid option!")
if __name__ == '__main__':
print("""
█░█░█ █▀█ █▀█ █▀▄ █░░ █ █▀ ▀█▀
▀▄▀▄▀ █▄█ █▀▄ █▄▀ █▄▄ █ ▄█ ░█░
█▀▀ █▀▀ █▄░█ █▀▀ █▀█ ▄▀█ ▀█▀ █▀█ █▀█
█▄█ ██▄ █░▀█ ██▄ █▀▄ █▀█ ░█░ █▄█ █▀▄
""")
print("Before running this script, make sure that you have write permission.")
print()
main()