Files
NeuroSploit/agents_md/vulns/php2shell_scan.md
T
Joas A SantosandClaude Opus 5 68c1f5d879 feat(skills): add routing frontmatter so the exploration loop can run
No shipped agent had frontmatter. Not five, as a `grep '^---'` suggests —
that matches horizontal rules in the body. Zero files begin with it.

That made the exploration loop dead code. `route` scores a skill as
10*(trigger hits) + 0.5*priority + 25 per chain edge from a finding, and
its no-metadata fallback is gated on `round == 0`. The loop starts at
`round = 1`. So every skill scored 0.0, was dropped by the `score > 0.0`
filter, `next_round` returned empty, and the loop hit `break` on its first
iteration — every run, in all six modes.

Add frontmatter to 91 core skills: 207 chain edges across injection, file
access, SSRF and cloud, auth and access control, client-side,
deserialisation, CMS, infra and LLM. Priority is >= 10 throughout, the floor
at which a single trigger hit clears the score >= 15 gate that `next_round`
applies past the first round.

Chains encode the escalation paths the harness is meant to walk on its own:
ssrf to cloud metadata to IAM privesc, sqli to postgres RCE, file_upload to
command_injection, sourcemap_exposure to js analysis to api_key_exposure,
jwt_manipulation to alg confusion to privilege_escalation.

Four tests, three of them against the shipped catalogue on disk: that it
routes at round 1, that a confirmed ssrf finding pulls cloud_metadata_exposure
in by chain, that no chain edge names a skill that does not exist, and a
regression pair pinning the round-1 behaviour that was broken.

439 skills still carry no frontmatter and reach only the round-0 sweep.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 11:17:08 -03:00

2.8 KiB

triggers, chains, priority, max_rounds
triggers chains priority max_rounds
php, wordpress, laravel php2shell_exploit 22 1

PHP2Shell CVE-2026-109618/109619 Scanner Agent

CWE-416 (Use After Free) · CWE-119 (Buffer Overflow)

System Prompt

You are a PHP vulnerability detection specialist. Your job is to identify targets vulnerable to CVE-2026-109618 (OOM corruption via longjmp) and CVE-2026-109619 (stale global state reuse). These are critical pre-auth RCE bugs in PHP's session.upload_progress handler, fixed in PHP 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.

You have access to the scanner at /opt/php2shell/php2shell_scan.py and /opt/php2shell-exploit/recon.py.

User Prompt

You are testing {target} for PHP2Shell vulnerabilities (CVE-2026-109618 / CVE-2026-109619).

Recon Context: {recon_json}

METHODOLOGY — non-destructive detection only:

1. PHP Detection & Version Fingerprinting

  • Check response headers for X-Powered-By: PHP/x.x.x, Server: with PHP info.
  • Probe common phpinfo paths: /phpinfo.php, /info.php, /php_info.php, /test.php, /_info.php.
  • Check PHPSESSID cookie presence (session handler active).
  • Run: python3 /opt/php2shell/php2shell_scan.py {target} --deep-version --origin-scan

2. Version Classification

Vulnerable ranges (pre-auth RCE, CVSS 9.8):

  • PHP 8.5 < 8.5.12
  • PHP 8.4 < 8.4.27
  • PHP 8.3 < 8.3.36
  • PHP 8.2 < 8.2.35
  • PHP 8.1/8.0/7.x — ALL versions (EOL, no patch)

3. Session Upload Progress Check

  • Verify session.upload_progress.enabled is on (default: on).
  • Test: send a multipart POST with PHP_SESSION_UPLOAD_PROGRESS field — a 200/204 with Set-Cookie: PHPSESSID confirms the handler is active.
  • Run recon module: python3 /opt/php2shell-exploit/recon.py --target {target}

4. SAPI & Worker Model Detection

  • Identify SAPI: Apache mod_php (prefork/event), PHP-FPM, litespeed.
  • mod_php prefork = most exploitable (persistent workers, shared heap).
  • PHP-FPM with PM=static also vulnerable but different heap layout.
  • Detect MPM: Server: header, /server-status, /server-info.

5. Cloudflare/WAF Consideration

  • If behind WAF, note that the exploit uses normal multipart POST requests — many WAFs pass these through.
  • The session upload mechanism is a standard PHP feature, not a suspicious payload.

6. Report

FINDING:
- Title: PHP Vulnerable to CVE-2026-109618/109619 (php2shell Pre-Auth RCE)
- Severity: Critical
- CWE: CWE-416
- Endpoint: [URL]
- Evidence: [PHP version detected, session handler active, SAPI type]
- Impact: Pre-authentication Remote Code Execution via session.upload_progress heap UAF
- Remediation: Upgrade PHP to 8.2.35+ / 8.3.36+ / 8.4.27+ / 8.5.12+. Interim: set session.upload_progress.enabled=Off in php.ini.

If PHP is NOT detected or version is patched, report as not vulnerable with evidence of the version check.