Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-2961-XXE-Exploit — CVE-2024-2961 (CNEXT) PHP file-read to RCE exploit adapted to an XXE/CTF channel | Kitploit
Tools/GitHubGitHub/qinglove777/cve-2024-2961-xxe-exploit
Vulnerability AnalysisExploitationWeb Application ExploitationCTFPayload DevelopmentBinary Exploitation
GitHubqinglove777/cve-2024-2961-xxe-exploit

CVE-2024-2961-XXE-Exploit

CVE-2024-2961 (CNEXT) PHP file-read to RCE exploit adapted to an XXE/CTF channel

View Repository
17h 59m agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2024-2961 (CNEXT) XXE 通道适配利用脚本

将 Ambionics 官方 cnext-exploits 的 PHP 文件读取 -> RCE 利用脚本,适配到 SVG 上传 + XXE 任意文件读取 场景(PolarisCTF 2026 "头像上传器" 一类题目)。

前置条件

  • 目标:Linux + glibc < 2.39(Ubuntu 20.04 需 < 2.31-0ubuntu9.15,USN-6737-1 已修复)+ PHP(实测 PHP 7.3 可用)
  • 读原语:可通过 XXE / LFI 让 PHP 读取任意路径,且支持 php://filter、data://、zlib(脚本 check_vulnerable() 会自动验证)
  • 本地:Python 3.10+,pip install -r requirements.txt(pwntools、ten、requests)

与原版的差异(适配要点)

  1. Remote 类重写:把"让 PHP 读一个路径"翻译成题目的 XXE 往返:上传含外部实体的 SVG -> 更新 avatar_name -> 请求解析接口回显。
  2. 过滤器分隔符 | -> :XML 实体 URL 中含 时 libxml 解析失败(实测 DOMDocument 返回空文档); 支持不带前缀的裸过滤器按 分隔,等价于 。
/
|
php://filter
/
read=a|b|c
  • LIBC_FILE 改为相对路径(Windows/Linux 均可运行)。
  • download_file 改用 open() 写入(ten 库导出的 Path 是 PosixPath 子类,Windows 无法实例化)。
  • 使用

    1. 编辑脚本开头 Remote 类:填入题目 API 地址、账号密码。
    2. 把目标读原语翻译成 Remote.send/download(示例实现针对“上传 SVG + 查看时解析”的接口形态,其他形态照葫芦画瓢)。
    3. 运行(命令无回显,用重定向落地文件再读回,或用 -s sleep 计时验证):
    root@kitploit:~
    python cnext-exploit-xxe-polaris.py <url> '/readflag > /var/www/html/uploads/flag_out.txt' -s 2
    

    看到 EXPLOIT SUCCESS 后,再用读原语把输出文件读回即可。

    说明

    • 仅用于 CTF 竞赛与授权环境下的安全研究。
    • 上游:https://github.com/ambionics/cnext-exploits (Charles Fol @cfreal_,Ambionics/LEXFO)
    • 漏洞:CVE-2024-2961(glibc iconv ISO-2022-CN-EXT 越界写),公告 GLIBC-SA-2024-0004;原理分析: https://www.ambionics.io/blog/iconv-cve-2024-2961-p1
    Download Tool