PHP2Shell exploitation observed: packet-to-process RCE evidence
A PHP engine flaw in PHP 8.4.26 under Apache mod_php let attackers send a four-stage multipart request chain that exhausted memory, leaked a large session cookie containing pointer-like values, then used those leaked addresses to defeat ASLR and start a shell as the Apache user. The honeypot evidence shows 35 Apache-parent shell starts, with commands attempting proof files and outbound fetches.
github.com
Published on github.com
History
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a PHP engine flaw in upload-progress/session handling that allows memory corruption and disclosure before application code runs, enabling leak-guided ASLR bypass and code execution.
Impact
Attackers could execute arbitrary shell commands as the Apache user on vulnerable PHP servers, though in this case web-root writes hit a read-only filesystem and wget was absent, limiting some proof attempts.
What the attacker needed
Vulnerable PHP 8.4.26 under Apache mod_php; plaintext HTTP access to the target; no authentication needed
How it was found
- Send a chunked multipart POST with many file fields to exhaust the PHP memory limit.
- Send a second chunked multipart POST that returns an oversized PHPSESSID cookie containing pointer-like values.
- Send a fixed-length multipart POST to exhaust memory again.
- Send a final multipart POST containing address-like values adjusted to the leaked pointer and a shell command.
- Observe an Apache-parent /bin/sh process start, then the worker crash with a segmentation fault.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
PHP is a language that runs web pages on the server. A bug in how PHP handled uploaded session data let an attacker first crash and leak memory, then use the leaked numbers to work out where things sit in memory, and finally make the server run a command of their choosing. The result was a shell, meaning the attacker could run operating-system commands as the web server's user.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.