0x00 前提
swagger-ui 官方站點
swagger ui 簡介
Swagger UI允許任何人(無論您是開發團隊還是最終用戶)都可以可視化API資源并與之互動,而無需任何實作邏輯,它是根據您的OpenAPI(以前稱為Swagger)規范自動生成的,具有可視化檔案,可簡化后端實作和客戶端使用,
簡單的說就是個API檔案吧,,
該檔案一般在首頁或者介面目錄(一般spring boot也可能整合swagger-ui)也可能在任何地方,
FUZZ字典
/api.html
sw
swagger
swagger-resources
swagger-ui
swagger-ui.html
swagger.json
swagger.yaml
swagger/index.html
swagger/swagger-ui.htm
swagger/swagger-ui.html
swagger/ui
swagger/v1/swagger.json
swaggerui
swagger/static/index.html
user/swagger-ui.html
static/swagger.json
distv2/index.html
swagger-ui/html
v2/swagger.json
api/v2/api-docs
api/index.html
swagger/codes
/sw/swagger-ui.html
/api/swagger-ui.html
template
/template/swagger-ui.html
/spring-security-rest/api/swagger-ui.html
/spring-security-oauth-resource/swagger-ui.html
/api-docs
/v2/api-docs
/swagger-ui.html
swagger-resources
core/latest/swagger-ui/index.html
csp/gateway/slc/api/swagger-ui.html
api/
api/2/explore/
api/2/issue/createmeta
api/error_log
api/jsonws
api/jsonws/invoke
api/login.json
api/package_search/v4/documentation
api/swagger
api/swagger-ui.html
api/swagger.yml
api/v1
api/v2
api/v2/helpdesk/discover
api/v3
apibuild.pyc
apidoc
apidocs
有的時候遇到了swagger-ui介面檔案,就是例如
swagger-resources
swagger.json
這種介面檔案,但是swagger-ui.html這個前端頁面被洗掉的話,就很麻煩,得想辦法決議這些介面檔案,所以有了這篇水文,,,
0x01 進入正題
0.目標站點僅有介面檔案,無swagger ui前端頁面的情況
一般情況能訪問swagger-ui.html等前端頁面的就先不說,主要是說只能訪問到swagger-ui的介面頁面
例如

然后不想肉眼看json咋辦?
我有個比較懶的想法………………
自己下載一個swagger-ui然后本地加載
1.下載swagger-ui
github
找到dist檔案夾

里面的index.html就是啦
雙擊打開

nice,我們就利用這個去搞
2.下載swagger-ui配置檔案
2.1將檔案內容復制下來保存未json,放在統一目錄下(方便管理嘛,笑:)

2.2將dist這個檔案夾拷貝到你的http服務里面去(當然你也可以使用python搭建起一個簡易的web服務)
為什么要這么操作?因為不這么操作就很可能需要cors跨域了,,,
2.3打開你下載的swagger-ui.html,我這邊搭建的則是http://127.0.0.1/swagger-ui-3.51.1/dist/index.html
這里輸入組態檔的地址(我放在統一目錄了,注意跨域問題……不然可能會加載不了,同一web服務下就肯定不會有這種問題啦)

直接將組態檔加載出來了

此外可能json組態檔還需要修改其他的會比較好用,比如path(路徑)不一致,host(域名)不一致,這個只需要修改json里面的就好了

隨意點擊一個介面

抓取資料包,,,沒毛病,可以進行測驗了,,,

3.無,,,,,
就這么簡短且無趣
0x02 其他
有緣人可逛逛本人博客:https://wiki.c1o2a3.xyz???????
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/293096.html
標籤:其他
