Hack Forums
[MD5] BRUTE FORCE [MD5] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43)
+---- Thread: [MD5] BRUTE FORCE [MD5] (/showthread.php?tid=1810550)



[MD5] BRUTE FORCE [MD5] - iX86 - Oct 11, 2011

For those who don't know what this is
It's a MD5 brute forcer :)

Code
#!/usr/bin/perl

# MD5 Hash Bruteforce
# by iX86 ([email protected])

$ver = "01";

$dbgtmr = "1"; #Intervall of showing the current speed + lastpassword in seconds.

if ($dbgtmr<=0){ die "Set dbgtmr to a value >=1 !\n";};
use Digest::MD5 qw(md5_hex);
use Time::HiRes qw(gettimeofday);

if ($ARGV[0]=~"a") {
$alpha = "abcdefghijklmnopqrstuvwxyz";}
if ($ARGV[0]=~"A") {
$alpha = $alpha. "ABCDEFGHIJKLMNOPQRSTUVWXYZ";}
if ($ARGV[0]=~"d") {
$alpha = $alpha."1234567890";}

if ($ARGV[0]=~"x") {

$alpha = $alpha. "!\"\$%&/()=?-.:\\*'-_:.;,";}

if ($alpha eq "" or $ARGV[3] eq "") {usage();};
if (length($ARGV[3]) != 32) { die "Sorry but it seems that the MD5 is not valid!\n";};

print "Selected charset for attack: '$alpha\'\n";
print "Going to Crack '$ARGV[3]'...\n";

for (my $t=$ARGV[1];$t<=$ARGV[2];$t++){
crack ($t);
}

sub usage{
print "\n\nMD5 Hash Bruteforce v_$ver\n";
print "by iX86 ([email protected])\n";
print "USAGE\n";

print "./md5crack <charset> <mincount> <maxcount> <yourMD5>\n";
print " Charset can be: [aAdx]\n";
print " a = {'a','b','c',...}\n";
print " A = {'A','B','C',...}\n";
print " d = {'1','2','3',...}\n";
print " x = {'!','\"',' ',...}\n";
print "EXAMPLE FOR CRACKING A MD5 HASH\n";
print "./md5crack.pl ad 1 3 900150983cd24fb0d6963f7d28e17f72\n";
print " This example tries to crack the given MD5 with all lowercase Alphas and all digits.\n";
print " MD5 only tries combinations with a length from 1 and 3 characters.\n--\n";
print "./md5crack.pl aA 3 3 900150983cd24fb0d6963f7d28e17f72\n";
print " This example tries to crack the given MD5 with all lowercase Alphas and all uppercase Alphas.\n";
print " MD5 only tries passwords which length is exactly 3 characters.\n--\n";
print "./md5crack.pl aAdx 1 10 900150983cd24fb0d6963f7d28e17f72\n";
print " This example tries to crack the given MD5 with nearly every character.\n";
print " MD5 only tries combinations with a length from 1 to 10 characters.\n";
die "Quitting...\n";

}

sub crack{
$CharSet = shift;
@RawString = ();
for (my $i =0;$i<$CharSet;$i++){ $RawString[i] = 0;}

$Start = gettimeofday();
do{
  for (my $i =0;$i<$CharSet;$i++){
   if ($RawString[$i] > length($alpha)-1){
    if ($i==$CharSet-1){
    print "Bruteforcing done with $CharSet Chars. No Results.\n";
    $cnt=0;
    return false;
   }
   $RawString[$i+1]++;
   $RawString[$i]=0;
   }
  }

##

   $ret = "";
   for (my $i =0;$i<$CharSet;$i++){ $ret = $ret . substr($alpha,$RawString[$i],1);}
   $hash = md5_hex($ret);
   $cnt++;
   $Stop = gettimeofday();
   if ($Stop-$Start>$dbgtmr){
    $cnt = int($cnt/$dbgtmr);
    print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
    $cnt=0;
    $Start = gettimeofday();
   }
    print "$ARGV[3] != $hash ($ret)\n";
   if ($ARGV[3] eq $hash){
    die "\n**** Password Cracked! => $ret\n";
   }

##

  #checkhash($CharSet)."\n";

  $RawString[0]++;
}while($RawString[$CharSet-1]<length($alpha));
}

sub checkhash{
$CharSet = shift;
$ret = "";
for (my $i =0;$i<$CharSet;$i++){ $ret = $ret . substr($alpha,$RawString[$i],1);}
$hash = md5_hex($ret);
$cnt++;
$Stop = gettimeofday();
if ($Stop-$Start>$dbgtmr){
  $cnt = int($cnt/$dbgtmr);
  print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
  $cnt=0;
  $Start = gettimeofday();
}

if ($ARGV[3] eq $hash){
  die "\n**** Password Cracked! => $ret\n";
}

}
Anyway I have writen these so if ya need help just say it 😊


* - Greyersting - Oct 11, 2011

Amazing script! Did you really write it?


* - get cha - Dec 5, 2011

Where to add this script so I can use it?


* - ThankYouAndGoodbye - Dec 5, 2011

Script uses a simple loop, nothing massively impressive - i used one to create hashhack.com a few years ago.

The script works in theory but it would take way to long too work through the full character space and your script shows no evidence of multi threading or even forking which is a feature of even basic local brute forcer's now.

Its a fun little script but anyone with any sense would be using a CUDA set up with a few GPU's if they were stupid enough to brute for an MD5 hash on a stand alone system.

Happy Hacking

PS - Leech By Any Chance ?

Code
# MD5 Hash Bruteforce
# by mali sale ([email protected])

http://www.svet-racunara.com/forum/archive/index.php/thread-24.html



* - Daenerys Targaryen - Dec 5, 2011

(Dec 5, 2011 12:33 PM)get cha Wrote:  Where to add this script so I can use it?

It's perl, so you need to run it with perl.
Like: perl script.pl aA 1 7 47bce5c74f589f4867dbd57e9ca9f808

Great script BTW, but I don't think it will be effective with long passwords.




* - TickTockMan - Dec 5, 2011

This is definitely a leech job.

http://ethical-hacking-tutor.blogspot.com/2011/02/how-to-crack-simple-md5.html


* - themomk - Jan 8, 2012

Nice Script....

Thank you very much!!!


* - Dextra - Jan 8, 2012

Nice script!
Thanks for the share.
It's works.



* - king225 - Jan 8, 2012

nice script thnkuu so much gud job dear