-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
91 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Kacper Szurek | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SwaggerHelper | ||
|
||
SwaggerHelper是用于启动本地保存的api-docs.json文档,例如在对系统进行**二次**渗透测试时,若目标关闭了Swagger-UI,则可使用本工具在本地启动接口文档(前提是api-docs文档已离线保存在本地),直接调用目标接口。 | ||
|
||
# 编译 | ||
|
||
> 编译该工具需要go 1.16或更高版本 | ||
`$ go build` | ||
|
||
# 使用方法 | ||
|
||
``` | ||
usage: SwaggerHelper [-h|--help] [-L|--listen "<value>"] -F|--apifile "<value>" | ||
[-S|--serverroot "<value>"] | ||
Arguments: | ||
-h --help Print help information | ||
-L --listen bind address.. Default: 127.0.0.1:1323 | ||
-F --apifile swagger-ui api-docs file path. | ||
-S --serverroot server override.. Default: | ||
``` | ||
|
||
若不需要覆盖api-docs内部的host和bashPath,直接执行如下命令: | ||
|
||
`SwaggerHelper -F /to/path/api-docs.json` | ||
|
||
若因为CORS限制或服务器地址更改需要另外指定API根路径的,执行如下命令: | ||
|
||
`SwaggerHelper -F /to/path/api-docs.json -S http://1.2.3.4/api` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters