-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunalista.py
More file actions
116 lines (82 loc) · 3.74 KB
/
Copy pathunalista.py
File metadata and controls
116 lines (82 loc) · 3.74 KB
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
import itertools
import argparse
'''
True power lies not in complexity, but in the elegance of simplicity.
'''
# CONF - Leet transformation mapping
LEET_MAP = {
'a': ['a', '4', '@'], 'b': ['b', '8'], 'e': ['e', '3'], 'i': ['i', '1', '!'],
'l': ['l', '1'], 'o': ['o', '0'], 's': ['s', '5', '$'], 't': ['t', '7']
}
def generate_leet(word):
options = [[char] if char.lower() not in LEET_MAP else LEET_MAP[char.lower()] for char in word]
return set(''.join(p) for p in itertools.product(*options))
def generate_case_permutations(word):
return set(''.join(p) for p in itertools.product(*[(c.lower(), c.upper()) for c in word]))
def generate_word_variations(words, separators, strict):
if strict:
combos = [''.join(words)] + [sep.join(words) for sep in separators]
else:
combos = [''.join(p) for p in itertools.permutations(words)]
combos += [sep.join(p) for sep in separators for p in itertools.permutations(words)]
return combos
def generate_prefix_suffix(chars, length):
combos = set()
for i in range(1, length + 1):
for combo in itertools.product(chars, repeat=i):
combos.add(''.join(combo))
return combos
def create_passwords(words, separators, strict, leet, ap, pr):
passwords = set()
base_variations = generate_word_variations(words, separators, strict)
for base in base_variations:
cases = generate_case_permutations(base)
if leet:
leet_cases = set()
for case in cases:
leet_cases.update(generate_leet(case))
cases.update(leet_cases)
passwords.update(cases)
if ap:
ap_len, ap_chars = ap
suffixes = generate_prefix_suffix(ap_chars, ap_len)
new_passwords = {p + s for p in passwords for s in suffixes}
passwords.update(new_passwords)
if pr:
pr_len, pr_chars = pr
prefixes = generate_prefix_suffix(pr_chars, pr_len)
new_passwords = {pre + p for p in passwords for pre in prefixes}
passwords.update(new_passwords)
return passwords
def print_banner():
banner = r"""
_ _
(_| | \_|_) o
| | _ _ __, | , _|_ __,
| | / |/ | / | _| | / \_| / |
\__/\_/ | |_/\_/|_/ (/\___/|_/ \/ |_/\_/|_/
Custom Password Generator 🔥 unalista 🔥 @leddcode
"""
print(banner)
def burn():
print_banner()
parser = argparse.ArgumentParser(description="Custom Password Generator")
parser.add_argument("--words", required=True, help="Comma-separated words")
parser.add_argument("--order", choices=['strict', 'free'], default='free', help="Words ordering")
parser.add_argument("--leet", action='store_true', help="Enable leet transformations")
parser.add_argument("--ap", help="Append characters (e.g., --ap 2,!@#$)")
parser.add_argument("--pr", help="Prepend characters (e.g., --pr 2,!@#$)")
parser.add_argument("--output", default="passwords.txt", help="Output file")
args = parser.parse_args()
words = args.words.split(',')
separators = ['-', '_', ':', '+'] # CONF
strict_order = args.order == 'strict'
ap = (int(args.ap.split(',')[0]), args.ap.split(',')[1]) if args.ap else None
pr = (int(args.pr.split(',')[0]), args.pr.split(',')[1]) if args.pr else None
passwords = create_passwords(words, separators, strict_order, args.leet, ap, pr)
print(f"🚀 Generated {len(passwords)} passwords.\n😎 Saving to {args.output}...")
with open(args.output, 'w+', encoding='utf-8', errors='ignore') as f:
f.write('\n'.join(passwords))
print("✅ Done!\n")
if __name__ == "__main__":
burn()