<commit_before><?php
mb_language('uni');
mb_internal_encoding('UTF-8');

require_once('recaptchalib.php');

$rec_pub_key = "<KEY>";
$rec_priv_key = "<KEY>";

if(isset($_GET['p']))
{
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: http://crackstation.net/");
}

function trim_value(&$value)
{
    $value = trim($value);
    $value = trim($value, "*"); // For MySQL 4.1+ hashes
}

// http://wezfurlong.org/blog/2006/nov/http-post-from-php-without-curl/
function do_post_request($url, $data, $optional_headers = null)
{
  $params = array('http' => array(
              'method' => 'POST',
              'content' => $data
            ));
  if ($optional_headers !== null) {
    $params['http']['header'] = $optional_headers;
  }
  $ctx = stream_context_create($params);
  $fp = @fopen($url, 'rb', false, $ctx);
  if (!$fp) {
      return FALSE;
  }
  $response = @stream_get_contents($fp);
  if ($response === false) {
      return FALSE;
  }
  return $response;
}

function CrackHashes($hashes)
{
    $attempt_increment = count($hashes);
    $cracked_increment = 0;
	echo "<table class=\"results\">";
	echo "<tr><th>Hash</th><th>Type</th><th>Result</th></tr>";
    $url = "http://site-two.defuse.ca:1985/crack.php";
    $result = do_post_request($url, "hashes=" . urlencode(implode(",", $hashes)));
    if($result === FALSE)
        return false;
    $result = explode("\n", $result);
    foreach($result as $line)
    {
        $data = explode("||#||", $line);
        if(count($data) == 4)
        {
            $cracked_increment++;
            $hash = "";
            while(strlen($data[3]) > 0)
            {
                $hash .= htmlspecialchars(substr($data[3], 0, 64), ENT_QUOTES) . "<br />";
                $data[3] = substr($data[3], 64);
            }
            $type = htmlspecialchars($data[1], ENT_QUOTES);
            $pass = htmlspecialchars($data[2], ENT_QUOTES);
            if($data[0] == "FULLMATCH")
                echo '<tr class="suc">';
            elseif($data[0] == "PARTIALMATCH")
                echo '<tr class="part">';
            echo "<td>$hash</td><td>$type</td><td>$pass</td></tr>";
        }
        elseif(count($data) == 2 && $data[0] == "NOTFOUND")
        {
            $hash = htmlspecialchars($data[1], ENT_QUOTES);
            echo "<tr class=\"fail\"><td>$hash</td><td>Unknown</td><td>Not Found</td></tr>";
        }
    }
	echo "</table>";
    echo '<p style="font-size: 8pt;"><strong>Color Codes:</strong> <span style="background-color: #00FF00;">Green:</span> Exact match, <span style="background-color: #FFFF00;">Yellow:</span> Partial match, <span style="background-color: #FF0000;">Red:</span> Not found.</p>';
    incrementCounter($cracked_increment, $attempt_increment);
    return true;
}
?>
 <script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'blackglass'
 };
 </script>

<h1>Free Password Hash Cracker</h1>
<p>
    Enter up to 10 non-salted hashes:
</p>
<form action="/" method="post">
<table style="width: 100%;">
<tr>
    <td style="width: 550px;">
        <textarea style="width: 100%; height: 180px; border: solid black 1px; background-color: #e9e9e9;" name="hashes" ><?php if(isset($_POST['hashes'])) echo htmlspecialchars($_POST['hashes'], ENT_QUOTES); ?></textarea>
    </td>
    <td>
        <center>
        <?php
            echo recaptcha_get_html($rec_pub_key, null, true);
        ?>
        <input type="submit" name="crack" value="Crack Hashes" style="width: 200px; margin-top: 10px;" />
        </center>
    </td>
</tr>
</table>
</form>
<p style="font-size: 8pt; margin: 0; padding: 0;">
<b>Supports:</b> LM, NTLM, md2, md4, md5, md5(md5), md5-half, sha1, sha1(sha1_bin()), sha224, sha256, sha384, sha512, ripeMD160, whirlpool, MySQL 4.1+	<br />
</p>
<div class="crackresults">
<?php

if(isset($_POST['crack']))
{
    $rec_result = recaptcha_check_answer($rec_priv_key,
                                            $_SERVER["REMOTE_ADDR"],
                                            $_POST["recaptcha_challenge_field"],
                                            $_POST["recaptcha_response_field"]);
    if($rec_result->is_valid)
    {
        $hashes = str_replace("\r\n", "\n", $_POST['hashes']);
        $hashes = str_replace("\r", "\n", $hashes);
        $hashes = explode("\n", $hashes);
        array_walk($hashes, 'trim_value');
        $hashes = array_filter($hashes, function ($item) { return !empty($item); });<commit_msg>Add temporary way to bypass captcha so @LaNMaSteR53 can dev.<commit_after><?php
mb_language('uni');
mb_internal_encoding('UTF-8');

require_once('recaptchalib.php');

$rec_pub_key = "<KEY>";
$rec_priv_key = "<KEY>";

if(isset($_GET['p']))
{
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: http://crackstation.net/");
}

function trim_value(&$value)
{
    $value = trim($value);
    $value = trim($value, "*"); // For MySQL 4.1+ hashes
}

// http://wezfurlong.org/blog/2006/nov/http-post-from-php-without-curl/
function do_post_request($url, $data, $optional_headers = null)
{
  $params = array('http' => array(
              'method' => 'POST',
              'content' => $data
            ));
  if ($optional_headers !== null) {
    $params['http']['header'] = $optional_headers;
  }
  $ctx = stream_context_create($params);
  $fp = @fopen($url, 'rb', false, $ctx);
  if (!$fp) {
      return FALSE;
  }
  $response = @stream_get_contents($fp);
  if ($response === false) {
      return FALSE;
  }
  return $response;
}

function CrackHashes($hashes)
{
    $attempt_increment = count($hashes);
    $cracked_increment = 0;
	echo "<table class=\"results\">";
	echo "<tr><th>Hash</th><th>Type</th><th>Result</th></tr>";
    $url = "http://site-two.defuse.ca:1985/crack.php";
    $result = do_post_request($url, "hashes=" . urlencode(implode(",", $hashes)));
    if($result === FALSE)
        return false;
    $result = explode("\n", $result);
    foreach($result as $line)
    {
        $data = explode("||#||", $line);
        if(count($data) == 4)
        {
            $cracked_increment++;
            $hash = "";
            while(strlen($data[3]) > 0)
            {
                $hash .= htmlspecialchars(substr($data[3], 0, 64), ENT_QUOTES) . "<br />";
                $data[3] = substr($data[3], 64);
            }
            $type = htmlspecialchars($data[1], ENT_QUOTES);
            $pass = htmlspecialchars($data[2], ENT_QUOTES);
            if($data[0] == "FULLMATCH")
                echo '<tr class="suc">';
            elseif($data[0] == "PARTIALMATCH")
                echo '<tr class="part">';
            echo "<td>$hash</td><td>$type</td><td>$pass</td></tr>";
        }
        elseif(count($data) == 2 && $data[0] == "NOTFOUND")
        {
            $hash = htmlspecialchars($data[1], ENT_QUOTES);
            echo "<tr class=\"fail\"><td>$hash</td><td>Unknown</td><td>Not Found</td></tr>";
        }
    }
	echo "</table>";
    echo '<p style="font-size: 8pt;"><strong>Color Codes:</strong> <span style="background-color: #00FF00;">Green:</span> Exact match, <span style="background-color: #FFFF00;">Yellow:</span> Partial match, <span style="background-color: #FF0000;">Red:</span> Not found.</p>';
    incrementCounter($cracked_increment, $attempt_increment);
    return true;
}
?>
 <script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'blackglass'
 };
 </script>

<h1>Free Password Hash Cracker</h1>
<p>
    Enter up to 10 non-salted hashes:
</p>
<form action="/<?php if (isset($_REQUEST['asdf123456'])) { echo "?asdf123456=1"; } ?>" method="post">
<table style="width: 100%;">
<tr>
    <td style="width: 550px;">
        <textarea style="width: 100%; height: 180px; border: solid black 1px; background-color: #e9e9e9;" name="hashes" ><?php if(isset($_POST['hashes'])) echo htmlspecialchars($_POST['hashes'], ENT_QUOTES); ?></textarea>
    </td>
    <td>
        <center>
        <?php
            if (!isset($_REQUEST['asdf123456'])) {
                echo recaptcha_get_html($rec_pub_key, null, true);
            }
        ?>
        <input type="submit" name="crack" value="Crack Hashes" style="width: 200px; margin-top: 10px;" />
        </center>
    </td>
</tr>
</table>
</form>
<p style="font-size: 8pt; margin: 0; padding: 0;">
<b>Supports:</b> LM, NTLM, md2, md4, md5, md5(md5), md5-half, sha1, sha1(sha1_bin()), sha224, sha256, sha384, sha512, ripeMD160, whirlpool, MySQL 4.1+	<br />
</p>
<div class="crackresults">
<?php

if(isset($_POST['crack']))
{
    if (!isset($_REQUEST['asdf123456'])) {
    $rec_result = recaptcha_check_answer($rec_priv_key,
                                            $_SERVER["REMOTE_ADDR"],
                                            $_POST["recaptcha_challenge_field"],
                                            $_POST["recaptcha_response_field"]);
    }
    if(isset($_REQUEST['asdf123456']) || $rec_result->is_valid)
    {
        $hashes = str_replace("\r\n", "\n", $_POST['hashes']);
        $hashes = str_replace("\r", "\n", $hashes);
        $hashes = explode("\n", $hashes);
        array_walk($hashes, 'trim_value');
        $hashes = array_filter($hashes, function ($item) { return !empty($item); });
{'fraction_non_alphanumeric': 0.20301408758326964, 'fraction_numerical': 0.0254450147428197, 'mean_word_length': 2.857624262847515, 'pattern_counts': {'":': 0, '<': 146, '<?xml version=': 0, '>': 154, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1830954', 'n_tokens_mistral': 3293, 'n_tokens_neox': 3091, 'n_words': 596}