Important alert: (current site time 9/2/2014 7:14:14 AM EDT)
 

VB icon

mandy5.pl

Email
Submitted on: 2/2/2009 9:23:50 AM
By: David Keaton 
Level: Intermediate
User Rating: Unrated
Compatibility: 5.0 (all versions)
Views: 13788
author picture
(About the author)
 
     mandy5.pl is a MD5 brute forcing script, and is used in complement to mandymake.pl. Works by comparing tables to the current hash being bashed.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
=**************************************
= Name: mandy5.pl
= Description:mandy5.pl is a MD5 brute forcing script, and is used in complement to mandymake.pl.
Works by comparing tables to the current hash being bashed.
= By: David Keaton
=
= Inputs:2 arguments are taken
file type (-n, -l, -u, etc.) which is explained in the readme.txt file I have on my computer, if you request it I will post it. But there is also a mini instruction man if no arguments are filled when you try to execute.
=
= Returns:returns the MD5 hash (32 char hex) word written in ASCII. (Compares values and assumes that it is the correct hash.)
=
= Assumes:This script is USED IN COMPLEMENT WITH mandymake.pl
Needed to make the tables for this script to compare values to against the hash being bashed.
Previous (well tested) version IS available on my HDD, but this version is superior. This version increases reliability by using temp arrays, less memory usage, better inputs instead of file name fields (except for text containing hash, that won't change).
as this is a perl script, you will not need to install anything EXCEPT a perl interpreter if you are a Windows user.
=
= Side Effects:VERY memory intensive if you try to make tables ~6 or higher. Working on optimizing it to use WAY less memory, and the tables can become QUITE hard drive intensive. Larger tables are also VERY HDD intensive, as Rainbow tables are.
=
=This code is copyrighted and has= limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=793&lngWId=6=for details.=**************************************

#!usr/bin/perl
#this is an MD5 bruteforcer, it first makes a table of generated MD5, then test the MD5 with the input.
use Time::HiRes qw(gettimeofday);
use Switch;
if (@ARGV < 2){info();}
#this input will be the file that we bruteforce and the tables we will use.
$MD5set = shift(@ARGV);
$file = shift(@ARGV);
#setting the filehandle to our hash file. set timer.
if ($MD5set !~ m/^-[l|u|m|n]/){
 die "Flag must be a do-able flag!\n";
}
switch($MD5set){
 case "-l" {$MD5file = "MD5cmpLower.txt";}
 case "-u" {$MD5file = "MD5cmpUpper.txt";}
 case "-m" {$MD5file = "MD5cmpMulti.txt";}
 case "-n" {$MD5file = "MD5cmpNumber.txt";}
}
Start:
open(FILEZ, "<$file");
$t1 = gettimeofday();
if ($file !~ m/.+?\.txt/){
die "This file must be in a valid .txt format!\n\n";
 }
while(<FILEZ>){
 $line = $_;
 chomp($line);
 $line =~ m/^.+:(.+)?$/;
 $hash = $1;
 }
close(FILEZ);
#we closed FILEZ and stored both the user and the hash to their according variables. We now open the table to compare them.
open(MD5, "<$MD5file") || die "Unable to find MD5cmp.txt! Make sure you ran mandymake.pl prior to running this program!\n\n";
$y = 0;
while(<MD5>){
 my ($cashew) = $_;
 chomp($cashew);
 if ($cashew !~ /\n/){
$cashew =~ m/(.+)?:(.+)?$/;
$letter = $1;
$hash_right = $2;
@array_l[$y] = $letter;
@array_h[$y] = $hash_right;
$y++;
}
 }
print "\n" x 50;
print "Analyzing..\n\n";
for ($z = 0; $z < $y; $z++){
 if(@hash_array[$z] =~ $hash){
print "@array_l[$z] || @array_h[$z]\n";
print "Please redraw tables and rematch for consistency, although this\nis more than likely it.";
$t2 = gettimeofday();
$time_of_crack = $t2 - $t1;
print "\nCrack took $time_of_crack" . "s" . " " . "to complete\n";
$bool = 1;
 }
delete @array_l[$z];
delete @array_h[$z];
}
if ($bool != 1){
 $t3 = gettimeofday();
 $time_of_crack = $t3 - $t1;
 print "\nTime taken to finish: " . "$time_of_crack" . "s". "\n";
 print "Sorry, could not find hash in table, please redraw size or type.\n";
 print "'perl mandymake.pl /type/ /size/'\n\n";
}
sub info{
print q(
You must enter the MD5 file you want to brute,
and the flag referencing to the file you want to brute with.
Example: 'perl mandy5.pl -X xxx.txt'
where xxx.txt is the name of the file that 
contains the hash, and -X is the flag referencing
the type of hash table.
);
return 0;}


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.