Guest User

Multi CMS Hash Cracker v0.1

a guest
Jun 13th, 2011
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 4.28 KB | None | 0 0
  1. #!usr/bin/perl
  2. use Digest::MD5  qw(md5_hex);
  3. use Digest::SHA1  qw(sha1_hex);
  4.  
  5. # Author: localh0t
  6. # Date: 09/06/11
  7. # Follow: @mattdch
  8.  
  9. # Help
  10.  
  11. if(!$ARGV[7])
  12.     {
  13.          print "\n\n###########################################";
  14.          print "\n# Multi CMS Hash Cracker v0.1 by localh0t #";
  15.              print "\n###########################################";
  16.          print "\n\nUse: perl $0 -d [WORLDLIST FOLDER] -h [MD5 | SHA-1 HASH] -s [SALT | USERNAME] -c [CMS]\n";
  17.          print "Example: perl $0 -d /home/localh0t/wordlists/ -h caef8544a8e65e23f67ab844d4866e8d -s uZ*qX -c IPB\n";
  18.          print "Example: perl $0 -d /home/localh0t/wordlists/ -h dc4a27b25e3f780b89c165f931d6f85d5bd6e33e -s Administrator -c SMF\n\n";
  19.          print "Note: Worlists must end with .txt or .lst (or any extension)\n\n"; 
  20.          print "Support:\n========\n";
  21.          print "VB     : md5_hex(md5_hex(password).salt)           | (vBulletin)\n";
  22.          print "SMF    : sha1_hex(user.password)                   | (Simple Machines Forum)\n";
  23.          print "IPB    : md5_hex(md5_hex(salt).md5_hex(password))  | (Invision Power Board)\n";
  24.          print "JOOMLA : md5_hex(password.salt)                    | (Joomla 1.x)\n\n";
  25.          exit(0);
  26.     }
  27.  
  28.  
  29. # Functions
  30.  
  31. sub ipb_cracker{
  32.     my $hash = shift;
  33.     my $salt = shift;
  34.     my $dir  = shift;
  35.     foreach $file (@FILES) {
  36.     open(DICT,"<".$dir.$file) || die "\n[-] Error opening $file\n\n";
  37.     print "[!] Using $file...\n";
  38.             foreach $password(<DICT>) {
  39.                 $password=~s/\s|\n//;
  40.                 chomp($password);
  41.                 $cracked = md5_hex(md5_hex($salt).md5_hex($password));
  42.                 if ($cracked eq $hash) {
  43.                     return "[+] Hash cracked !: $password\n\n";
  44.                 }
  45.             }
  46.     print "[!] Nothing found with $file...\n\n";
  47.     }
  48.     return "\n[-] Password not found\n\n";
  49. }
  50.  
  51. sub vb_cracker{
  52.     my $hash = shift;
  53.     my $salt = shift;
  54.     my $dir  = shift;
  55.     foreach $file (@FILES) {
  56.     open(DICT,"<".$dir.$file) || die "\n[-] Error opening $file\n\n";
  57.     print "[!] Using $file...\n";
  58.             foreach $password(<DICT>) {
  59.                 $password=~s/\s|\n//;
  60.                 chomp($password);
  61.                 $cracked = md5_hex(md5_hex($password).$salt);
  62.                 if ($cracked eq $hash) {
  63.                     return "[+] Hash cracked !: $password\n\n";
  64.                 }
  65.             }
  66.     print "[!] Nothing found with $file...\n\n";
  67.     }
  68.     return "\n[-] Password not found\n\n";
  69. }
  70.  
  71. sub smf_cracker{
  72.     my $hash = shift;
  73.     my $user = shift;
  74.     my $dir  = shift;
  75.     foreach $file (@FILES) {
  76.     open(DICT,"<".$dir.$file) || die "\n[-] Error opening $file\n\n";
  77.     print "[!] Using $file...\n";
  78.             foreach $password(<DICT>) {
  79.                 $password=~s/\s|\n//;
  80.                 chomp($password);
  81.                 $cracked = sha1_hex($user.$password);
  82.                 if ($cracked eq $hash) {
  83.                     return "[+] Hash cracked !: $password\n\n";
  84.                 }
  85.             }
  86.     print "[!] Nothing found with $file...\n\n";
  87.     }
  88.     return "\n[-] Password not found\n\n";
  89. }
  90.  
  91. sub joomla_cracker{
  92.     my $hash = shift;
  93.     my $salt = shift;
  94.     my $dir  = shift;
  95.     foreach $file (@FILES) {
  96.     open(DICT,"<".$dir.$file) || die "\n[-] Error opening $file\n\n";
  97.     print "[!] Using $file...\n";
  98.             foreach $password(<DICT>) {
  99.                 $password=~s/\s|\n//;
  100.                 chomp($password);
  101.                 $cracked = md5_hex($password.$salt);
  102.                 if ($cracked eq $hash) {
  103.                     return "[+] Hash cracked !: $password\n\n";
  104.                 }
  105.             }
  106.     print "[!] Nothing found with $file...\n\n";
  107.     }
  108.     return "\n[-] Password not found\n\n";
  109. }
  110.  
  111. my ($dir, $hash, $salt, $cms, $arg);
  112.  
  113. foreach $loop (@ARGV) {
  114.     for ($loop) {
  115.         /^-d$/ and do { $dir = $ARGV[($arg+1)]; last; };
  116.         /^-h$/ and do { $hash = $ARGV[($arg+1)];  last; };
  117.         /^-s$/ and do { $salt = $ARGV[($arg+1)]; last; };
  118.         /^-c$/ and do { $cms = $ARGV[($arg+1)]; last; };
  119.     }
  120.     $arg++;
  121. }
  122.  
  123.  
  124. # Main
  125.  
  126. print "\n[!] Cracking $hash with $salt as username/salt...\n\n";
  127.  
  128. opendir(DIR, $dir) || die "\n[-] Folder not found\n\n";
  129.  
  130. while($file = readdir(DIR)) {
  131.      if ($file ne '.' and $file ne '..') {
  132.     $FILES[$clean] = $file;
  133.     $clean++;
  134.      }
  135. }
  136.  
  137. for ($cms) {
  138.   /^IPB$/    and do { $result = &ipb_cracker($hash,$salt,$dir); last; };
  139.   /^VB$/     and do { $result = &vb_cracker($hash,$salt,$dir);  last; };
  140.   /^SMF$/    and do { $result = &smf_cracker($hash,$salt,$dir); last; };
  141.   /^JOOMLA$/ and do { $result = &joomla_cracker($hash,$salt,$dir); last; };
  142.   /^.$/      and do { print "[-] CMS not available\n"; exit(0); last; };
  143. }
  144.  
  145. print $result;
  146.  
  147. # Exit
  148.  
  149. close(DICT);
  150. closedir(DIR);
  151. exit(0);
  152.  
  153. __END__
Add Comment
Please, Sign In to add comment