Zat me even te vervelen en wou eens kijken of ik een bruteforce script kon schrijven voor md5(), makkie. Ik vraag me nu alleen af waarom er bij een input met tekens 3x wordt geoched $input hoort bij ...
Iemand die de fout ziet?
PHP:
<?php
$possibles = "a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z;1;2;3;4;5;6;7;8;9;0;!;@;#;$;%;^;&;*;(;);-;=;+;_;/;?;.";
$chars = explode(";", $possibles);
$top = count($chars);
$input = $_POST['input'];
if (isset($_GET['input']) && $_GET['input'] == 'set')
{
for ($a = 0; $a <= $top; $a++)
{
$z = $chars[$a];
if (md5($z) == $input)
{
echo "$input hoort bij $z";
break;
}
else
{
for ($b = 0; $b <= $top; $b++)
{
$y = $z.$chars[$b];
if (md5($y) == $input)
{
echo "$input hoort bij $y";
break;
}
else
{
for ($c = 0; $c <= $top; $c++)
{
$x = $y.$chars[$c];
if (md5($x) == $input)
{
echo "$input hoort bij $x";
break;
}
else
{
for ($d = 0; $d <= $top; $d++)
{
$w = $x.$chars[$d];
if (md5($w) == $input)
{
echo "$input hoort bij $w";
break;
}
else
{
}
}
}
}
}
}
}
}
}
else
{
echo '<form method="post" action="test.php?input=set">Input: <input type="text" name="input"><br><input type="submit" value="Hard crack!"></form>';
}
?>