Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head><title>Pavel Shreyder MD5 Cracker</title></head>
  3. <body>
  4. <h1>MD5 cracker</h1>
  5. <p>This application takes an MD5 hash
  6. of a two-character lower case string and
  7. attempts to hash all two-character combinations
  8. to determine the original two characters.</p>
  9. <pre>
  10. Debug Output:
  11. <?php
  12. $goodtext = "Not MD5 or not found";
  13. // If there is no parameter, this code is all skipped
  14. if ( strtolower(isset($_GET['md5'])) && (strlen($_GET['md5']) == 32)) {
  15. $time_pre = microtime(true);
  16. $time_pre_sec = time(true);
  17. $zx = 0;
  18. $md5 = strtolower($_GET['md5']);
  19. // This is our alphabet
  20. $txt = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMONPQRSTUVWXYZ.,?!@#$%^&*()";
  21. $show = 15;
  22. // Outer loop go go through the alphabet for the
  23. // first position in our "possible" pre-hash
  24. // text
  25. for($i=0; $i<strlen($txt); $i++ ) {
  26. $ch1 = $txt[$i]; // The first of two characters
  27. // Our inner loop Not the use of new variables
  28. // $j and $ch2
  29. for($j=0; $j<strlen($txt); $j++ ) {
  30. $ch2 = $txt[$j];
  31. for($k=0; $k<strlen($txt); $k++ ) {
  32. $ch3 = $txt[$k];
  33. for($l=0; $l<strlen($txt); $l++ ) {
  34. $ch4 = $txt[$l];
  35. for($m=0; $m<strlen($txt); $m++ ) {
  36. $ch5 = $txt[$m];
  37. for($n=0; $n<strlen($txt); $n++ ) {
  38. $ch6 = $txt[$n];
  39. for($o=0; $o<strlen($txt); $o++ ) {
  40. $time_cur = time(true);
  41. $zz = $time_cur-$time_pre_sec;
  42. $ch7 = $txt[$o];
  43. $try = $ch1.$ch2.$ch3.$ch4.$ch5.$ch6.$ch7;
  44. // Run the hash and then check to see if we match
  45. $check = hash('md5', $try);
  46. if ($zx != $zz) {
  47. print gmdate("H:i:s", $zz) . "s: $check $try\n";
  48. $zx = $zz;
  49. }
  50. if ( ($check == $md5) || ($check == $md5) ) {
  51. $goodtext = $try;
  52. goto tata; // Exit the loop
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }
  61. tata:
  62. // Compute elapsed time
  63. $time_post = microtime(true);
  64. $time_cur = time(true);
  65. print "Elapsed time: ";
  66. print $time_post-$time_pre;
  67. print "\n";
  68. }
  69. ?>
  70. </pre>
  71. <!-- Use the very short syntax and call htmlentities() -->
  72. <p>Original Text: <?= htmlentities($goodtext); ?></p>
  73. <form>
  74. <input type="text" name="md5" size="40" />
  75. <input type="submit" value="Crack MD5"/>
  76. </form>
  77. <ul>
  78. <li><a href="index.php">Reset</a></li>
  79. <li><a href="md5.php">MD5 Encoder</a></li>
  80. <li><a href="makecode.php">MD5 Code Maker</a></li>
  81. <li><a
  82. href="https://github.com/csev/wa4e/tree/master/code/crack"
  83. target="_blank">Source code for this application</a></li>
  84. </ul>
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement