John the Ripper:破解 ZipCrypto 密码

John the Ripper:破解 ZipCrypto 密码

我使用 7zip 制作了一个受密码保护的 zip 文件,使用了 ZipCrypto 算法。将密码设置为 1234。
我使用的是 john-1.7.9-jumbo-7。我遵循了以下手册:http://www.cybercrimetech.com/2014/07/how-to-cracking-zip-and-rar-protected.html 一切看起来都很好,但不知何故它无法破解密码。

制作了我自己的密码列表,包含三行:

你好
1234
穆哈

运气不好。
当我使用 AES-256 时,约翰破解了密码,没有问题。

如果我仅使用 unzip:

$ 解压缩测试.zip
存档:test.zip
    创建:测试/
    创建:测试/Perl64/
    创建:test/Perl64/bin/
[test.zip] test/Perl64/bin/a2p.exe 密码:

当我输入 1234 时,一切完美。

有人知道我做错了什么吗?

以下是我的步骤:工作目录:/install/john-1.7.9-jumbo-7/run(编译成功后)

运行 $ ./zip2john test.zip > test.zip.hashes
运行 $ cat test.zip.hashes
测试.zip:$pkzip$3*1*1*5*0*83*61e5*9a86da2553753dc102b07f0386675aa8c3ed0f25ee9dc0c0dd385639ded7a43051da28bd09b3c2b80f0bdaab0738c50d458c0e00d2eb0997a54bc6128d54c12f1212d865a240b14dcf68e64f4c1765d20314f1ef7b10db3 c901a58e3bebd2841cd39a4bbfd09c4d8febab6101cb93c631d39216083e3be16fcefa3c5cb760b39da6568*1*2*8*c0*10c1*f656f9947fdb2ba2339f4c6a2b12479b87338da5fdd9c1c8820d9b0551720a9ff842a0d45bab6a985a59447d975994b1d353c69e937c 1a4aac0fa4095bcbc8c73b363bbfe5b7b66ee078ea0a5b713472202e9ef3958bd6198b5a8b3636e0ea38d541ac40441ad0cf429b0e531d6f7b53edd9f1ffed94332ad4cb10ea5a8c7e373ab8be7a8541024ef327211c698cf0548d1c14fe5ae45698413323153e573 32e0f304a3dcf66b0181b6f4d5177ed3f6c189377f9d3a4c4f104c3e118c7551403*2*0*2f*23*33d86f80*23638a*37*0*2f*33d8*0f00cdb657782dbf8b10befb485b3d0ccdf366c10bc511c171889055d1bced5f38ce8b423198ea70a67a1a84466667*$/pkzip$
运行 $ rm john.rec john.pot
运行 $ ./john test.zip.hashes
已加载 1 个密码哈希 (PKZIP [32/64])
猜测:0 时间:0:00:00:10 0.00% (3) c/s:3415K 尝试:cd4640 - cd46a1

答案1

如果密码是 1234,那么 John 应该很快就能找到它。

我刚刚用 JoT 尝试了你的哈希,但没有找到任何东西。如果你使用的是 zipCrypto,我猜 zip2john 不理解密码哈希是如何存储的。你可以尝试找到哈希并更新zip2john,或者尝试直接攻击zip文件。

请参阅下面的代码,其中 John 生成密码,然后将其传递给 7zip 进行尝试。无论选择哪种加密方式,这都应该有效,除非您必须在打开存档时指定它。它并不干净,但应该足以说明问题。

#!/bin/bash
# Using john the ripper to brute-force a zip container
startTime=$(date)
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
        STATUS=$?
        if [ $STATUS -eq 0 ]; then
            echo -e "\nPassword is: \"$i\""
            break                         # if successful, print the password and quit
        fi
    done
    echo "Start time $startTime"
    echo "End time $(date)"
else
    echo "The file does not appear to be a zip file"
fi

当您无法提取哈希值时,此方法应该有效,但速度要慢得多(对于大多数应用程序来说并不实用)。请参阅下面的结果。

...
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

相关内容