-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
24 lines (20 loc) · 828 Bytes
/
main.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
import zipfile
def crack_password(password_list, zip_file):
with open(password_list, 'r') as file:
for line in file:
password = line.strip() # Remove any leading/trailing whitespace
try:
with zipfile.ZipFile(zip_file, 'r') as zf:
zf.extractall(pwd=password.encode())
print("Password found:", password)
return True
except Exception as e:
# If the password is wrong go to the next one
continue
return False
password_list = input("Enter the location of the password list: ")
zip_file = input("Enter the name and path of the .ZIP file: ")
if crack_password(password_list, zip_file):
print("Password found!")
else:
print("Password not found!")