VanGans

MD5 Hash Crack (Bruteforce)

Apr 14th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.61 KB | None | 0 0
  1. # !/usr/bin/perl
  2. # MD5 Hash Crack (Bruteforce)
  3. # Author:VanGans
  4. # facebook : Extazy Hehe
  5. # Date : pwk,2 februari 2019
  6. # 100% working happy friends
  7. # coded with Linux(Ubuntu) thanks to all friends
  8.  
  9. $dbgtmr = "1";
  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]=~"1") {
  16. $alpha = "abcdefghijklmnopqrstuvwxyz";}
  17. if ($ARGV[0]=~"2") {
  18. $alpha = $alpha. "ABCDEFGHIJKLMNOPQRSTUVWXYZ";}
  19. if ($ARGV[0]=~"3") {
  20. $alpha = $alpha."1234567890";}
  21. if ($ARGV[0]=~"4") {
  22. $alpha = $alpha. "!\"\$%&/()=?-.:\\*'-_:.;,";}
  23.  
  24. if ($alpha eq "" or $ARGV[3] eq "") {usage();};
  25. if (length($ARGV[3]) != 32) { die "Error:this is not vailed <MD5>
  26. HASH, it should be 32 character length... \n";};
  27.  
  28. print " Selected charset for attack: '$alpha\' \n";
  29. print " Going to Crack '$ARGV[3]' ...\n";
  30.  
  31. for (my $t=$ARGV[1];$t<=$ARGV[2];$t++){
  32. crack ($t);
  33. }
  34.  
  35. sub usage{
  36. print "MD5 HASH bruteforce Crack v2.0 (Extazy)\n";
  37. print "VanGans - programmer\n";
  38. print "facebook.com/irfanarekporjo\n";
  39. print "Usage:\n";
  40. print "perl r3nw4.pl <charset> <start.from> <length.charset> <MD5>\n";
  41. print " <charset> must be: [1 , 2 , 3 , 4] or together. \n";
  42. print " 1 = {abcdefghijklmnopqrstuvwxyz}\n";
  43. print " 2 = {ABCDEFGHIJKLMNOPQRSTUVWXYZ}\n";
  44. print " 3 = {1234567890}\n";
  45. print " 4 = {!\"\$%&/()=?-.:\\*'-_:.;,}\n";
  46. print " <start.from> must be a number >0 .and <length.charset> must
  47. be a number = or >(start.from)\n ";
  48. print " <MD5> must be exactly 32 character\n ";
  49. print " EXAMPLES:\n ";
  50. print "perl van.pl 12 2 3 900150983cd24fb0d6963f7d28e17f72\n ";
  51. print " This example try to crack the given <MD5> with all lowercase
  52. and uppercase\n ";
  53. print " this example charset start from (2), and (3) is length of charset\n ";
  54. print " perl van.pl 1234 1 10 900150983cd24fb0d6963f7d28e17f72\n ";
  55. print " This example try to crack the given <MD5> with nearly every
  56. character, and charset start from (1) to (10).\n ";
  57. die "-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-\n";
  58. }
  59.  
  60. sub crack{
  61. $CharSet = shift;
  62. @RawString = ();
  63. for (my $i =0;$i<$CharSet;$i++){ $RawString[i] = 0;}
  64. $Start = gettimeofday();
  65. do{
  66. for (my $i =0;$i<$CharSet;$i++){
  67. if ($RawString[$i] > length($alpha)-1){
  68. if ($i==$CharSet-1){
  69. print "Error: Crack done with ($CharSet) <length.charset>. No
  70. Result found. try again with another <length.charset>. or change
  71. ($alpha) <charset> chosen... \n";
  72. $cnt=0;
  73. return false;
  74. }
  75. $RawString[$i+1]++;
  76. $RawString[$i]=0;
  77. }
  78. }
  79. if ($CharSet<=0){ die " Error:Set <start.from> to a value more than (0)! \n"};
  80.  
  81. ###################################################
  82. $ret = "";
  83. for (my $i =0;$i<$CharSet;$i++){ $ret = $ret .
  84. substr($alpha,$RawString[$i],1);}
  85. $hash = md5_hex($ret);
  86. $cnt++;
  87. $Stop = gettimeofday();
  88. if ($Stop-$Start>$dbgtmr){
  89. $cnt = int($cnt/$dbgtmr);
  90. print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
  91. $cnt=0;
  92. $Start = gettimeofday();
  93. }
  94. print "$ARGV[3] >= $hash ($ret)\n";
  95. if ($ARGV[3] eq $hash){
  96. die "\n (extazy) **** Password Cracked Succes! **** => ($ret)\n";
  97. }
  98. ###################################################
  99. #checkhash($CharSet)."\n";
  100.  
  101. $RawString[0]++;
  102. }while($RawString[$CharSet-1]<length($alpha));
  103. }
  104.  
  105. sub checkhash{
  106. $CharSet = shift;
  107. $ret = "";
  108. for (my $i =0;$i<$CharSet;$i++){ $ret = $ret .
  109. substr($alpha,$RawString[$i],1);}
  110. $hash = md5_hex($ret);
  111. $cnt++;
  112. $Stop = gettimeofday();
  113. if ($Stop-$Start>$dbgtmr){
  114. $cnt = int($cnt/$dbgtmr);
  115. print "$cnt hashes\\second.\tLast Pass '$ret\'\n";
  116. $cnt=0;
  117. $Start = gettimeofday();
  118. }
  119.  
  120. if ($ARGV[3] eq $hash){
  121. die "\n **** Password Cracked Succes! **** => ($ret)\n";
  122. }
  123.  
  124. }
Add Comment
Please, Sign In to add comment