Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP brute forcer


ghost's Avatar
0 0

So I started making a brute forcer in php, but there are some problems with it and I'm not quite sure what to do about it :-\. If anyone's good with php and can help me, I'd appreciate it, but anyways. Here's the code on the page to enter your hash

<html>
<body>
<form action="brute.php" method="GET">
<input type="text" name="hash" size="35">
<input type="submit" value="Brute!">
</form>
</body>
</html>

and then here's the code for the brute.php page

<html>
<body>
<?php
$hash = $_GET['hash'];
$attempt = "A";
$x = 0;
for($x = 0;$x <= 100;$x++)
{
$chash = md5($attempt);

    if($chash == $hash)
    {
           echo "The string is: $attempt";
           $x = 100;
    }
    if($x == 90)
    { 
           $x = 0;
    }

$attempt++;
}
?>
</body>
</html>

So some of the problems are that when $attempt is set to an upper-case letter, it'll only increase to another capital, so it'll never be lowercase. And also, the highest that it can brute-force is TZZZ (tzzz if I have it in lowercase). So I'm not quite sure how to fix these, I've been reading up on some stuff and trying to find out, but no luck :-\. So I don't know.


ghost's Avatar
0 0

use the set_timeout function higher, the php script might be timing out. i never knew you could increment letters :S


Mr_Cheese's Avatar
0 1

set_time_limit(0);


ghost's Avatar
0 0

so should i put the set_time_limit function on the end of the script??

i think theres one way to resolve the problem of lowercase/upercase that is create one array that olds all the chractres (upercase lowercase numbers etc..) and made a loop that array to get all the combinations.

am I correct?