Pyzipcracker 04-20-2013, 07:59 AM
#1
Python version : 2.7
Screenshot :
![[Image: flAVeIa.png]](http://i.imgur.com/flAVeIa.png)
Sometimes my code catch wrong word has a correct password hence it check's each word and print the words out of which only one word can be a correct password.
Code:
from zipfile import *
from sys import stdout
def process(word_file,zip_file):
passes=[]
tries = 0
word = 'h4r0015k'
while word != '':
word = word_file.readline().replace('\n','')
if check_pass(word,zip_file):
passes.append(word)
else:
tries+=1
stdout.write("\rNumber of words tried : "+str(tries))
stdout.flush()
return passes
def check_pass(word,zip_file):
try:
zip_file.read(zip_file.namelist()[0],word)
return True
except:
return False
word_file = open(raw_input("Enter word filename : "))
zip_file = ZipFile(raw_input("Enter zip filename : "),'r')
print "\n\nPasswords :"+str(process(word_file,zip_file))+"\n\n"
Screenshot :
![[Image: flAVeIa.png]](http://i.imgur.com/flAVeIa.png)
Sometimes my code catch wrong word has a correct password hence it check's each word and print the words out of which only one word can be a correct password.
![[Image: fow57.jpg]](http://i.imgur.com/fow57.jpg)