Skip to content

Releases

php2shell-scanner v1.0.1

Choose a tag to compare

@Evil0ctal Evil0ctal released this 22 Oct 07:01

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.sha256

Single 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 one

These 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_keys is a MEDIUM review item showing key fingerprints (not HIGH); service accounts (nologin/false shell, verified against /etc/passwd) are LOW; /run systemd 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 with requirepass and firewall allow rules adjust exposed-port severity.
  • Remote: a WAF-evasion log signature for multipart Content-Type using 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 for UNKNOWN results.

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。

php2shell-scanner v1.0.0

Choose a tag to compare

@Evil0ctal Evil0ctal released this 22 Oct 05:42

First public release of php2shell-scanner: vulnerability detection and intrusion forensics for the PHP session.upload_progress RCE CVE-2026-109618 / CVE-2026-109619 ("php2shell").

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

php2shell-scanner.pyz is a single self-contained file — no installation, no dependencies, only Python 3.6.1+.

curl -fLO https://github.com/Evil0ctal/php2shell-scanner/releases/download/v1.0.0/php2shell-scanner.pyz
curl -fLO https://github.com/Evil0ctal/php2shell-scanner/releases/download/v1.0.0/php2shell-scanner.pyz.sha256
sha256sum -c php2shell-scanner.pyz.sha256

Usage

python3 php2shell-scanner.pyz                      # interactive menu
python3 php2shell-scanner.pyz scan example.com     # remote, non-destructive vulnerability check
sudo python3 php2shell-scanner.pyz forensics       # on the server: was it compromised?
python3 php2shell-scanner.pyz forensics --root /mnt/disk   # offline, mounted disk image

No python3 on the server? BT Panel / aaPanel ship one (/www/server/panel/pyenv/bin/python3); RHEL/Alma/Rocky 8 have /usr/libexec/platform-python.

Highlights

scan — remote, non-destructive. Cross-checks independent techniques: version fingerprint over several pages and rounds (load balancers, distro-backport hints), exposed phpinfo(), composer/easter-egg hints, a WAF reachability check that sends no session ID, and passive heap-leak detection. Never exploits anything; identifiable User-Agent; per-request and per-target time limits; same-host redirects only.

forensics — read-only, works even after PHP/phpMyAdmin were removed.

  • Poisoned PHP sessions, webshells (Behinder, Godzilla, AntSword, China Chopper, obfuscated, .ico includes), malicious .htaccess / .user.ini
  • Log evidence: LFI → session file, phpMyAdmin abuse, request bodies in WAF logs, served .env, OOM / Session object destruction failed
  • Persistence (cron, systemd, SSH keys, ld.so.preload), SSH/sudo auth logs, live processes and reverse shells, temp-dir droppers, MySQL UDF / INTO OUTFILE, trojaned system binaries
  • PHP apps (WordPress, Laravel, ThinkPHP, Drupal, Joomla, Magento, Discuz!, …), panels (1Panel, BT Panel, cPanel, Plesk, CyberPanel, HestiaCP, …), Docker / Podman containers seen from the host
  • Security baseline: firewall, exposed Redis/MySQL/Docker API/panel ports, SSH settings
  • Markdown report (plus optional JSON); O_NOATIME reads; symlink-safe --root; ReDoS-bounded signatures

Tested on Ubuntu 20.04/24.04, Debian 12, Rocky 9, AlmaLinux 8 (Python 3.6), Amazon Linux 2023, Alpine 3.20, openSUSE Leap 15.6 (Python 3.6) and Arch, against real PHP 7.4 / 8.2 / 8.3, WordPress and phpMyAdmin containers (297 automated tests).


中文说明

php2shell-scanner 首个正式版本:针对 PHP session.upload_progress 远程代码执行漏洞 CVE-2026-109618 / CVE-2026-109619(php2shell)的漏洞检测与入侵取证工具。

仅用于对你拥有或已获授权的系统进行漏洞检测和入侵取证,不得用于任何非法用途。

  • 下载:php2shell-scanner.pyz 是单文件版本,无需安装、零依赖,只要 Python 3.6.1+。下载后用 sha256sum -c php2shell-scanner.pyz.sha256 校验。
  • scan 远程检测:多种独立方法交叉验证,绝不进行利用,不发送任何 session ID。
  • forensics 入侵取证:严格只读,PHP/phpMyAdmin 已卸载也能查。覆盖投毒 session、webshell、日志痕迹、持久化后门、登录审计、进程与反弹 shell、MySQL 后门;支持主流 PHP 应用、宝塔/1Panel 等面板以及 Docker 容器;自动生成 Markdown 报告。
  • 没有 python3 的服务器:宝塔/aaPanel 可用自带的 /www/server/panel/pyenv/bin/python3。

详细文档见 README。

SHA-256

9c5fe4a11fb0e7a7b014494f615719fab35392e5768a8095c4b63648ac1ace7e  php2shell-scanner.pyz