Skip to content

Instantly share code, notes, and snippets.

@Finkregh
Created June 16, 2015 18:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Finkregh/4864521a29a3fa204dc9 to your computer and use it in GitHub Desktop.
Save Finkregh/4864521a29a3fa204dc9 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
@Javier-Dev
Copy link

After trying bruteforce-encfs.sh script, two notes:

  1. encfs requires absolute paths
  2. script does not support spaces in paths. To support this double quote $1 and $2 variables in line 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment