Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <head><title>Pavel Shreyder MD5 Cracker</title></head>
- <body>
- <h1>MD5 cracker</h1>
- <p>This application takes an MD5 hash
- of a two-character lower case string and
- attempts to hash all two-character combinations
- to determine the original two characters.</p>
- <pre>
- Debug Output:
- <?php
- $goodtext = "Not MD5 or not found";
- // If there is no parameter, this code is all skipped
- if ( strtolower(isset($_GET['md5'])) && (strlen($_GET['md5']) == 32)) {
- $time_pre = microtime(true);
- $time_pre_sec = time(true);
- $zx = 0;
- $md5 = strtolower($_GET['md5']);
- // This is our alphabet
- $txt = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMONPQRSTUVWXYZ.,?!@#$%^&*()";
- $show = 15;
- // Outer loop go go through the alphabet for the
- // first position in our "possible" pre-hash
- // text
- for($i=0; $i<strlen($txt); $i++ ) {
- $ch1 = $txt[$i]; // The first of two characters
- // Our inner loop Not the use of new variables
- // $j and $ch2
- for($j=0; $j<strlen($txt); $j++ ) {
- $ch2 = $txt[$j];
- for($k=0; $k<strlen($txt); $k++ ) {
- $ch3 = $txt[$k];
- for($l=0; $l<strlen($txt); $l++ ) {
- $ch4 = $txt[$l];
- for($m=0; $m<strlen($txt); $m++ ) {
- $ch5 = $txt[$m];
- for($n=0; $n<strlen($txt); $n++ ) {
- $ch6 = $txt[$n];
- for($o=0; $o<strlen($txt); $o++ ) {
- $time_cur = time(true);
- $zz = $time_cur-$time_pre_sec;
- $ch7 = $txt[$o];
- $try = $ch1.$ch2.$ch3.$ch4.$ch5.$ch6.$ch7;
- // Run the hash and then check to see if we match
- $check = hash('md5', $try);
- if ($zx != $zz) {
- print gmdate("H:i:s", $zz) . "s: $check $try\n";
- $zx = $zz;
- }
- if ( ($check == $md5) || ($check == $md5) ) {
- $goodtext = $try;
- goto tata; // Exit the loop
- }
- }
- }
- }
- }
- }
- }
- }
- tata:
- // Compute elapsed time
- $time_post = microtime(true);
- $time_cur = time(true);
- print "Elapsed time: ";
- print $time_post-$time_pre;
- print "\n";
- }
- ?>
- </pre>
- <!-- Use the very short syntax and call htmlentities() -->
- <p>Original Text: <?= htmlentities($goodtext); ?></p>
- <form>
- <input type="text" name="md5" size="40" />
- <input type="submit" value="Crack MD5"/>
- </form>
- <ul>
- <li><a href="index.php">Reset</a></li>
- <li><a href="md5.php">MD5 Encoder</a></li>
- <li><a href="makecode.php">MD5 Code Maker</a></li>
- <li><a
- href="https://github.com/csev/wa4e/tree/master/code/crack"
- target="_blank">Source code for this application</a></li>
- </ul>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement