[issue10876] Zipfile crashes when zip password is set to 610

Kira Erethon report at bugs.python.org
Mon Jan 10 00:12:23 CET 2011


Kira Erethon <shinjierethon at gmail.com> added the comment:

Ok, I tried recreating the bug and found out that I couldn't. Originally this happened when I tried to find the password of a zip file through a dictionary attack. The code I used is this:

import zipfile

zfile=raw_input("Please input zip's file name\n")
diction=raw_input("Please input dictionary\n")
found = False
zipf = zipfile.ZipFile( zfile, 'r' )
f = open(diction, 'r')
for line in f:
    pswd = line
    pswd = pswd[:-1]
    zipf.setpassword(pswd)
    try:
        zipf.extractall()
        found = True
        break
    except RuntimeError:
        continue
zipf.close()  

First time I encountered the bug was when on my dictionary I had all the numbers from 000 to 999 and saw that it crashed at 610. Now it crashes at 844.Even when I do this 

import zipfile

zfile=raw_input("Please input zip's file name\n")
zipf = zipfile.ZipFile( zfile, 'r' )
zipf.setpassword('844')
zipf.extractall()
zipf.close()  

it crashes with the error in my first post.
If this is any help, i'm using python 2.6.6 on linux and the number changed from 610 to 844 when I opened a new terminal window.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10876>
_______________________________________


More information about the Python-bugs-list mailing list