Skip to content

About

Isolated Docker lab and PoC exploit chain for PHP2Shell (CVE-2026-109619 & CVE-2026-109618) on Debian/Apache MPM Prefork using Header Amplification and ZendMM Heap Grooming. For educational and security research purposes only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

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


Tieng Viet

Gioi thieu

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.

Cau truc thu muc

  • docker-compose.yml: Khoi chay container anm-php-lab tu image newbiemt/anm-php-lab:latest, mo cong 8386:80 va mount thu muc web/.
  • web/: Ma nguon web duoc mount vao /var/www/html trong container.
  • verify_env.sh: Kiem tra phien ban PHP, ma bam libphp.so, cau hinh php.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.

Yeu cau he thong

  • Docker & Docker Compose
  • Python 3: No external dependencies (Python 3 stdlib only) (socket, struct, argparse, ssl, urllib.parse).

Minh bach ve Docker Image

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.sh de doi chieu SHA-256 cua /usr/lib/apache2/modules/libphp.so (ecd97e302e8cb3fd106c0541410256ad6597cb6410166beee0ab773ff4974b36).

Huong dan su dung

  1. Khoi dong moi truong lab:
    docker compose up -d
  2. Kiem tra tinh trang moi truong:
    chmod +x verify_env.sh
    ./verify_env.sh
  3. Chay thu nghiem:
    python3 header_chain.py
    python3 rce.py
  4. Dung moi truong lab:
    docker compose down

Nguon tham khao va ghi nhan tac gia goc

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, commit 17e98ee8): Nghien cuu chuoi A1/B1 session OOM va ky thuat ASLR bypass goc.
  • dinosn (php-cve-2026-10961x-lab-poc, commit b1e41991): Ha tang lab, offset profiles va cac script hieu chuan.
  • Cookiengineer (actual-php2shell, commit 1d5208ba): Nghien cuu CVE-2026-109618 (co che incomplete bucket).

English

Overview

This repository provides a Dockerized lab environment (Apache + PHP 8.5.11) along with environment verification and research scripts for security study.

Repository Structure

  • docker-compose.yml: Runs the anm-php-lab container from newbiemt/anm-php-lab:latest, exposes port 8386:80, and mounts web/.
  • web/: Web root mounted to /var/www/html inside the container.
  • verify_env.sh: Verifies PHP version, libphp.so SHA-256 checksum, php.ini settings, 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.

Requirements

  • Docker & Docker Compose
  • Python 3: No external dependencies (Python 3 stdlib only) (socket, struct, argparse, ssl, urllib.parse).

Docker Image Transparency

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.sh to verify the SHA-256 checksum of /usr/lib/apache2/modules/libphp.so (ecd97e302e8cb3fd106c0541410256ad6597cb6410166beee0ab773ff4974b36).

Usage

  1. Start the lab environment:
    docker compose up -d
  2. Verify the environment:
    chmod +x verify_env.sh
    ./verify_env.sh
  3. Run the scripts:
    python3 header_chain.py
    python3 rce.py
  4. Stop the lab environment:
    docker compose down

References & Credits

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, commit 17e98ee8): A1/B1 session OOM chain and original ASLR bypass research.
  • dinosn (php-cve-2026-10961x-lab-poc, commit b1e41991): Lab infrastructure, offset profiles, and calibration scripts.
  • Cookiengineer (actual-php2shell, commit 1d5208ba): CVE-2026-109618 research (incomplete bucket mechanism).

About

Isolated Docker lab and PoC exploit chain for PHP2Shell (CVE-2026-109619 & CVE-2026-109618) on Debian/Apache MPM Prefork using Header Amplification and ZendMM Heap Grooming. For educational and security research purposes only.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages