-
Notifications
You must be signed in to change notification settings - Fork 0
/
worldlistmaker.py
56 lines (47 loc) · 1.11 KB
/
worldlistmaker.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
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
CWHITE = '\33[37m'
def generate(arr, i, s, len):
# base case
if (i == 0): # when len has
# been reached
# print it out
print(color.BLUE,s)
f = open("WORD_LIST.txt", "a")
f.write(f"{s}\n")
f.close()
return
# iterate through the array
for j in range(0, len):
# Create new string with
# next character Call
# generate again until
# string has reached its len
appended = s + arr[j]
generate(arr, i - 1, appended, len)
return
# function to generate
# all possible passwords
def crack(arr, len):
# call for all required lengths
for i in range(1 , len + 1):
generate(arr, i, "", len)
# Driver Code
inp=input("Enter Characters: ")
inp=inp.split(" ")
arr = inp
print(color.YELLOW+"The Characters To Use Are: ",arr )
f = open("WORD_LIST.txt", "w")
f.write(f"The Characters To Use Are: {arr}\n")
f.close()
len = len(arr)
crack(arr, len)