Back to Articles

Analyzing the Latest PHP2Shell Probes and Exploits

By Daniel Cid (@dcid) • Posted in: security-research, malware-analysis •

Attackers are no longer just checking for PHP2Shell; they're trying to run code with it. On November 25 we captured the full contents of every PHP2Shell request blocked on our network for a day, 75 requests in all. They came from three different tools, and 72 of them carried a payload built to execute a command on the server.

The three tools show the steps of the attack, from a one-field check to a working code-execution test. This post walks through each request, decodes the payload, and lists what you can search for in your own logs. All of these requests were blocked by the NOC WAF before reaching the sites they targeted. If you can't patch yet, see our earlier guide, PHP2Shell: what to do when you can't just upgrade.

Prefer to watch? The video walks through each tool, decodes the payload, and covers how to protect a PHP server.

The Mechanism Every Payload Relies On

All three payloads target the same PHP feature: session upload progress. PHP2Shell is the name for the critical flaws in this code path (CVE-2026-109618 and CVE-2026-109619, fixed in the October 21, 2026 PHP releases, plus CVE-2026-115560, disclosed October 23).

The feature works like this:

  1. It's enabled by default (session.upload_progress.enabled = 1).
  2. When a multipart POST includes a field named PHP_SESSION_UPLOAD_PROGRESS, PHP starts tracking the upload, even if the script never asked for it. Any PHP page that accepts a POST will do.
  3. PHP records the progress in the session, under a key built from that field's value, and the file names come straight from the request.
  4. The session is identified by the PHPSESSID the client sends, so the client can choose which session gets written.

The attacker controls the session ID, the key name and part of what is written to the session, before the application runs a single line of its own code. Each payload below uses this to a different degree.

Payload 1: The Minimal Check

The simplest request only tests whether the server reacts to the upload-progress field at all. One request, from 186.244.208.205:

POST / HTTP/1.1
User-Agent: Go-http-client/1.1
Content-Type: multipart/form-data; boundary=injectlabt2probe
Content-Length: 115

--injectlabt2probe
Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"

1
--injectlabt2probe--
  • One field, value 1. No session ID, no file. It's the smallest valid request that reaches the upload-progress handler.
  • The user agent is Go's default HTTP client. The tool makes no attempt to look like a browser.
  • The boundary names the tool. injectlabt2probe isn't random, which makes it easy to search for.

On its own, this request can't harm a server. It's most likely a first pass that finds which sites run PHP and accept multipart POSTs.

Payload 2: The Vulnerability Check

The second tool tests the full precondition of the attack: whether it can make PHP write upload-progress data into a session it chose. Two requests, from 45.138.12.180 and 185.218.86.7:

POST / HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
Content-Type: multipart/form-data; boundary=P2SPROBE
Content-Length: 273

--P2SPROBE
Content-Disposition: form-data; name="PHPSESSID"

p2sprobe5e96e99719b9
--P2SPROBE
Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"

scancheck
--P2SPROBE
Content-Disposition: form-data; name="f"; filename="test.txt"

X
--P2SPROBE--

Field by field:

Part Value Purpose
PHPSESSID p2sprobe5e96e99719b9 Sets the session ID. The p2sprobe prefix plus 12 random hex characters lets the scanner match a response to its target.
PHP_SESSION_UPLOAD_PROGRESS scancheck Turns on upload-progress tracking. The value becomes part of the session key.
File test.txt X A 1-byte upload, so PHP has an upload to track.
Boundary P2SPROBE Fixed, and named after the attack.

The order matters: the session ID field comes before the upload-progress field, so it's already set when PHP starts tracking. Every value is harmless. If the server accepts the request, the attacker knows it can write data into a session file whose name it picked, which is the step the exploit needs.

The user agent claims to be Chrome on Windows but stops after AppleWebKit/537.36, with no browser name. Real browsers never send it cut short like this.

Payload 3: The Code-Execution Test

The third tool goes straight for code execution, and it sent 72 of the 75 requests. They came from 12 addresses in two networks, 91.92.47.0/24 (9 addresses, commercial VPN exits) and 45.138.12.0/24 (3 addresses), against 24 sites:

POST /index.php HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Content-Type: multipart/form-data; boundary=----svsP2sFormBoundary7Q1
Content-Length: 362

------svsP2sFormBoundary7Q1
Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"

<?php echo "svs_p2s_" . "open"; system(base64_decode("aWQ=")); echo "svs_p2s_" . "close"; ?>
------svsP2sFormBoundary7Q1
Content-Disposition: form-data; name="svs_probe"; filename="svs_probe.txt"
Content-Type: text/plain

svs
------svsP2sFormBoundary7Q1--

Decoding the Payload

The upload-progress field now holds PHP code instead of a harmless word. Spread out, it reads:

<?php
echo "svs_p2s_" . "open";       // start marker
system(base64_decode("aWQ="));  // aWQ= decodes to "id": run it as a shell command
echo "svs_p2s_" . "close";      // end marker
?>
  • system() runs a command in the server's shell and prints its output.
  • aWQ= is base64 for id, a command that prints the user and groups the web server runs as, for example uid=33(www-data) gid=33(www-data). Encoding it keeps the command name out of simple keyword filters.
  • The markers are split into two strings ("svs_p2s_" . "open"), so the request itself never contains svs_p2s_open. That string can only appear in a response if the PHP code actually ran.

If a response contains svs_p2s_open, the user line from id, then svs_p2s_close, the scanner has proof of remote code execution and knows the server's user account. id is harmless by itself; a server that runs it will run whatever the attacker sends next.

The request alone doesn't show how the tool expects the code to run. Written into a session file, the code executes if a vulnerable script later includes that file; the PHP2Shell memory-corruption flaws are reported to open other paths. Either way, the markers tell the scanner whether it worked.

How It Is Delivered

  • Three paths per site. Each site receives the same request at /, /index.php and /upload.php, seconds apart. PHP processes the upload-progress field before the script runs, so any PHP entry point works; three paths raise the odds of hitting one.
  • A decoy file. The svs_probe.txt upload, containing svs, gives PHP an upload to track. The svs prefix appears in every name the tool uses.
  • A full browser user agent. Unlike payload 2, this tool sends a complete Chrome 131 string.
  • Two networks, one tool. Requests from 91.92.47.0/24 and 45.138.12.0/24 are byte-for-byte identical, boundary included.
  • Targets in alphabetical order. The sites appear in alphabetical order of their domain names, a sign the tool is working through a sorted list.

The Three Payloads Side by Side

Each tool goes one step further than the one before it:

Payload 1 Payload 2 Payload 3
Goal Find PHP servers that accept multipart Confirm session control Prove code execution
Requests captured 1 2 72
Boundary injectlabt2probe P2SPROBE ----svsP2sFormBoundary7Q1
Upload-progress value 1 scancheck PHP code running id
Session ID None p2sprobe + 12 hex None
File None test.txt (X) svs_probe.txt (svs)
Paths / / /, /index.php, /upload.php
User agent Go-http-client/1.1 Chrome string, cut short Full Chrome 131 string
Sources 186.244.208.205 45.138.12.180, 185.218.86.7 91.92.47.0/24, 45.138.12.0/24
Harmful if accepted No No, but proves the server is exposed Yes: runs a shell command

Indicators and Protection

If you log request bodies or WAF events, search for:

  • the boundaries ----svsP2sFormBoundary7Q1, P2SPROBE and injectlabt2probe
  • PHP_SESSION_UPLOAD_PROGRESS fields holding PHP code, the strings svs_p2s_, or the value scancheck
  • uploads named svs_probe.txt or test.txt, and multipart fields named PHPSESSID
  • the same multipart POST to /, /index.php and /upload.php within seconds
  • svs_p2s_open in your own responses: a sign the payload ran, and the server needs incident response, not just a patch

With access logs only, look for multipart POSTs from 91.92.47.0/24, 45.138.12.0/24, 185.218.86.7 and 186.244.208.205. Block lists alone won't hold: the same tools run from many more addresses.

To protect a PHP server:

  1. Update PHP to the October 21, 2026 releases or later.
  2. Set session.upload_progress.enabled = 0 unless you use upload progress bars. Set it in php.ini or with php_admin_value in the PHP-FPM pool, then restart PHP-FPM or Apache; .user.ini and ini_set() don't work for this. This also covers CVE-2026-115560, which the October releases don't fix.
  3. If your site sits behind the NOC WAF, make sure the origin only accepts traffic from NOC, so these requests can't reach it directly.

Sites on the NOC network have had a WAF rule against this attack since October 21. Every request in this post was blocked by it.

Sources

Have an interesting payload you'd like us to analyze? Email support@noc.org.

NOC: Authoritative DNS, CDN and WAF

Accelerate and protect your sites with global DNS, edge caching, and an always-on web application firewall.

See Plans