Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-30333 PoC — PerfreeBlog 代码问题漏洞

Source
Associated Vulnerability
Title:PerfreeBlog 代码问题漏洞 (CVE-2023-30333)
Description:PerfreeBlog是一款基于java开发的博客/CMS建站平台。 PerfreeBlog v3.1.2版本存在安全漏洞,该漏洞源于存在任意文件上传漏洞,允许攻击者通过精心制作的文件执行任意代码。
Readme
**Phân tích lỗ hổng CVE-2022-30333 – Path Traversal trong UnRAR dẫn đến RCE trong Zimbra**

**1. Tổng quan lỗ hổng**

CVE ID: CVE-2022-30333

CVSS v3.1: 7.5 (High)

Phạm vi ảnh hưởng phần mềm:
UnRAR: tất cả các phiên bản < 6.12 (hoặc bản mã nguồn mở < 6.1.7)

Zimbra Collaboration Suite:

9.0.0 patch ≤ 24

8.8.15 patch ≤ 31

**2. Chi tiết kỹ thuật**

Unrar thực hiện kiểm tra an toàn đường dẫn symbolic link (dựa trên ký tự / – chuẩn Linux), trước khi chuyển đổi đường dẫn từ định dạng Windows (\\) sang Unix (/), thông qua hàm: DosSlashToUnix()

Code minh họa:
\\


    bool IsRelativeSymlinkSafe(const char *targetPath) {
    // Kiểm tra nếu có "../" để ngăn path traversal
    
    if (strstr(targetPath, "../") != nullptr) {
    
        return false;
        
    }
    
    // Sau kiểm tra, mới chuyển đổi định dạng
   
    DosSlashToUnix(targetPath);  // ← lỗi ở đây
   
    return true; }


Điều này tạo ra lỗ hổng logic: một symbolic link dạng ..\..\..\tmp\file bypass được kiểm tra, nhưng sau khi chuyển đổi sẽ trở thành ../../../tmp/file, dẫn tới Path Traversal.


Demo:

Sử dụng metasploit để khai thác lỗ hổng

![image](https://github.com/user-attachments/assets/ce8d827a-dc98-43c9-9637-9fe53ef7b55d)

Cấu hình payload và gửi payload qua mail đến hệ thống

![image](https://github.com/user-attachments/assets/1c575935-577e-412b-954f-d7b3f85e187b)

Zimbra sử dụng Amavisd để scan email và file đính kèm nhằm phát hiện mã độc.

Amavisd tự động gọi lệnh unrar để giải nén các tệp .rar mà không kiểm tra chuẩn hóa đường dẫn symbolic link.

Payload được giải nén tự động với file .unrar trong mục /tmp

![image](https://github.com/user-attachments/assets/54aec06a-6594-43bb-bbe7-0c7636f5792d)

Khai thác thành công lỗ hổng

![image](https://github.com/user-attachments/assets/680012a3-7ca7-48f1-80fd-05d4e42f0fdd)
File Snapshot

[4.0K] /data/pocs/d7ef3de330570d5fad1193ae2741d31e18124682 └── [2.0K] README.md 0 directories, 1 file
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.