Hey guys, I am a bit confused here ... making a script to brute force through a dictanary the password of a zip file and it seems to work fine except that it won't stop when the password is found. And when it prints the password it just prints the last one in the dictionary file
Here is my script
def attackZip(filename):
zFile = zipfile.ZipFile(filename)
passFile = open('dictionary.txt')
for line in passFile.readlines():
password = line.strip('\n')
try:
zFile.extractall(pwd=password)
print '[+] Password = %s + \n' %(password)
exit(0)
except Exception, e:
pass
As an example if I have a zip with password "password" and then
dictionary file contains
monkey
123
password
321
I don't get anything printed back and if I try to return the password, it just returns the last word that was on the list '321' in the example above