Skip to content

Instantly share code, notes, and snippets.

@adithyaxx
Created July 27, 2018 06:45
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Script to recursively brute-force and extract password protected zip files
#!/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