Password Cracking
AES Encryption Cracking
Convert AES file to hashcat format
Download conversion script
curl "https://raw.githubusercontent.com/hashcat/hashcat/master/tools/aescrypt2hashcat.pl" -o aescrypt2hashcat.plExtract hash from AES file
perl aescrypt2hashcat.pl backup.zip.aes > hashCrack with Hashcat
hashcat -m 22400 -a 0 hash /usr/share/wordlists/rockyou.txtDecrypt the file with the found password
Using pyAesCrypt (Python):
import pyAesCrypt
# Buffer size for file operations (larger = faster for big files)
# 128KB is a good balance between memory usage and speed
bufferSize = 128 * 1024
# The password we cracked
password = "password"
# Decrypt: source.aes -> destination file
pyAesCrypt.decryptFile("file.zip.aes", "file.zip", password, bufferSize)
print("[+] File decrypted successfully")
EOFIs possible to also use the aescrypt tool:
aescrypt -d -p password file.zip.aesZipCrypto Cracking
This attack requires us to know the unencrypted contents of a file that is included in the archive to use that as a clear text reference.
Calculate the Cyclic Redundancy Check (CRC) value of a file to check if it matches the one on the ZIP file:
python3 -c "import binascii; data = open('/FILE/PATH', 'rb').read(); print(hex(binascii.crc32(data) & 0xFFFFFFFF))"Use this command to check the CRC of the compressed files:
7z l -slt <file>Once you have a matching file is possible to perform the attack using bkcrack
First, zip the matching file
zip file.zip filenameThen, we use bkcrack to get the keys of the archive
bkcrack -C target.zip -c .filename -P file.zip -p filenameAfterwards, we can use bkcrack once again to unlock the archive:
bkcrack -C target.zip -k keys -U newtarget.zip yourpasswordNow, we can unzip the new archive with the password you choose
Check this blog
Last updated