estebanzarate/CVE-2025-47812-Wing-FTP-Server-7.4.3-Unauthenticated-RCE-PoC
GitHub: estebanzarate/CVE-2025-47812-Wing-FTP-Server-7.4.3-Unauthenticated-RCE-PoC
Wing FTP Server <= 7.4.3 未认证远程代码执行漏洞的 Python 验证脚本,通过 Lua 代码注入实现无需凭证的 RCE 攻击。
Stars: 1 | Forks: 0
# CVE-2025-47812 — Wing FTP Server <= 7.4.3 未认证 RCE (PoC)
## 原理
1. 向 `/loginok.html` 发送精心构造的 POST 请求,在 `username` 字段中注入 NULL 字节以及 Lua 代码。
2. 服务器创建一个包含未过滤用户名(包括 Lua payload)的 session 文件。
3. 携带返回的 UID cookie 对 `/dir.html` 发起 GET 请求,触发注入的 Lua 代码执行。
4. 脚本在命令之间执行登出操作,以避免触及服务器的并发 session 限制。
## 环境要求
- Python 3
- 安装依赖:
```
python3 -m venv venv
source venv/bin/activate
python3 -m pip install requests prompt_toolkit
```
## 使用方法
```
python3 exploit.py -u http://TARGET
```
**示例:**
```
$ python3 exploit.py -u http://10.10.10.10
[*] Targeting http://10.10.10.10
[*] Logging in with injected payload...
[*] Triggering payload...
[+] Target is vulnerable! Command output:
uid=0(root) gid=0(root) groups=0(root)
[+] Shell opened. Type 'exit' or Ctrl+C to quit.
Shell> whoami
root
```
## 参考
- [CVE-2025-47812](https://nvd.nist.gov/vuln/detail/CVE-2025-47812)
- [Wing FTP Server 7.4.4 发布版本 (修复)](https://www.wftpserver.com/)
- [4m3rr0r 提供的原始 PoC](https://github.com/4m3rr0r)
## 致谢
- **发现与原始利用:** Sheikh Mohammad Hasan aka [4m3rr0r](https://github.com/4m3rr0r)
- **清理与简化:** [Esteban Zárate](https://github.com/estebanzarate)
标签:CISA项目, CVE-2025-47812, Exploit-DB, Lua 注入, Penetration Testing, PoC, Python, RCE, rizin, Web 安全, Wing FTP Server, 文件传输协议, 无后门, 暴力破解, 未授权访问, 空字节注入, 编程工具, 认证绕过, 远程代码执行, 高危漏洞