Created
February 22, 2021 03:00
-
-
Save Rajchowdhury420/5e8d8375f0ca14049efae2d2b5121a2d to your computer and use it in GitHub Desktop.
A recursive Zip file cracker Script for CTF solves
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while [ -e *.zip ]; do | |
files=*.zip; | |
for file in $files; do | |
echo -n "Cracking ${file}… "; | |
output="$(fcrackzip -u -l 1-6 -c '1' *.zip | tr -d '\n')"; | |
password="${output/PASSWORD FOUND\!\!\!\!: pw == /}"; | |
if [ -z "${password}" ]; then | |
echo "Failed to find password"; | |
break 2; | |
fi; | |
echo "Found password: \`${password}\`"; | |
unzip -q -P "${password}" "$file"; | |
rm "${file}"; | |
done; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment