OP Posted at 06-02-2025, 06:14 PM (This post was last modified: 06-02-2025, 06:26 PM by Manfruity.)
Copy the python code below
Code:
[ Hidden Content! ]
Code:
import zipfile
def crack_password(password_list, obj):
# tracking line no. at which password is found
idx = 0
# open file in read byte mode only as "passwords.txt"
# file contains some special characters and hence
# UnicodeDecodeError will be generated
with open(password_list, 'rb') as file:
for line in file:
for word in line.split():
try:
idx += 1
obj.extractall(pwd=word)
print("Password found at line", idx)
print("Password is", word.decode())
return True
except:
continue
return False