Repository navigation
Maintenance release of php2shell-scanner for the PHP session.upload_progress RCE CVE-2026-109618 / CVE-2026-109619 ("php2shell"). Non-destructive remote detection + read-only server forensics, now with drop-in IDS/WAF/SIEM rules.
Warning
For vulnerability detection and intrusion forensics on systems you own or are explicitly authorised to test only. Do not use it for any illegal purpose.
Download
curl -fLO https://github.com/Evil0ctal/php2shell-scanner/releases/download/v1.0.1/php2shell-scanner.pyz
curl -fLO https://github.com/Evil0ctal/php2shell-scanner/releases/download/v1.0.1/php2shell-scanner.pyz.sha256
sha256sum -c php2shell-scanner.pyz.sha256Single self-contained file, Python 3.6.1+ only.
What's new since v1.0.0
New: rules command — monitor and block going forward. Bundled Suricata, Sigma, ModSecurity and OpenResty detection rules extract straight from the single-file build:
php2shell-scanner.pyz rules -o /etc/suricata/php2shell # write all rules
php2shell-scanner.pyz rules --list # list them
php2shell-scanner.pyz rules --stdout php2shell.rules # print oneThese are detection rules (they catch exploitation in traffic and logs); they contain no exploit code. Ported from ikow/php2shell-poc and dinosn/php-cve-2026-10961x-lab-poc, with attribution kept.
Runs politely on production hosts. forensics now lowers itself to CPU nice 19 and the lowest best-effort IO priority, and drops the page cache of every large file it reads, so it does not evict what MySQL/Redis/nginx keep cached (--no-throttle to opt out). It no longer reads /var/log/messages/syslog by default. On a real BT Panel server this cut a full scan from ~8 min and ~1.4 GB read to 29 s and ~60 MB, 53 MB peak memory, MySQL unaffected.
Detection accuracy (fixes from a live BT Panel + MySQL + Redis + nginx scan).
- Auth logs: understand the modern OpenSSH
Accepted publickey ... ssh2: ED25519 SHA256:...line (public-key logins were being missed); deduplicate records repeated across rotated logs. - Fewer false positives: recently changed
authorized_keysis a MEDIUM review item showing key fingerprints (not HIGH); service accounts (nologin/falseshell, verified against/etc/passwd) are LOW;/runsystemd units are not "recent persistence"; phpMyAdmin used only from loopback/private addresses is INFO; root SSH login is flagged only when password auth is enabled; Redis withrequirepassand firewallallowrules adjust exposed-port severity. - Remote: a WAF-evasion log signature for multipart
Content-Typeusing a non-standard separator; patched targets now note the Chain A residual risk (upload_progress stores the filename verbatim, so any LFI can still reach RCE) without changing the verdict; neutral advice forUNKNOWNresults.
Hardening carried over from v1.0.0 security review: syslog-tag-anchored auth parsing (injected usernames cannot forge findings), ReDoS-bounded .htaccess selectors, per-request/per-target HTTP deadlines, symlink-safe report writing.
317 automated tests; verified on Ubuntu, Debian, Rocky, Alma (Python 3.6), Amazon Linux, Alpine, openSUSE (Python 3.6), Arch, and against real PHP 7.4 / 8.2 / 8.3, WordPress and phpMyAdmin containers plus a live production server.
SHA-256
e047d213e08b9d31161af3d640d9b543bc140fd849e4a23110e946fce7bcaebe php2shell-scanner.pyz
中文说明
php2shell-scanner 的维护版本,针对 PHP session.upload_progress 远程代码执行漏洞 CVE-2026-109618 / CVE-2026-109619。非破坏性远程检测 + 只读入侵取证,新增可直接部署的 IDS/WAF/SIEM 检测规则。
仅用于对你拥有或已获授权的系统进行漏洞检测和入侵取证,不得用于任何非法用途。
v1.0.0 以来的更新:
- 新增
rules命令:内置 Suricata、Sigma、ModSecurity、OpenResty 检测规则,可从单文件直接导出部署(php2shell-scanner.pyz rules -o 目录)。这些是检测规则,不含利用代码,移植自 ikow 和 dinosn 的仓库并保留署名。 - 对生产服务器友好:取证默认降到最低 CPU/IO 优先级并释放读过的文件缓存,不影响 MySQL/Redis/nginx;默认不再读
/var/log/messages。真实宝塔服务器上,完整扫描从约 8 分钟、读 1.4 GB 降到 29 秒、约 60 MB,内存峰值 53 MB,MySQL 未受影响。 - 检测更准(来自一台真实宝塔生产机的实测修正):识别新版 OpenSSH 的公钥登录日志(原先漏报);大幅减少误报——最近修改的密钥降为 MEDIUM 并显示指纹、服务账户为 LOW、
/run下的 systemd 单元不再误报、仅本机访问的 phpMyAdmin 为 INFO、仅密钥登录时不再提示 root 登录、设置了密码的 Redis 及防火墙放行规则会调整端口暴露的等级。 - 远程检测:新增针对 multipart
Content-Type非标准分隔符的 WAF 绕过日志特征;对已修复目标提示 Chain A 残余风险但不改变结论。
共 317 个自动化测试,已在多个 Linux 发行版(含 Python 3.6)和真实 PHP / WordPress / phpMyAdmin 容器及一台线上服务器验证。详见 README。