
Black-box pentest lab for the PHP2Shell engine memory-corruption family (CVE-2026-109618 / CVE-2026-109619, CVSS 9.8/9.2). Dual-flag verified attack chain, agent-calibrated. EN/JP/ZH.
A black-box capture-the-flag target built around PHP2Shell — the 2026 PHP engine memory-corruption family (CVE-2026-109618 / CVE-2026-109619, CVSS 9.8/9.2, fixed in PHP 8.4.27). The vulnerability is in the engine, not the app: the tiny PHP application layer is intentionally clean of injections. You must fingerprint the runtime, correlate the advisory, and pick the right ballistics. Stuck? Full walkthrough in docs/SOLUTION.md.
Prerequisites: Docker Engine (or Docker Desktop on Windows/macOS) with Compose v2 — that's it. No PHP toolchain needed on the host. Works on Windows 10/11 (WSL2), Linux, and macOS; see the platform note below for which exploit chain your CPU supports.
git clone https://github.com/taniungou/php2shell-lab.git
cd php2shell-lab
docker compose up -d --build # first build pulls the pinned base image
Open http://localhost:18901 and sign in as user demo
(password change-me-demo) to reach the app. From here the box is
black-box: figure out the rest.
Want your own flag values and account passwords? Edit private.ini, then:
docker compose build \
--build-arg FLAG_LOCAL=flag{...} \
--build-arg FLAG_PROOF=flag{...}
Housekeeping:
docker compose logs -f # watch the target
docker compose down -v && docker compose up -d --build # full reset (re-arms the leak window)
docker compose down # stop and free resources
Flags are OverTheWire-style:
| flag | path | readable by |
|---|---|---|
local.txt | /var/www/local.txt | www-data |
proof.txt | /root/proof.txt | root only |
up.proof.txt with different elegance grades. At
least one is live-fire verified; only one scales to a real fleet.The public RCE-landing exploits for PHP2Shell assume an x86_64 kernel heap layout. On Apple Silicon (and other aarch64 hosts such as Windows-on-ARM) the leak primitives land but the RCE landing does not — we verified this across amd64-under-emulation, arm64-native, and the advisory authors' reference configuration (calif.io/php2shell, x86_64 Linux). On ARM hosts the intended solution is the disclosure chain, not the RCE chain — it works everywhere, including x86_64. Details: docs/PLATFORM-MATRIX.md.
Full kill chain, offsets, and per-round attack transcripts: docs/SOLUTION.md — spoiler-protected by this section being at the bottom, promise.
MIT — build on it, fork it, use it in trainings (attribution appreciated).