MD5 Hash Bruteforce Kit

Skapad 4 år sedan, skriven i Perl, med 409 visningar.
URL http://kod.perl.se/view/fab8619c Bädda in
Ladda hem koden eller visa koden i råformatVisa bredare version
  1. #!/usr/bin/perl
  2. # MD5 Hash Bruteforce Kit
  3. # Contact: facebook.com/pqpigor
  4. # Info[0] : This Cracker is the fastest it helped me alot to find passwords ;)
  5. # Info[1] : Written under Kubuntu Linux (Throw away Windows!)
  6. # Info[2] : If you can code a bit perl, you can modify it to crack sha etc too...
  7. # Greets to: Invisible!
  8. $ver = "01";
  9. $dbgtmr = "1"; #Intervall of showing the current speed + lastpassword in seconds.
  10.  
  11. if ($dbgtmr<=0){ die "Set dbgtmr to a value >=1 !\n";};
  12. use Digest::MD5 qw(md5_hex);
  13. use Time::HiRes qw(gettimeofday);
  14.  
  15. if ($ARGV[0]=~"a") {
  16.  $alpha = "abcdefghijklmnopqrstuvwxyz";}
  17. if ($ARGV[0]=~"A") {
  18.  $alpha = $alpha. "ABCDEFGHIJKLMNOPQRSTUVWXYZ";}
  19. if ($ARGV[0]=~"d") {
  20.  $alpha = $alpha."1234567890";}
  21. if ($ARGV[0]=~"x") {
  22.  $alpha = $alpha. "!\"\$%&/()=?-.:\\*'-_:.;,";}
  23.  
  24. if ($alpha eq "" or $ARGV[3] eq "") {usage();};
  25. if (length($ARGV[3]) != 32) { die "Sorry but it seems that the MD5 is not valid!\n";};
  26.  
  27. print "Selected charset for attack: '$alpha\'\n";
  28. print "Going to Crack '$ARGV[3]'...\n";
  29.  
  30. for (my $t=$ARGV[1];$t<=$ARGV[2];$t++){
  31.  crack ($t);
  32. }
  33.  
  34. sub usage{
  35.  print "\n\nMD5 Hash Bruteforce Kit v_$ver\n";
  36.  print "sniper code sniper_c0de\n";
  37.  print "sniper code\/\n\n";
  38.  print "USAGE\n";
  39.  print "./md5crack <charset> <mincount> <maxcount> <yourMD5>\n";
  40.  print " Charset can be: [aAdx]\n";
  41.  print " a = {'a','b','c',...}\n";
  42.  print " A = {'A','B','C',...}\n";
  43.  print " d = {'1','2','3',...}\n";
  44.  print " x = {'!','\"',' ',...}\n";
  45.  print "EXAMPLE FOR CRACKING A MD5 HASH\n";
  46.  print "./md5crack.pl ad 1 3 900150983cd24fb0d6963f7d28e17f72\n";
  47.  print " This example tries to crack the given MD5 with all lowercase Alphas and all digits.\n";
  48.  print " MD5 Kit only tries combinations with a length from 1 and 3 characters.\n-------\n";
  49.  print "./md5crack.pl aA 3 3 900150983cd24fb0d6963f7d28e17f72\n";
  50.  print " This example tries to crack the given MD5 with all lowercase Alphas and all uppercase Alphas.\n";
  51.  print " MD5 Kit only tries passwords which length is exactly 3 characters.\n-------\n";
  52.  print "./md5crack.pl aAdx 1 10 900150983cd24fb0d6963f7d28e17f72\n";
  53.  print " This example tries to crack the given MD5 with nearly every character.\n";
  54.  print " MD5 Kit only tries combinations with a length from 1 to 10 characters.\n";
  55.  die "Quitting...\n";
  56. }
  57.  
  58. sub crack{
  59.  $CharSet = shift;
  60.  @RawString = ();
  61.  for (my $i =0;$i<$CharSet;$i++){ $RawString[i] = 0;}
  62.  $Start = gettimeofday();
  63.  do{
  64.   for (my $i =0;$i<$CharSet;$i++){
  65.    if ($RawString[$i] > length($alpha)-1){
  66.     if ($i==$CharSet-1){
  67.     print "Bruteforcing done with $CharSet Chars. No Results.\n";
  68.     $cnt=0;
  69.     return false;
  70.    }
  71.    $RawString[$i+1]++;
  72.    $RawString[$i]=0;
  73.    }
  74.   }
  75. ###################################################
  76.    $ret = "";
  77.    for (my $i =0;$i<$CharSet;$i++){ $ret = $ret . substr($alpha,$RawString[$i],1);}
  78.    $hash = md5_hex($ret);
  79.    $cnt++;
  80.    $Stop = gettimeofday();
  81.    if ($Stop-$Start>$dbgtmr){
  82.     $cnt = int($cnt/$dbgtmr);
  83.     print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
  84.     $cnt=0;
  85.     $Start = gettimeofday();
  86.    }
  87.             print "$ARGV[3] != $hash ($ret)\n";
  88.    if ($ARGV[3] eq $hash){
  89.     die "\n**** Password Cracked! => $ret\n";
  90.    }
  91. ###################################################
  92.   #checkhash($CharSet)."\n";
  93.  
  94.   $RawString[0]++;
  95.  }while($RawString[$CharSet-1]<length($alpha));
  96. }
  97.  
  98. sub checkhash{
  99.  $CharSet = shift;
  100.  $ret = "";
  101.  for (my $i =0;$i<$CharSet;$i++){ $ret = $ret . substr($alpha,$RawString[$i],1);}
  102.  $hash = md5_hex($ret);
  103.  $cnt++;
  104.  $Stop = gettimeofday();
  105.  if ($Stop-$Start>$dbgtmr){
  106.   $cnt = int($cnt/$dbgtmr);
  107.   print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
  108.   $cnt=0;
  109.   $Start = gettimeofday();
  110.  }
  111.  
  112.  if ($ARGV[3] eq $hash){
  113.   die "\n**** Password Cracked! => $ret\n";
  114.  }
  115.  
  116. }

Svara på "MD5 Hash Bruteforce Kit"

Här kan du skriva ett svar till kodsnutten ovan