Skip to content

Instantly share code, notes, and snippets.

@s3rgeym
Forked from Finkregh/bruteforce-encfs.sh
Created September 25, 2022 02:20
Show Gist options
  • Save s3rgeym/06bf3a8485dacb8beb4c686db07186cd to your computer and use it in GitHub Desktop.
Save s3rgeym/06bf3a8485dacb8beb4c686db07186cd to your computer and use it in GitHub Desktop.
bruteforce encfs
#!/bin/sh
# initially from http://bredsaal.dk/cracking-encfs-made-easier
# usage: crackencfs.sh /path/to/encrypted/folder /path/to/mountpoint /path/to/wordlist
counter=1
while [ true ]; do
echo "$(head -n $counter $3 | tail -n 1)" | encfs $1 $2 --stdinpass
if [ $? -eq 0 ]; then
echo Key recovered - the password is:
echo "$(head -n $counter $3 | tail -n 1)"
exit
fi
counter=$(($counter + 1))
done
# split password-list in e.g. 390-line-files:
split -l 390 pwlist.txt pwlist-split-
# run bruteforce in parallel:
for PWLIST in $(ls pwlist-split-*) ; do mkdir /tmp/${PWLIST} ; nice bash bruteforce-encfs.sh ~/encfs-dir /tmp/${PWLIST} ${PWLIST} >> /tmp/crack.log 2>&1 & done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment