
PHP to Shell, Part 1: Building an Isolated Lab Worth Trusting
A loopback-only PHP target built from native packages, not Docker, with the egress claim proven by seven checks instead of assumed from the config.

A loopback-only PHP target built from native packages, not Docker, with the egress claim proven by seven checks instead of assumed from the config.

An upload bypass needs two independent things to line up — a servable location and a server that routes it to PHP. Tested against a real Apache + mod_php target, including the negative controls that prove which config choice is actually load-bearing.

An include() on user input is a read primitive until something makes the included content attacker-controlled PHP. Logs, sessions, phar archives and a filter-chain trick that I could only confirm halfway.

unserialize() on attacker input is a necessary condition, not a finding. A usable gadget chain needs the exact class, the exact property names, and the exact method flow to still be present — and most of the time, they aren't.

CVSS predicts almost nothing about which of these actually gets exploited. Install base, remote fingerprintability, and whether the upload path runs before the framework's own protections predict it far better.

A webshell is one function call, deliberately. The closing post in the series: the minimal execution primitives, why disable_functions isn't a boundary, and the detection signal that repeats across every post in this series rather than being specific to any one of them.