File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2
2
import zipfile
3
3
import sys
4
4
5
+ # input from user
5
6
wordlist = input ("Enter Words list filename: " )
6
7
zip_file = input ("Enter zip filename: " )
7
8
9
+ # initialize the Zip File object
8
10
zip_file = zipfile .ZipFile (zip_file )
11
+ # count the number of words in this wordlist
9
12
n_words = len (list (open (wordlist , "rb" )))
13
+ # print the total number of passwords
10
14
print ("Total passwords to test:" , n_words )
11
15
with open (wordlist , "rb" ) as wordlist :
12
16
for word in tqdm (wordlist , total = n_words , unit = "word" ):
13
17
try :
18
+ # Check if the current selected password unzips the zip file
14
19
zip_file .extractall (pwd = word .strip ())
15
20
except :
16
21
continue
17
22
else :
23
+ # if password found from the word list,
24
+ # exit from program
18
25
print ("Password found:" , word .decode ().strip ())
19
26
exit (0 )
20
27
print ("Password not found, try other wordlist." )
You can’t perform that action at this time.
0 commit comments