Important alert: (current site time 7/15/2013 5:48:02 AM EDT)
 

VB icon

mandymake.pl

Email
Submitted on: 2/2/2009 9:24:07 AM
By: David Keaton 
Level: Intermediate
User Rating: Unrated
Compatibility: 5.0 (all versions)
Views: 10325
author picture
(About the author)
 
     mandymake.pl (used with mandy5.pl) is a MD5 Hash making script which creates .txt files that contain tables based on user input as to which type (lowercase, uppercase, numbers only, multiple fields) and the length of the table (if 16 is entered for maximum character length it will generate EVERY possible combination of character type possible.)
 
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: mandymake.pl
= Description:mandymake.pl (used with mandy5.pl) is a MD5 Hash making script which creates .txt files that contain tables based on user input as to which type (lowercase, uppercase, numbers only, multiple fields) and the length of the table (if 16 is entered for maximum character length it will generate EVERY possible combination of character type possible.)
= By: David Keaton
=
= Inputs:two inputs, which are shifted through program call.
ex: perl mandymake.pl -n 16 will create a 16 character long number table.
(Command reflected in Linux console commands)
=
= Returns:The returns are tables created through the specification of inputs. There is no console returns other than the notification that the table is done, what type of table it is, and max character length.
=
= Assumes:Main thing, if you do NOT have a perl interpreter (Linux should be distributed with one, and Windows is more than likely not going to have one), you will have to download it and install it. Otherwise, this script needs no installation, and will run on the fly through a cmd/console command.
This current code is under testing, and the multi field is a basic compilation. Currently working on converting Multi field into a field that generates lowercase, uppercase, and numbers.
If you do not know what to enter, leave all arguments blank and execute, their should be an up-to-date-quickie-manual describing basic functions of the script.
=
= Side Effects:This program is VERY HDD intensive, a 10 character max number table (this generates EVERY possible number up to 10 characters. 0-9999999999) and their appropriate hash (32 char hex) will take up >40 gigs. This is intensive just as Rainbow tables would be. Currently working on a way to optimize the size of these files.
=
=This code is copyrighted and has= limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=794&lngWId=6=for details.=**************************************

#!usr/bin/perl
#this is the table maker for Mandy5
use Digest::MD5;
use Switch;
if (@ARGV < 2){info();}
#using shift(@ARGV) to get paramaters for how long of a string we reach until we stop the tablemake.
#using shift@ARGV) to get first parameter of what kinds of tables will be made.
$state = shift(@ARGV);
$max = shift(@ARGV);
$max++;
#regexp's to check and see if the arguments are what they need to be.
if ($state !~ m/^-[l|u|m|n|a]/){
 die "\nYou must enter a valid type for flags!\n";
}
if ($state =~ m/.{3,}/){
 die "\nYou must enter a valid type for flags!\n";
}
if ($max !~ m/\d+/){
 die "\nYou must enter a digit for character length!\n";
}
#next lines of code make the MD5 codesets in lowercase.
switch($state){
case "-l"		{goto lower;}
case "-u"		{goto upper;}
case "-m"		{goto multi;}
case "-n"		{goto number;}
case "-a"		{goto lower;}
case default	{info();}
}
lower:
$lc_let = a;
#debug info: at this point both variables (lc_let + trans) are being made properly.
$eax = 0;
open(MAKELOW,">MD5cmpLower.txt");
close(MAKELOW);
while($eax < $max){
 open(MAKELOWER, ">>MD5cmpLower.txt");
 use Digest::MD5 qw(md5_hex);
 $trans = md5_hex($lc_let);
 print MAKELOWER "$lc_let" . ":" . "$trans";
 print MAKELOWER "\n\n";
 $lc_let++;
 close(MAKELOWER);
 $eax = length($lc_let);
 }
exit unless ($state == "-a");
#next lines of code make the MD5 Codeset in uppercase...
upper:
$up_let = A;
$eax = 0;
open(MAKEHIGH, ">MD5cmpUpper.txt");
close(MAKEHIGH);
while($eax < $max){
 open(MAKEUPPER, ">>MD5cmpUpper.txt");
 use Digest::MD5 qw(md5_hex);
 $trans = md5_hex($up_let);
 print MAKEUPPER "$up_let" . ":" . "$trans";
 print MAKEUPPER "\n\n";
 $up_let++;
 close(MAKEUPPER);
 $eax = length($up_let);
 }
exit unless ($state == "-a");
#next lines of code will make the MD5 Codeset in lowercase with numbers...
multi:
$lc_let = a;
$eax = 0;
$x = 0;
open(MAKEMULTI, ">MD5cmpMulti.txt");
close(MAKEMULTI);
while($eax < $max){
 open(MAKEMULTI, ">>MD5cmpMulti.txt");
 use Digest::MD5 qw(md5_hex);
 $total = "$lc_let" . "$x";
 $trans = md5_hex($total);
 print MAKEMULTI "$lc_let" . "$x" . ":" . "$trans";
 print MAKEMULTI "\n\n";
 if ($x == 9){
	$x = 0;
	$lc_let++;
	goto pass;}
 $x++;
 pass:
 close(MAKEMULTI);
 $total = "$lc_let" . "$x";
 $eax = length($total);
 }
exit unless ($state == "-a");
#next lines of code will make the MD5 Codeset in numbers.
number:
$num = 0;
$eax = 0;
open(MAKENUMBER, ">MD5cmpNumber.txt");
close(MAKENUMBER);
 while($eax < $max){
open(MAKENUMBER, ">>MD5cmpNumber.txt");
use Digest::MD5 qw(md5_hex);
$trans = md5_hex($num);
print MAKENUMBER "$num" . ":" . "$trans";
print MAKENUMBER "\n\n";
$num++;
close(MAKENUMBER);
$eax = length($num);
 }
exit unless ($state == "-a");
print "\n";
print "\n\nDONE!\n\n";
$max--;
print "$max character table made in mode $state =]\n";
close(MAKELOWER);
close(MAKEUPPER);
close(MAKEMULTI);
close(MAKENUMBER);
sub info{
print "\nex: 'perl mandymake.pl a 16' (use for 16 characters using all";
print "\nmethods)";
print "\nex: 'perl mandymake.pl n 10' (use only numbers for a 10 character";
print "\n:table)";
print "\nflags:";
print "\n-l	--	make table with only lowercase";
print "\n-u	--	make table with only uppercase";
print "\n-m	--	make table with a mixture of alphanumeric";
print "\n	(last character is number, rest are alpha)";
print "\n-n	--	make table with only numbers";
print "\n-a	--	make table with all types (takes the longest)";
exit;}
#for use with first case capital, rest lower.
#need to put this above the iterator -1 EIP
#open (TEMP, ">temp.txt");
#print TEMP "$up_let";
#while (<TEMP>){
#$regexp =~ m/^.+?:/;
#}
#$total = length($regexp);
#close(TEMP);
#NOTES:
#need to make with Capitalization with and without numbers


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.