-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzcrack.py
92 lines (90 loc) · 3.66 KB
/
zcrack.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
import os
from getpass import getuser
import platform
import time,zipfile
print("[*] Checking Requirements Module....")
def get_encoder():
print("INFO: For compatibility reasons with certain symbols, choose your encoder:")
print("1) latin-1\n2) utf-8")
encoder_text = input("option: ")
select_encoder = "latin-1" if encoder_text == "1" else "utf-8"
return select_encoder
def header():
ascii_banner = pyfiglet.figlet_format("{ZIP CRACKER}").upper()
print(colored(ascii_banner.rstrip("\n"), 'cyan', attrs=['bold']))
print(colored(" <Coded By: Clay> \n", 'yellow', attrs=['bold']))
print(colored(" <Version: 2.0> \n", 'magenta', attrs=['bold']))
return
if platform.system().startswith("Linux"):
try:
from tqdm import tqdm
except ImportError:
os.system("python3 -m pip install tqdm -q -q -q")
from tqdm import tqdm
try:
import termcolor
except ImportError:
os.system("python3 -m pip install termcolor -q -q -q")
import termcolor
from termcolor import colored
try:
import pyfiglet
except ImportError:
os.system("python3 -m pip install pyfiglet -q -q -q")
import pyfiglet
def linuxpdf(encoder):
os.system("clear")
user=getuser()
syst=os.path.exists("/data/data/com.termux/files/")
if syst == True:
output="/data/data/com.termux/files/home/Hash_crack/wordlist.txt"
else:
output=f"/home/{user}/Hash_crack/wordlist.txt"
header()
zip_filename = input(termcolor.colored("[*] Enter Your Rute zip file:- ", 'cyan')).strip()
if not os.path.exists(zip_filename):
print(termcolor.colored("\n[ X ] File " + zip_filename + " was not found, Provide Valid FileName And Path!",
'red'))
exit()
print(termcolor.colored("\n[*] Analyzing Zip File:- ", 'blue'), zip_filename)
time.sleep(1)
if zip_filename[-3:] == "zip":
print(termcolor.colored("\n[ ✔ ] Valid ZIP File Found...", 'green'))
else:
print(termcolor.colored("\n[ X ] This is not a valid .zip file...\n", 'red'))
exit()
pwd_filename=output
if not os.path.exists(pwd_filename):
print(termcolor.colored("\n[ X ] File " + pwd_filename + " was not found, Provide Valid FileName And Path!",
'red'))
exit()
with open(pwd_filename, "rb") as passwords:
passwords_list = passwords.readlines()
total_passwords = len(passwords_list)
my_zip_file = zipfile.ZipFile(zip_filename)
for index, password in enumerate(passwords_list):
try:
my_zip_file.extractall(path="Extracted Folder", pwd=password.strip())
print(colored("\n{***********************SUCCESS***********************}", 'green'))
print(colored("[ ✔ ] ZIP FILE Password Found:- ", 'cyan'), password.decode(encoder).strip())
break
except KeyboardInterrupt:
print()
except:
helo = round((index / total_passwords) * 100, 2)
if helo == '100%':
print(colored("[ X ] ALL ATTEMPTS FAILED", 'red'))
else:
print(colored(f"[*] Trying password:- {password.decode(encoder).strip()} ", 'green'))
continue
def catc():
try:
encoder = get_encoder()
time.sleep(1)
os.system("clear")
if platform.system().startswith("Linux"):
linuxpdf(encoder)
except KeyboardInterrupt:
print(termcolor.colored("\nYou Pressed The Exit Button!", 'red'))
quit()
catc()