-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZipDecryptor.py
More file actions
51 lines (40 loc) · 1.31 KB
/
Copy pathZipDecryptor.py
File metadata and controls
51 lines (40 loc) · 1.31 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
#ZipDecrypter
#A tool which find the password of password-protected ZIP files from a custom password list.
#Author - WireBits
import sys
import time
import zipfile
import argparse
import threading
def main():
try_count = 0
parser = argparse.ArgumentParser()
parser.add_argument('-f', help="Name of Zip File")
parser.add_argument('-p', help="Password List")
args = parser.parse_args()
if not args.f or not args.p:
sys.exit()
zip_file = zipfile.ZipFile(args.f)
password_list = open(args.p, 'r')
start_time = time.time()
print("[+]Please Wait While Extracting...")
for password in password_list.readlines():
try_count += 1
password = password.strip()
zip_process = threading.Thread(target=extract_zip, args=(zip_file, password))
zip_process.start()
for thread in threading.enumerate():
if thread != threading.main_thread():
thread.join()
print("[+]Tried:",try_count)
end_time = time.time()
print("[+]Duration:",end_time - start_time)
def extract_zip(zip_file, password):
try:
zip_file.extractall(pwd=password.encode())
print("[+]Password Found:",password)
sys.exit(0)
except Exception:
pass
if __name__ == '__main__':
main()