Springboot heapdump信息泄露以及MAT分析
1. Springboot信息泄露
1.1 可能泄露路由列表
/api-docs
/v2/api-docs
/swagger-ui.html
/api.html
/sw/swagger-ui.html
/api/swagger-ui.html
/template/swagger-ui.html
/spring-security-rest/api/swagger-ui.html
/spring-security-oauth-resource/swagger-ui.html
/mappings
/actuator/mappings
/metrics
/actuator/metrics
/beans
/actuator/beans
/configprops
/actuator/configprops
/actuator
/auditevents
/autoconfig
/caches
/conditions
/docs
/dump
/env
/flyway
/health
/heapdump
/httptrace
/info
/intergrationgraph
/jolokia
/logfile
/loggers
/liquibase
/prometheus
/refresh
/scheduledtasks
/sessions
/shutdown
/trace
/threaddump
/actuator/auditevents
/actuator/health
/actuator/conditions
/actuator/env
/actuator/info
/actuator/loggers
/actuator/heapdump
/actuator/threaddump
/actuator/scheduledtasks
/actuator/httptrace
/actuator/jolokia
/actuator/hystrix.stream
/trace
:顯示最近的http包信息,可能泄露當前系統存活的Cookie信息。
/env
:應用的環境信息,包含Profile、系統環境變量和應用的properties信息,可能泄露明文密碼與接口信息。
/jolokia
:RCE漏洞
/heapdump
:JVM內存信息,分析出明文密碼
1.2 heapdump
Heap Dump也叫堆轉儲文件,是一個Java進程在某個時間點上的內存快照。
可以使用Eclipse MemoryAnalyzer 工具對泄露的heapdump文件進行分析,查詢加載到內存中的明文密碼信息。
獨立版下載地址:http://www.eclipse.org/mat/downloads.php
2 實際環境
2.1 Springboot信息泄露測試
Burpsuite Intruder模塊掃描
2.2 heapdump讀取
2.2 heapdump分析
spring boot 1.x 版本 heapdump 查詢結果,最終結果存儲在 java.util.Hashtable$Entry 實例的鍵值對中
select * from org.springframework.web.context.support.StandardServletEnvironment
select * from java.util.Hashtable$Entry x WHERE (toString(x.key).contains("password"))
spring boot 2.x 版本 heapdump 查詢結果,最終結果存儲在 java.util.LinkedHashMap$Entry 實例的鍵值對中:
select * from java.util.LinkedHashMap$Entry x WHERE (toString(x.key).contains("password"))
讀取Redis明文密碼