#!/usr/bin/perl
use strict;
use warnings;
use Digest::MD5 qw(md5_hex);
sub usage(){
print "nt******** Splash Md5 cracker! *********nn";
print "t Usage: $0 <hash-file> <wordlist>nn";
print "t**************************************nn";
}
my $hashplace=shift;
my $wlistplace=shift;
if(!$wlistplace){
usage();
exit;
}
open(HASH,$hashplace) || die "Could not open hash: $!n";
chomp(my $hash=<HASH>);
close(HASH);
if(length($hash)!=32){
die "t$hash is not a valid md5-hash!n";
}
if($hash !~ /d|[a-f]{32}/g){
die "t$hash is not a valid md5-hash!n";
}
open(WLIST,$wlistplace) || die "Could not open wordlist: $!n";
while(<WLIST>){
chomp($_);
chomp(my $md5=md5_hex($_));
print "$md5 != $hashn";
if($md5 eq $hash){
die "tHash successfully cracked!nnt$hash == $_nn";
}
}
close(WLIST);
print "Hash not found in wordlistn";