Start Home Hosting Forum Hosting Account Server gratuito Hosting Blog Hosting FAQ
 
Contacts

Registrazione domini, hosting
Registrazione domini a soli 5.49 euro l'anno!
     http://www.


Registrazione domini e Hosting professionale
NewsHTMLCSSJAVASCRIPTHosting MysqlHosting PHPHosting BlogHosting CMSHosting Forum    
 
POST Stealth
Venerdì, 21 Dicembre 2007

Script PHP in grado di inviare in modalita’ stealth dati POST ad altre pagine web.
In poche parole, attraverso una pagina PHP sprovvista di un FORM e campi di testo nascosti, e’ possibile inviare informazioni POST ad un’altra pagina.
Ecco lo script:

< ?php
//Informazioni Sito Web
$path_sito = "www.sito.it";
$path_pagina = "/test/test.php";  

//Stringa POST
$post01 = "Ciao a tutti";
$post02 = "by Netsons";
$post_string = "post01=" . urlencode($post01) . "&post02=" . urlencode($post02);
$post_lenght = strlen($post_string);  

//Informazioni da inviare al Sito
$post_data = "POST " . $path_pagina . " HTTP/1.0\r\n";
$post_data .= "host: " . $path_sito . "\r\n";
$post_data .= "Content-type: application/x-www-form-urlencoded\r\n";
$post_data .= "Content-length: " . $post_lenght . "\r\n\r\n";
$post_data .= $post_string . "\r\n";
$post_data .= "\r\n";  

//IP del Server Web
$ip_server = gethostbyname($path_sito);
$fp = fsockopen($ip_server, 80, &$errno, &$errstr, 30);  

//DEBUG (Facoltativo)
echo $post_data;  

//Invio Dati
if($fp)
{
    fputs($fp, $post_data);
    $reply = fread($fp, 1024);
    fclose($fp);
}
else
{
    echo "ERRORE CONNESSIONE";
}  

//DEBUG (Facoltativo)
echo "Risposta Server: " . $reply;
?>