#!/bin/sh ############################################ ############################################ # # MD5Crack # Author: SkyOut # Date: August 2007 # Website: http://wired-security.net # # # This program will simply try to crack a MD5 # hash by comparing it with a wordlist files # values! # # # The script has been tested on OpenBSD 4.1 # using the KSH! # # # Usage: md5crack.sh [hash] [wordlist] # ############################################ ############################################ # # Parameters, that are used by the program # hash=$1 wordlist=$2 # # Display the usage dialogue # function usage { echo "Usage: md5crack.sh [hash] [wordlist]" echo "Example: md5crack.sh 63a9f0ea7bb98050796b649e85481845 wordlist.txt" } # # Make sure a hashvalue has been given # if [ "$hash" == "" ] then usage exit 0 fi # # Make sure the wordlist file really exists # if [ ! -e "$wordlist" ] then usage exit 0 fi # # Go through the wordlist file line by line # and calculate the MD5 values. Finally compare # them to the value given by the user. # while read -r line do md5hash=`md5 -s $line` md5hash=`echo $md5hash | awk '{print $4}'` if [ "$hash" == "$md5hash" ] then echo "Hashvalue found: $hash = $line" exit 0 fi done < $wordlist