-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworldpasses.py
213 lines (190 loc) · 9.05 KB
/
worldpasses.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import random
import string
import requests
import argparse
def get_random_words(lang='en', count=1000):
"""Get random words based on language (using latin characters)"""
# API endpoints and fallback words for different languages
lang_data = {
'en': {
'api': "https://random-word-api.herokuapp.com/word?number=1000",
'fallback': [
'password', 'secret', 'secure', 'admin', 'login', 'welcome', 'user', 'access',
'12345', 'qwerty', 'default', 'root', 'letmein', 'security', 'account', 'code',
'session', 'password123', 'john', 'michael', 'sarah', 'emma'
]
},
'es': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/es/",
'fallback': [
'contrasena', 'secreto', 'seguro', 'administrador', 'bienvenido', 'entrada',
'clave', 'usuario', 'acceso', '123456', 'admin', 'root', 'contraseña', 'codigo',
'sesion', 'cuenta', 'seguridad', 'clave123', 'juan', 'maria', 'pedro', 'luis'
]
},
'da': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/da/",
'fallback': [
'adgangskode', 'sikkerhed', 'administrator', 'velkommen', 'hemmelighed', 'bruger',
'kodeord', 'adgang', '12345', 'root', 'passord', 'login', 'kode', 'konto', 'session',
'sikker', 'hemmelig', 'login123', 'karl', 'anne', 'lars', 'mette'
]
},
'fi': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/fi/",
'fallback': [
'salasana', 'turvallisuus', 'yllapitaja', 'tervetuloa', 'kayttaja', 'hallinta',
'kirjaudu', 'avoin', '12345', 'admin', 'pääsy', 'salasanasana', 'tili', 'koodi',
'istunto', 'suojaus', 'password123', 'kirjautuminen', 'mikko', 'anna', 'jussi', 'kati'
]
},
'no': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/no/",
'fallback': [
'passord', 'sikkerhet', 'administrator', 'velkommen', 'bruker', 'innlogging',
'hemmelighet', '123456', 'admin', 'login', 'root', 'hemmelig', 'konto', 'passord123',
'tilgang', 'sesjon', 'kode', 'sikker', 'olav', 'ingrid', 'hans', 'marit'
]
},
'fr': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/fr/",
'fallback': [
'motdepasse', 'bonjour', 'securite', 'administrateur', 'bienvenue', 'secret',
'utilisateur', 'acces', '12345', 'root', 'connexion', 'letmein', 'code', 'compte',
'session', 'securiser', 'motdepasse123', 'login', 'jean', 'marie', 'paul', 'lucie'
]
},
'ru': {
'api': "https://api.dictionaryapi.dev/api/v2/entries/ru/",
'fallback': [
'parol', 'sekretniy', 'bezopasnost', 'admin', 'vhod', 'privet', 'dostup', '12345',
'root', 'login', 'password', 'user', 'kodus', 'sekuriti', 'akkkount', 'session',
'parol123', 'vhod123', 'alexei', 'olga', 'ivan', 'anna'
]
},
'cn': {
'api': None,
'fallback': [
'mima', 'anquan', 'guanliyuan', 'denglu', 'nihao', 'huanying', 'yonghu', 'zhanghu',
'shouji', 'youxiang', 'wenben', 'shujuku', 'wangluo', 'ruanjian', 'yingjian', 'xitong',
'zhuce', 'tuichu', 'kaishi', 'jieshu', 'bangzhu', 'shezhi', 'geren', 'gongsi', 'xuexiao',
'laoshi', 'xuesheng', 'pengyou', 'jiating', 'gonggong', 'beijing', 'shanghai', 'xianggang',
'taiwan', 'zhongguo', 'meiguo', 'yingyu', 'hanyu', 'riyu', 'xiandai', 'gudai', 'weilai'
]
},
'ng': {
'api': None,
'fallback': [
'asina', 'asiri', 'alaase', 'wole', 'ekabo', 'aabo', 'oluko', 'akeko', 'ile', 'omo',
'baba', 'iya', 'olorun', 'eniyan', 'alafia', 'owuro', 'ale', 'osan', 'ojo', 'osu', 'odun',
'opolopo', 'kere', 'tobi', 'dara', 'buru', 'gbogbo', 'okan', 'meji', 'meta', 'iwe', 'ise',
'owo', 'ile', 'oko', 'oja', 'lagos', 'ibadan', 'ife', 'abeokuta', 'osun', 'oyo', 'yoruba',
'hausa', 'igbo', 'nigeria', 'afrika', 'duniya'
]
}
}
if lang not in lang_data:
print(f"Unsupported language {lang}, using English")
lang = 'en'
word_list = []
# Try API if available
if lang_data[lang]['api']:
try:
response = requests.get(lang_data[lang]['api'])
if response.status_code == 200:
word_list = response.json()
except:
print(f"API failed for {lang}, using fallback words")
# Use fallback if no words or no API
if not word_list:
word_list = lang_data[lang]['fallback']
return word_list
def generate_passwords(lang='en'):
special_chars = "!$@#*^()%&"
words = get_random_words(lang)
passwords = set()
print(f"Generating 400,000 passwords using {lang} words...")
# NEW: Pattern 0: Totally Random (50k)
while len(passwords) < 50000:
length = random.randint(8, 15)
all_chars = string.ascii_letters + string.digits + special_chars
pwd = ''.join(random.choice(all_chars) for _ in range(length))
passwords.add(pwd)
# Pattern 1: Numbers with special chars (50k)
while len(passwords) < 100000:
num = random.randint(100000, 999999999)
chars = ''.join(random.choices(special_chars, k=random.randint(2,4)))
pwd = f"{num}{chars}"
if 8 <= len(pwd) <= 15:
passwords.add(pwd)
# Pattern 2: 3 letters + 3 numbers + 3 special chars (50k)
while len(passwords) < 150000:
letters = ''.join(random.choices(string.ascii_letters, k=3))
numbers = ''.join(random.choices(string.digits, k=3))
chars = ''.join(random.choices(special_chars, k=3))
pwd = f"{letters}{numbers}{chars}"
passwords.add(pwd)
# Pattern 3: Semi-structured mix (50k)
while len(passwords) < 200000:
length = random.randint(8, 15)
parts = [
''.join(random.choices(string.ascii_letters, k=random.randint(3,5))),
''.join(random.choices(string.digits, k=random.randint(2,4))),
''.join(random.choices(special_chars, k=random.randint(2,3)))
]
random.shuffle(parts)
pwd = ''.join(parts)
passwords.add(pwd)
# Pattern 4: Word-based passwords (50k)
while len(passwords) < 250000:
word = random.choice(words)
pattern = random.choice([
lambda: word + str(random.randint(1990,2024)) + random.choice(special_chars),
lambda: word + random.choice(special_chars) + ''.join(random.choices(string.digits, k=3)),
lambda: word.title() + random.choice(special_chars) + str(random.randint(2020,2024)),
lambda: word + ''.join(random.choices(string.digits, k=2)) + random.choice(words)
])
pwd = pattern()
if 8 <= len(pwd) <= 15:
passwords.add(pwd)
# Pattern 5: Mixed case with special chars and numbers (50k)
while len(passwords) < 300000:
letters = ''.join(random.choices(string.ascii_letters, k=random.randint(4,6)))
numbers = ''.join(random.choices(string.digits, k=random.randint(2,4)))
chars = ''.join(random.choices(special_chars, k=random.randint(2,3)))
pwd = f"{letters}{numbers}{chars}"
passwords.add(pwd)
# Pattern 6: Word + Random Special Char + Year (50k)
while len(passwords) < 350000:
word = random.choice(words)
year = random.randint(2010, 2024)
chars = random.choice(special_chars)
pwd = f"{word}{chars}{year}"
if 8 <= len(pwd) <= 15:
passwords.add(pwd)
# NEW: Pattern 7: 2 words + 3 numbers + special char (50k)
while len(passwords) < 400000:
word1 = random.choice(words)
word2 = random.choice(words)
numbers = ''.join(random.choices(string.digits, k=3))
special_char = random.choice(special_chars)
pwd = f"{word1}{word2}{numbers}{special_char}"
if 8 <= len(pwd) <= 15:
passwords.add(pwd)
# Write to file
filename = f'world-passwords_{lang}.txt'
with open(filename, 'w') as f:
for password in passwords:
f.write(password + '\n')
print(f"\nGenerated {len(passwords)} passwords and saved to {filename}")
print("\nSample passwords:")
for pwd in list(passwords)[:5]:
print(pwd)
def main():
parser = argparse.ArgumentParser(description='Generate passwords with different language words')
parser.add_argument('lang', choices=['en', 'es', 'da', 'fi', 'no', 'fr', 'ru', 'cn', 'ng'],
help='Language for word-based passwords (en=English, es=Spanish, da=Danish, fi=Finnish, no=Norwegian, fr=French, ru=Russian, cn=Chinese, ng=Nigerian)')
args = parser.parse_args()
generate_passwords(args.lang)
if __name__ == "__main__":
main()