跳至正文

springBoot漏洞原理与利用

简介

  • Spring 是 java web 里非常常见的组件了, 自然也是研究的热门, 好用的漏洞主要是
    Spring Boot Actuators 反序列化。
  • Spring Boot 基本上是 Spring 框架的扩展。 Actuator 是 Springboot 提供的用来
    对应用系统进行自省和监控的功能模块,借助于 Actuator ,开发者可以很方便地对应用系统的某些监控指标进行查看、统计等。在 Actuator 启用的情况下,如果没有做好相关权限控制,非法用户可通过访问默认的执行器端点( endpoints )来获取应用系统中的监控信息。

漏洞识别

  • 带有小绿叶
  • 404报错页面识别

利用点

  • 很多url接口可以利用,可以用自动化工具测出未授权访问的接口
  • 需要注意的是:spring 1.x 和 spring 2.x是的默认路由是不一样的,后者是 /actuator。

常见的漏洞点

1、信息泄露(主要是路由的未授权访问,导致配置等信息泄露,审计会发现漏洞点),以下是常见的路由:

/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

2、由于spring配置不当可能导致暴露路由
* 主要的利用点有

 /env  、/autuator/env
 /refresh 、 /actuator/refresh
 /restart 、 /actuator/restart
 /jolokia 、 /actuator/jolokia
 /trace 、 /actuator/httptrace
  • 主要的利用方式
获取脱敏的密码信息
利用命令执行反弹shell

Fofa 识别(识别springBoot框架)

icon_hash="116323821"
或
body="Whitelabel Error Page"

参考文献