Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Crypto-Brute.sh v0.9(c) JF1976 2012 - for legal purposes only
- #
- wordlist=${1} #
- wordcount=`wc -l ${1} | awk '{print $1}'`
- dfile=${2} #
- tmpfile="/tmp/$(basename $2).$$.tmp" #
- # ${3} Expected output type (ASCII, ELF, Bourne-Again, ...)
- for cipher in `openssl list-cipher-commands`
- do
- echo -en "[TRYING\t${cipher} | $wordcount Word(s)\t]\n"
- while getword=`line`
- do
- # build a list of paramaters form our variables.
- myargs="enc -d -$cipher -in $dfile -out $tmpfile -k $getword"
- # call openssl with our arguments / paramaters send stderr(2) stdout(1) to /dev/null
- `openssl $myargs >/dev/null 2>&1`
- if [ -f ${tmpfile} ]; then
- validate=`head -n 1 ${tmpfile} | file --brief - | awk '{print $1}'`
- # awk '{print $0}' give the whole string and would be much better for validation.
- # ASCII text, with CRLF line terminators
- # awk '{print $1}' give just the first word / string returned but is not reliable.
- #
- # echo $validate # to debug returned values.
- fi
- if [ "$validate" != "ASCII" ]; then # text, with CRLF line terminators' ]; then
- if [ -f ${tmpfile} ]; then
- rm ${tmpfile}
- fi
- else
- # echo -e "i'v3 g0t th3 c00ki3s if y0u'v3 g0tmi1k" # thanks for the inspiration ;)
- echo -e "[CIPHER\t\t${cipher}\t| PASS\t\e[1;32${getword}\e[00m\t]\a" # enjoy.
- echo -e "[CMD openssl $myargs ]"
- exit 1
- fi
- done < ${wordlist}
- done
- echo "[DONE!] all ${wordcount} word(s) tested with no results :( "
- exit 0
- # --[ The END. ]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement