Created
July 27, 2018 06:45
-
-
Save adithyaxx/7dda95fbf2fde57d95db03cdfdd5516d to your computer and use it in GitHub Desktop.
Script to recursively brute-force and extract password protected zip files
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