1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| <?
/*
** SendPacket
*/
function SendPacket($Str_URL,$Str_Post=false,$Str_Cookie=false){
//Initialise l'objet cURL
$cURL=curl_init();
//Configure l'URL
curl_setopt($cURL,CURLOPT_URL,$Str_URL);
//Inclue le header dans la source
curl_setopt($cURL,CURLOPT_HEADER,true);
//Renvoie la source dans une variable
curl_setopt($cURL,CURLOPT_RETURNTRANSFER,1);
if($Str_Cookie){
//Envoie les informations de cookie
curl_setopt($cURL,CURLOPT_COOKIE,$Str_Cookie);
}
if($Str_Post){
//Prépare l'envoie d'une requête POST
curl_setopt($cURL,CURLOPT_POST,1);
//Contenu de la requête POST
curl_setopt($cURL,CURLOPT_POSTFIELDS,$Str_Post);
}
//Exécute la requête
$Str_Source=curl_exec($cURL);
//Ferme l'objet cURL
curl_close($cURL);
//Renvoie le packet reçu
return $Str_Source;
}
/*
** FindCookie
*/
function FindCookie($Str_Header,$Str_Name,$Int_Length=32){
//Taille du nom de la propriété du cookie
$Int_NameLen=strlen($Str_Name);
//Renvoie le résultat sous la forme "Nom=Valeur"
return substr($Str_Header,strpos($Str_Header,$Str_Name),$Int_Length+$Int_NameLen);
}
//Envoie une requête POST
SendPacket("http://www.sg-univers.fr/login_redirige.php","univers=http://ns21345.ovh.net/uni5/&login=xxx&password=xxx&mail=cache");
//Envoie une requête POST
$Str_Source=SendPacket("http://ns21345.ovh.net/uni5/login_action.php","login=xxx&passs=xxx&mail=cache");
//Récupère l'ID Session dans les cookies
$PHPSESSID=FindCookie($Str_Source,"PHPSESSID=");
//Récupère la valeur de "wtf_powa" dans les cookies
$WTF_POWA=FindCookie($Str_Source,"wtf_powa=");
//Envoie une requête GET
$Str_Source=SendPacket("http://ns21345.ovh.net/uni5/prod.php",false,"$WTF_POWA; $PHPSESSID");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Script d'identification</title>
</head>
<body>
<h3>http://ns21345.ovh.net/uni5/prod.php</h3>
<code><pre><?=htmlentities($Str_Source);?></pre></code>
</body>
</html> |