-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dictionary_Attack.py
41 lines (30 loc) · 997 Bytes
/
Dictionary_Attack.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
'''
Use with crunch ;-)
crunch <min> <max> pattern -o password-file.txt
+-----VAD3R-----+
'''
import zipfile
import os
import time
from threading import Thread
def extract(zFile,passw):
try:
zFile.extractall(pwd=passw)
return passw
except:
pass
def main():
start_time = time.time()
zFile = zipfile.ZipFile("crack.zip")
with open("password-list.txt",'r') as f:
for line in f:
passw = line.strip('\n')
t = Thread(target=extract, args=(zFile,passw))
t.start()
#ans = extract(zFile,passw) #without threading {without lock it generates bizzare result}
if passw: #ans
print("Password :"+passw+'\n') #+ans+
print("--- %s seconds ---" % (time.time() - start_time))
exit(0)
if __name__ == "__main__":
main()