PHP Password Cracking Tool
PHP PIN Cracking Application - Rae Soria
Back to Coding Projects
Home

PHP PIN Cracking Application - Rae Soria

This application takes an MD5 hash of a 4-digit pin and attempts to reverse the hash by testing all 10,000 possible obfuscated PIN combinations. There are two outcomes for this:

  • PIN is successfully hacked
  • PIN hacking fails


This is a very simple skills check project. The learning level is intermediate, so it's nothing too crazy! It was part of a course at Michigan University

The code used for a successful MD5 4-digit PIN hack results. The text reads MD5 Cracker and gives a 64-bit encryption key for the PIN. Below the key it reveals the private PIN for the user

The output looks similar to these two samples:

The code used for a successful MD5 4-digit PIN hack results. The text reads MD5 Cracker and gives a 64-bit encryption key for the PIN. Below the key it reveals the private PIN for the user

The code used for a successful MD5 4-digit PIN hack results. The text reads MD5 Cracker and gives a 64-bit encryption key for the PIN. Below the key it reveals the private PIN for the user

Try For Yourself! - PHP Application - PIN Cracker PHP Code

This application takes an MD5 hash of a four-digit PIN and attempts to reverse the hash by testing all 10,000 possible PIN combinations.

<?php
$goodtext = "Not found";

if ( isset($_GET['md5']) ) {
    $time_pre = microtime(true);
    $md5 = $_GET['md5'];
    $show = 15;

    for($i=0; $i<10; $i++) {
        for($j=0; $j<10; $j++) {
            for($k=0; $k<10; $k++) {
                for($l=0; $l<10; $l++) {
                    $try = $i.$j.$k.$l;
                    $check = hash('md5', $try);

                    if ($show > 0) {
                        print $check . " " . $try . "\n";
                        $show--;
                    }

                    if ($check == $md5) {
                        $goodtext = $try;
                        break 4;
                    }
                }
            }
        }
    }

    $time_post = microtime(true);
    print "Elapsed time: ";
    print $time_post - $time_pre;
    print "\n";
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>MD5 Cracker</title>
</head>
<body>
    <h2>MD5 Cracker</h2>
    <p>
        This application takes an MD5 hash of a four-digit PIN and attempts to
        reverse hash it by trying all 10,000 possible PIN combinations.
    </p>

    <pre>
Debug Output:
<?php
if ( isset($_GET['md5']) ) {
    print htmlentities($goodtext) . "\n";
}
?>
    </pre>

    <p>PIN: <?php echo htmlentities($goodtext); ?></p>

    <form method="get">
        <input name="md5" size="40" type="text">
        <input type="submit" value="Crack MD5">
    </form>

    <p><a href="index.php">Reset</a></p>
</body>
</html>
Back to Coding Projects
Home

Popular posts from this blog