-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzipRip.py
147 lines (129 loc) · 4.25 KB
/
zipRip.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, os, time
import zipfile
class bc:
GC = '\033[1;39m'
BC = '\033[1;34m'
RC = '\033[1;31m'
author = bc.BC + "\n Author: " + bc.RC + "4" + bc.GC + "x" + bc.BC + "x" + bc.RC + "4" + bc.GC + "0" + bc.BC + "4\n"
version = bc.BC + " Version: " + bc.RC + "1" + bc.GC + "." + bc.BC + "0\n"
github = bc.BC + " Github: " + bc.RC + "h" + bc.GC + "t" + bc.BC + "t" + bc.RC + "p" + bc.GC + "s" + bc.BC + ":" + bc.RC + "/" + bc.GC + "/" + bc.BC + "g" + bc.RC + "i" + bc.GC + "t" + bc.BC + "h" + bc.RC + "u" + bc.GC + "b" + bc.BC + "." + bc.RC + "c" + bc.GC + "o" + bc.BC + "m" + bc.RC + "/" + bc.GC + "4" + bc.BC + "x" + bc.RC + "x" + bc.GC + "4" + bc.BC + "0" + bc.RC + "4\n"
banner = bc.RC + '''
(
''' + bc.GC + ''' )\ )
''' + bc.BC + ''' ( (()/( (
''' + bc.RC + ''' ( )\ ) ) )(_)))\ ) )
''' + bc.GC + ''' )\((_) /(/( (_)) ((_) /(/(
''' + bc.BC + ''' ((_)(_)((_)_\ | _ \ (_)((_)_\
''' + bc.RC + ''' |_ /| || '_ \)| / | || '_ \)
''' + bc.GC + ''' /__||_|| .__/ |_|_\ |_|| .__/
''' + bc.BC + ''' |_| |_|
''' + author + version + github
iBan = bc.BC + " [" + bc.GC + "?" + bc.BC + "]"
sBan = bc.BC + " [" + bc.GC + u'\u2713' + bc.BC + "]"
eBan = bc.BC + " [" + bc.RC + u'\u2717' + bc.BC + "]"
clr = 'clear'
os.system(clr)
print(banner)
def zipRip():
try:
wordlist = str(input(bc.BC + ' Password Wordlist: ' + bc.GC))
if(wordlist == ''):
os.system(clr)
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + ' Password Wordlist value cannot be empty\n')
time.sleep(1)
zipRip()
else:
pass
except KeyboardInterrupt:
os.system(clr)
print(banner)
print(bc.BC + ' Closing zipRip...')
time.sleep(1)
os.system(clr)
print(banner)
quit()
try:
zipFile = str(input(bc.BC + ' Zip File: ' + bc.GC))
if(zipFile == ''):
os.system(clr)
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + ' Zip File value cannot be empty\n')
time.sleep(1)
zipRip()
else:
pass
except KeyboardInterrupt:
os.system(clr)
print(banner)
print(bc.BC + ' Closing zipRip...')
time.sleep(1)
os.system(clr)
print(banner)
quit()
try:
passwords = open(wordlist, 'rb')
except Exception:
os.system(clr)
print(banner)
print(eBan + bc.RC + ' ERROR: ' + bc.BC + ' Failed to open Password Wordlist: ' + bc.RC + wordlist + '\n')
time.sleep(1)
zipRip()
tries = 1
try:
if(zipFile.endswith('.zip')):
dirName = zipFile.split('.')[0]
zipExtractPath = 'extracted/' + dirName
fileDATA = []
for word in passwords:
os.system(clr)
print(banner)
passwd = word.strip()
triesBanner = bc.BC + ' [' + bc.GC + str(tries) + bc.BC + ']'
try:
print(bc.BC + triesBanner + ' Trying Password: ' + bc.GC + str(passwd.decode('utf-8')))
with zipfile.ZipFile(zipFile, 'r') as zf:
zf.extractall(path=zipExtractPath, pwd=passwd)
data = zf.namelist()
for d in data:
data_size = zf.getinfo(d).file_size
fileinfo = str(d) + ':#:' + str(data_size) + 'kb'
fileDATA.append(fileinfo)
break
except Exception:
print(eBan + bc.RC + ' ' + str(passwd.decode('utf-8')))
time.sleep(0.1)
tries += 1
continue
os.system(clr)
print(banner)
print(bc.BC + ' Password Wordlist: ' + bc.GC + wordlist)
print(bc.BC + ' Zip File: ' + bc.GC + zipFile)
print('\n' + sBan + ' Password Found: ' + bc.GC + str(passwd.decode('utf-8')))
print(bc.BC + '\n Contents Information:')
fileCount = 1
for dat in fileDATA:
file = dat.split(':#:')[0]
size = dat.split(':#:')[1]
print(bc.BC + '\t [' + bc.GC + 'File ' + str(fileCount) + bc.BC + ']: ' + bc.GC + str(file))
print(bc.BC + '\t [' + bc.GC + 'Size' + bc.BC + ']: ' + bc.GC + str(size) + '\n')
fileCount += 1
print(sBan + ' Extraction Complete\n')
zipRip()
else:
os.system(clr)
print(banner)
print(eBan + bc.RC + ' ERROR: ' + zipFile + bc.BC + ' does not have a .zip extension\n')
time.sleep(1)
zipRip()
except KeyboardInterrupt:
print(bc.BC + '\n Stopping zipRip Cracker...\n')
time.sleep(1)
input(bc.BC + ' Press Enter to Continue...')
os.system(clr)
print(banner)
zipRip()
if __name__ == '__main__':
zipRip()