Spring Boot 未授权访问漏洞利用

一、漏洞描述

Spring Boot是由Pivotal团队提供的一套开源框架,可以简化spring应用的创建及部署。它提供了丰富的Spring模块化支持,可以帮助开发者更轻松快捷地构建出企业级应用。Spring Boot通过自动配置功能,降低了复杂性,同时支持基于JVM的多种开源框架,可以缩短开发时间,使开发更加简单和高效,在应用系统中占比较大。因此当某些端点存在配置不当的时候,就有可能导致一些系统信息泄露、 RCE 等安全问题。

二、资产测绘

fofa:icon_hash=“116323821”
在这里插入图片描述

三、漏洞复现

1、常见路径泄露
● Spring Boot 1.x版本端点在根URL下注册
● Spring Boot 2.x版本端点移动到/actuator/路径
参考官网文档,其中常用的端点功能描述如下:
Actuator 禁用了大部分端点。因此,默认情况下只有 /health 和 /info 这两个端点可用。
● /auditevents 列出了与安全审计相关的事件,如用户登录/注销。此外,还可以根据 Principal 或类型等字段进行过滤。
● /beans 返回 BeanFactory 中所有可用的 Bean。与 /auditevents 不同,它不支持过滤。
● /conditions(之前称为 /autoconfig)会生成有关自动配置条件的报告。
● /configprops 允许获取所有 @ConfigurationProperties Bean。
● /env 返回当前环境属性(Environment Properties),也可以检索单个属性。
● /flyway 提供了有关 Flyway 数据库迁移的详细信息。
● /health 汇总了应用的健康状况。
● /heapdump 会构建并返回应用所用 JVM 的 Heap Dump。
● /info 返回一般信息。它可能是自定义数据、构建信息或最新提交的详细信息。
● /liquibase 的行为类似于 /flyway,但针对的是 Liquibase。
● /logfile 返回普通应用日志。
● /loggers 能够查询和修改应用的日志级别。
● /metrics 详细介绍了应用的指标。这可能包括通用指标和自定义指标。
● /prometheus 返回的指标与前一个类似,但格式化后可与 Prometheus 服务器一起使用。
● /scheduledtasks 提供了应用中每个计划(定时)任务的详细信息。
● /sessions 列出了 HTTP Session,前提是正在使用 Spring Session。
● /shutdown 可以优雅地关闭应用。
● /threaddump 会 dump 底层 JVM 的线程信息。
其中当heapdump、env、threaddump等端点存在未授权访问时,咱们可以从中获取到服务器存在的敏感信息,包括OSS秘钥、数据库连接密码、redis连接密码、配置环境等,导致系统信息泄露甚至丢失权限。

heapdump文件下载下来,可利用工具将其解密,获取敏感信息,如下:
在这里插入图片描述
2、Druid配置不当
(1)弱口令
(2)未授权导致SESSION泄露(可收集系统session、爆破遍历可用的session进入系统)
3、Swagger未授权访问
该页面下有大量系统接口,在该系统下可存在如下漏洞利用:
1.信息泄露
2.文件上传
3.未授权
4.SSRF
5.SQL注入
…等。
在这里插入图片描述
点击 Try it out --> Execute 可以调用接口并查看服务器返回数据,寻找不通功能点即可进行测试。
在这里插入图片描述

四、工具推荐

(1)SpringBootScan-GUI(扫描未授权路径,及其他rce漏洞验证利用)
(2)heapdump_tool.jar(解密heapdump文件获取敏感信息)
(3)swagger-hack-main(未授权接口利用)
(4)Burp插件:APIKit(被动接口未授权扫描,挂着捡洞即可)
**

五、常见字典

**
/v2/api-docs
/swagger-ui.html
/swagger
/api-docs
/api.html
/swagger-ui
/swagger/codes
/api/index.html
/api/v2/api-docs
/v2/swagger.json
/swagger-ui/html
/distv2/index.html
/swagger/index.html
/sw/swagger-ui.html
/api/swagger-ui.html
/static/swagger.json
/user/swagger-ui.html
/swagger-ui/index.html
/swagger-dubbo/api-docs
/template/swagger-ui.html
/swagger/static/index.html
/dubbo-provider/distv2/index.html
/spring-security-rest/api/swagger-ui.html
/spring-security-oauth-resource/swagger-ui.html
/mappings
/metrics
/beans
/configprops
/actuator/metrics
/actuator/mappings
/actuator/beans
/actuator/configprops
/actuator
/auditevents
/autoconfig
/beans
/caches
/conditions
/configprops
/docs
/dump
/env
/flyway
/health
/heapdump
/httptrace
/info
/intergrationgraph
/jolokia
/logfile
/loggers
/liquibase
/metrics
/mappings
/prometheus
/refresh
/scheduledtasks
/sessions
/shutdown
/trace
/threaddump
/actuator/auditevents
/actuator/beans
/actuator/health
/actuator/conditions
/actuator/configprops
/actuator/env
/actuator/info
/actuator/loggers
/actuator/heapdump
/actuator/threaddump
/actuator/metrics
/actuator/scheduledtasks
/actuator/httptrace
/actuator/mappings
/actuator/jolokia
/actuator/hystrix.stream

(1)正在学习网络安全的小伙伴,有需要安全资料或者CISP资料的可以关注安全技术达人公众号,后期回不断分享安全知识,回复“学习资料”可领取网络安全书籍。
(2)有需要本文中工具的可以在公众号回复“工具

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值