-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWordlist_Class.py
131 lines (106 loc) · 5.16 KB
/
Wordlist_Class.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
119
120
121
122
123
124
125
126
127
128
129
130
131
class WordList():
def __init__(self):
import string
import itertools
self.itertools = itertools
self.list_num = string.digits
self.list_upp = string.ascii_uppercase
self.list_low = string.ascii_lowercase
self.list_upp_low = string.ascii_letters
self.list_pun = string.punctuation
def writer(self, compination, fileName):
f = open(fileName, 'w')
for ch in compination:
f.write(ch+'\n')
f.close()
def Numeric(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName='Numeric_0-9_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName='Numeric_0-9_{Limit}.txt')
def Alpha_Lower(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_low, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'a-z_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_low, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'a-z_{Limit}.txt')
def Alpha_Upper(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_upp, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_upp, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z_{Limit}.txt')
def Alphabets(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_upp_low, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_upp_low, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z_{Limit}.txt')
def AlphaNum(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_upp_low+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z,0-9_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_upp_low+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z,0-9_{Limit}.txt')
def LowAlphaNum(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_low+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'a-z,0-9_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_low+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'a-z,0-9_{Limit}.txt')
def UppAlphaNum(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_upp+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,0-9_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_upp+self.list_num, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,0-9_{Limit}.txt')
def AlphaNumPunc(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_upp_low+self.list_num+self.list_pun, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z,0-9,punctuations_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_upp_low+self.list_num+self.list_pun, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'A-Z,a-z,0-9,punctuations_{Limit}.txt')
def Punctuation(self, Limit=0, repeatation=True):
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(self.list_pun, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'Punctuations_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(self.list_pun, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'Punctuations_{Limit}.txt')
def Specific(self, Limit=0, repeatation=True, chars=''):
list_sp = list(set(chars))
if repeatation == True:
compinations = self.itertools.combinations_with_replacement(list_sp, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'{chars}_{Limit}_with_r.txt')
else:
compinations = self.itertools.combinations(list_sp, Limit)
result = map(''.join, compinations)
self.writer(compination=result, fileName=f'{chars}_{Limit}.txt')