nomaisthere/CVE-2023-4861-PoC
GitHub: nomaisthere/CVE-2023-4861-PoC
CVE-2023-4861 的 Python PoC 脚本,自动化验证 WordPress Filester 插件认证后任意文件上传导致远程代码执行的漏洞利用流程。
Stars: 2 | Forks: 0
# CVE-2023-4861 PoC
此仓库包含了一个针对 **CVE-2023-4861** 的 Python 概念验证(PoC),这是 WordPress 插件 **File Manager Pro - Filester** 中的一个**认证后远程代码执行**漏洞。
## 漏洞概述
- CVE:`CVE-2023-4861`
- 产品:`File Manager Pro - Filester` (`filester`)
- 受影响版本:`< 1.8.1`
- 已修复版本:`1.8.1`
- 漏洞类型:认证后的任意文件上传导致 RCE
- 所需权限:Filester 的 `Admin+`
## 此 PoC 的功能
`exploit.py` 自动化了公开安全通告中描述的基本结果:
1. 使用有效的已认证 WordPress session cookie。
2. 打开 Filester 管理页面并提取插件 nonce。
3. 读取当前的编辑器限制。
4. 更改限制以允许访问 `/var/www/html/` 并允许上传 `.php` 文件。
5. 通过 Filester 的 connector 创建一个 PHP 文件。
6. 将一个简单的 webshell 写入该文件。
7. 使用您选择的命令触发 webshell。
重要实现细节:我的 PoC 假设目标 Web 根目录是 `/var/www/html/`。这在请求数据中是硬编码的,可能需要针对其他实验环境进行调整。
## 环境要求
- Python 3
- 存在漏洞的 Filester 安装
- 一个有效的已认证 cookie 字符串,且该 session 有权访问 Filester 界面
## 安装
克隆此仓库并进入目录:
```
git clone https://github.com/nomaisthere/CVE-2023-4861-PoC.git
cd CVE-2023-4861-PoC
```
安装依赖项:
```
pip install requests
```
## 使用方法
显示帮助信息:
```
python3 exploit.py --help
```
基础示例:
```
python3 exploit.py --url http://target-wordpress --command id \
--cookie 'wordpress_logged_in_xxx=...; wordpress_sec_xxx=...'
```
自定义 shell 名称:
```
python3 exploit.py --url http://target-wordpress --shell-name shell.php --command whoami \
--cookie 'wordpress_logged_in_xxx=...; wordpress_sec_xxx=...'
```
## 注意事项
- 这是一个**需要认证**的漏洞利用。它不是未经认证的 RCE。
- 仅在您拥有或获得明确授权测试的环境中使用此工具。我对您使用它所做的任何事情概不负责。
## 参考
- NVD:https://nvd.nist.gov/vuln/detail/CVE-2023-4861
- WPScan 通告:https://wpscan.com/vulnerability/7fa03f00-25c7-4e40-8592-bb4001ce019d/
- WordPress.org 插件页面:https://wordpress.org/plugins/filester/
标签:逆向工具