Disclaimer: For educational and authorized research purposes in isolated lab environments only.
Tuyen bo mien tru trach nhiem: Tai lieu va ma nguon chi phuc vu muc dich hoc tap va nghien cuu duoc cap phep trong moi truong lab co lap.
Author / Tac gia: NewbieMt
Docker Hub: https://hub.docker.com/r/newbiemt/anm-php-lab
Kho luu tru nay cung cap moi truong lab Docker (Apache + PHP 8.5.11) cung cac script kiem tra moi truong va thu nghiem ky thuat trong pham vi nghien cuu an toan thong tin.
docker-compose.yml: Khoi chay containeranm-php-labtu imagenewbiemt/anm-php-lab:latest, mo cong8386:80va mount thu mucweb/.web/: Ma nguon web duoc mount vao/var/www/htmltrong container.verify_env.sh: Kiem tra phien ban PHP, ma bamlibphp.so, cau hinhphp.ini, Apache MPM, glibc va kernel.gdb/gdb_calibrate.gdb: Script GDB ho tro do dac va hieu chuan lai cac offset tren moi truong khac.header_chain.py: Script thu nghiem xu ly chuoi header.rce.py: Script thu nghiem chinh tren moi truong lab.
- Docker & Docker Compose
- Python 3: No external dependencies (Python 3 stdlib only) (
socket,struct,argparse,ssl,urllib.parse).
De dam bao tinh minh bach va kha nang tai lap, image newbiemt/anm-php-lab:latest duoc build tu base ubuntu:24.04 va bien dich truc tiep tu ma nguon chinh thuc php/php-src (tag php-8.5.11, commit 678778973bb4d4185c06ef1320de50f1a975d3c8) voi cac cau hinh sau:
- Compiler flags:
CFLAGS="-O2 -g -fno-omit-frame-pointer -fcf-protection=none"cung--with-apxs2=/usr/bin/apxs. - Apache MPM Prefork:
StartServers 5,MinSpareServers 5,MaxSpareServers 10,MaxRequestWorkers 150,MaxConnectionsPerChild 0. - php.ini:
memory_limit = 128M,post_max_size = 8M,upload_max_filesize = 2M,max_file_uploads = 20,max_input_vars = 1000,max_input_nesting_level = 64,display_errors = Off,log_errors = On,session.upload_progress.enabled = On,session.upload_progress.cleanup = On. - Kiem chung binary: Chay
./verify_env.shde doi chieu SHA-256 cua/usr/lib/apache2/modules/libphp.so(ecd97e302e8cb3fd106c0541410256ad6597cb6410166beee0ab773ff4974b36).
- Khoi dong moi truong lab:
docker compose up -d
- Kiem tra tinh trang moi truong:
chmod +x verify_env.sh ./verify_env.sh
- Chay thu nghiem:
python3 header_chain.py python3 rce.py
- Dung moi truong lab:
docker compose down
Nghien cuu nay duoc xay dung va doi chieu dua tren cac cong bo va kho luu tru goc:
- Phat hien goc: Ryan Austin (Calif) phoi hop cung OpenAI, va phat hien doc lap boi Wiz Research.
- 9bie (
php2shell-bypass-aslr-exp, commit17e98ee8): Nghien cuu chuoi A1/B1 session OOM va ky thuat ASLR bypass goc. - dinosn (
php-cve-2026-10961x-lab-poc, commitb1e41991): Ha tang lab, offset profiles va cac script hieu chuan. - Cookiengineer (
actual-php2shell, commit1d5208ba): Nghien cuu CVE-2026-109618 (co che incomplete bucket).
This repository provides a Dockerized lab environment (Apache + PHP 8.5.11) along with environment verification and research scripts for security study.
docker-compose.yml: Runs theanm-php-labcontainer fromnewbiemt/anm-php-lab:latest, exposes port8386:80, and mountsweb/.web/: Web root mounted to/var/www/htmlinside the container.verify_env.sh: Verifies PHP version,libphp.soSHA-256 checksum,php.inisettings, Apache MPM configuration, glibc, and kernel version.gdb/gdb_calibrate.gdb: GDB script for measuring and calibrating offsets on different target environments.header_chain.py: Script for testing header chain handling.rce.py: Main research script for the lab environment.
- Docker & Docker Compose
- Python 3: No external dependencies (Python 3 stdlib only) (
socket,struct,argparse,ssl,urllib.parse).
For transparency and reproducibility, newbiemt/anm-php-lab:latest is built on ubuntu:24.04 and compiled directly from the official php/php-src repository (tag php-8.5.11, commit 678778973bb4d4185c06ef1320de50f1a975d3c8) with the following configuration:
- Compiler flags:
CFLAGS="-O2 -g -fno-omit-frame-pointer -fcf-protection=none"with--with-apxs2=/usr/bin/apxs. - Apache MPM Prefork:
StartServers 5,MinSpareServers 5,MaxSpareServers 10,MaxRequestWorkers 150,MaxConnectionsPerChild 0. - php.ini:
memory_limit = 128M,post_max_size = 8M,upload_max_filesize = 2M,max_file_uploads = 20,max_input_vars = 1000,max_input_nesting_level = 64,display_errors = Off,log_errors = On,session.upload_progress.enabled = On,session.upload_progress.cleanup = On. - Binary verification: Run
./verify_env.shto verify the SHA-256 checksum of/usr/lib/apache2/modules/libphp.so(ecd97e302e8cb3fd106c0541410256ad6597cb6410166beee0ab773ff4974b36).
- Start the lab environment:
docker compose up -d
- Verify the environment:
chmod +x verify_env.sh ./verify_env.sh
- Run the scripts:
python3 header_chain.py python3 rce.py
- Stop the lab environment:
docker compose down
This work builds upon and references the following original discoveries and repositories:
- Original Discovery: Ryan Austin (Calif) in collaboration with OpenAI, and independently by Wiz Research.
- 9bie (
php2shell-bypass-aslr-exp, commit17e98ee8): A1/B1 session OOM chain and original ASLR bypass research. - dinosn (
php-cve-2026-10961x-lab-poc, commitb1e41991): Lab infrastructure, offset profiles, and calibration scripts. - Cookiengineer (
actual-php2shell, commit1d5208ba): CVE-2026-109618 research (incomplete bucket mechanism).