I made a password protected zip file with 7zip, using ZipCrypto algorithm. Set the password to 1234.
I am using john-1.7.9-jumbo-7. I followed this manual: http://www.cybercrimetech.com/2014/07/how-to-cracking-zip-and-rar-protected.html All seems good, but somehow it doesn't crack the password.

Made my own password list, containing three lines:


No luck.
When I use AES-256 john cracks the password, no problem.

If I just use unzip:

$ unzip test.zip 
Archive:  test.zip
    creating: test/
    creating: test/Perl64/
    creating: test/Perl64/bin/
[test.zip] test/Perl64/bin/a2p.exe password:

When I enter 1234, works perfect.

Anybody an idea what I'm doing wrong?

Here are my steps: Working dir: /install/john-1.7.9-jumbo-7/run (just after successful compilation)

run $ ./zip2john test.zip > test.zip.hashes
run $ cat test.zip.hashes 
run $ rm john.rec john.pot
run $ ./john test.zip.hashes
Loaded 1 password hash (PKZIP [32/64])
guesses: 0  time: 0:00:00:10 0.00% (3)  c/s: 3415K  trying: cd4640 - cd46a1

If the password is 1234, then John should find it relatively quickly.

I just tried your hash with JoT, and I am not finding anything. If you are using zipCrypto, I am guessing zip2john does not understand how the password hash is being stored. You can either attempt to find the hash and update zip2john, or try to attack the zip file directly.

See the code below as an example of having John generate the password then passing it to 7zip to try. This should work regardless of chosen encryption, unless you have to specify it when opening the archive. It is not clean, but it should be enough to illustrate.

# Using john the ripper to brute-force a zip container
if [ $(file $1 | grep -c "Zip archive data") ]; then
    john -i --stdout | while read i; do   # this is john generating password to stdout
        echo -ne "\rtrying \"$i\" "\\r
        7z -p$i -so e $1 2>&1> /dev/null     # this is your zip command
        if [ $STATUS -eq 0 ]; then
            echo -e "\nPassword is: \"$i\""
            break                         # if successful, print the password and quit
    echo "Start time $startTime"
    echo "End time $(date)"
    echo "The file does not appear to be a zip file"

This approach should work when you are unable to extract the hash, but is much, much slower (not really practical for most applications). See the results below.

trying "pmc" 
7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-1
Processing archive: test.zip
Extracting  Sample_memo.pdf     Data Error in encrypted file. Wrong password?
**Sub items Errors: 1**

trying "1234" 
7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Processing archive: test.zip
Extracting  Sample_memo.pdf
**Everything is Ok**
Size:       60936
Compressed: 51033

Password is: "1234"
Start time 2015. 01. 03. (토) 19:02:51 KST
End time 2015. 01. 03. (토) 19:02:51 KST

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.