Skip to content

Commit

Permalink
Update api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 6, 2024
1 parent fe61b9f commit 283e8d1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
48 changes: 46 additions & 2 deletions docs/api/sca.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MODE_PKG|(int) 2|

|函数名|函数描述/介绍|
|:------|:--------|
| [sca.NewAnalyzerResult](#newanalyzerresult) ||
| [sca.ScanContainerFromContext](#scancontainerfromcontext) ||
| [sca.ScanFilesystem](#scanfilesystem) ||
| [sca.ScanGitRepo](#scangitrepo) ||
Expand All @@ -36,11 +37,33 @@ MODE_PKG|(int) 2|
| [sca.ScanLocalFilesystem](#scanlocalfilesystem) ||
| [sca.analyzers](#analyzers) ||
| [sca.concurrent](#concurrent) ||
| [sca.customAnalyzer](#customanalyzer) ||
| [sca.endpoint](#endpoint) ||
| [sca.scanMode](#scanmode) ||


## 函数定义
### NewAnalyzerResult

#### 详细描述


#### 定义

`NewAnalyzerResult(name string, version string) *CustomPackage`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| name | `string` | |
| version | `string` | |

#### 返回值
|返回值(顺序)|返回值类型|返回值解释|
|:-----------|:---------- |:-----------|
| r1 | `*CustomPackage` | |


### ScanContainerFromContext

#### 详细描述
Expand Down Expand Up @@ -70,12 +93,12 @@ MODE_PKG|(int) 2|

#### 定义

`ScanFilesystem(p fs.FS, opts ...ScanOption) ([]*dxtypes.Package, error)`
`ScanFilesystem(p fi.FileSystem, opts ...ScanOption) ([]*dxtypes.Package, error)`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| p | `fs.FS` | |
| p | `fi.FileSystem` | |
| opts | `...ScanOption` | |

#### 返回值
Expand Down Expand Up @@ -213,6 +236,27 @@ MODE_PKG|(int) 2|
| r1 | `ScanOption` | |


### customAnalyzer

#### 详细描述


#### 定义

`customAnalyzer(matchFunc func(info analyzer.MatchInfo) int, analyzeFunc func(fi *analyzer.FileInfo, otherFi map[string]*analyzer.FileInfo) []*analyzer.CustomPackage) ScanOption`

#### 参数
|参数名|参数类型|参数解释|
|:-----------|:---------- |:-----------|
| matchFunc | `func(info analyzer.MatchInfo) int` | |
| analyzeFunc | `func(fi *analyzer.FileInfo, otherFi map[string]*analyzer.FileInfo) []*analyzer.CustomPackage` | |

#### 返回值
|返回值(顺序)|返回值类型|返回值解释|
|:-----------|:---------- |:-----------|
| r1 | `ScanOption` | |


### endpoint

#### 详细描述
Expand Down
2 changes: 1 addition & 1 deletion docs/api/simulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ htmlChangeMode|(simulator.loginDetectMode) 1|
leaklessDefault|(simulator.LeaklessMode) 0|
leaklessOff|(simulator.LeaklessMode) -1|
leaklessOn|(simulator.LeaklessMode) 1|
simple|(map[string]interface {}) map[string]interface {}{"bodyModifyTarget": "body", "bodyReplaceTarget": "bodyReplace", "createBrowser": (func(...simple.BrowserConfigOpt) *simple.VBrowser)(0x2713900), "headersModifyTarget": "headers", "headless": (func(bool) simple.BrowserConfigOpt)(0x2713340), "hostModifyTarget": "host", "noSandBox": (func(bool) simple.BrowserConfigOpt)(0x27132c0), "proxy": (func(string, ...string) simple.BrowserConfigOpt)(0x2713100), "requestModify": (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x2713660), "responseModify": (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x27133c0), "wsAddress": (func(string) simple.BrowserConfigOpt)(0x2713020)}|
simple|(map[string]interface {}) map[string]interface {}{"bodyModifyTarget": "body", "bodyReplaceTarget": "bodyReplace", "createBrowser": (func(...simple.BrowserConfigOpt) *simple.VBrowser)(0x27154e0), "headersModifyTarget": "headers", "headless": (func(bool) simple.BrowserConfigOpt)(0x2714f20), "hostModifyTarget": "host", "noSandBox": (func(bool) simple.BrowserConfigOpt)(0x2714ea0), "proxy": (func(string, ...string) simple.BrowserConfigOpt)(0x2714ce0), "requestModify": (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x2715240), "responseModify": (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x2714fa0), "wsAddress": (func(string) simple.BrowserConfigOpt)(0x2714c00)}|
urlChangeMode|(simulator.loginDetectMode) 0|

|函数名|函数描述/介绍|
Expand Down
17 changes: 16 additions & 1 deletion docs/api/synscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| [synscan.iface](#iface) |iface syn scan 的配置选项,设置 syn 扫描的网卡 @param {string} iface 网卡名称 @return {scanOpt} 返回配置选项 |
| [synscan.initHostFilter](#inithostfilter) |initHostFilter syn scan 的配置选项,设置本次扫描的主机过滤器,只展示这些主机的扫描结果 @param {string} f 主机,支持逗号、CIDR、-分割 @return {scanOpt} 返回配置选项 |
| [synscan.initPortFilter](#initportfilter) |initPortFilter syn scan 的配置选项,设置本次扫描的端口过滤器,只展示这些端口的扫描结果 @param {string} f 端口,支持逗号、-分割 @return {scanOpt} 返回配置选项 |
| [synscan.maxPorts](#maxports) ||
| [synscan.maxPorts](#maxports) |maxOpenPorts syn scan 的配置选项,设置单个 IP 允许的最大开放端口数 @param {int} max 最大开放端口数 @return {scanOpt} 返回配置选项 |
| [synscan.outputFile](#outputfile) |outputFile syn scan 的配置选项,设置本次扫描结果保存到指定的文件 @param {string} file 文件路径 @return {scanOpt} 返回配置选项 |
| [synscan.outputPrefix](#outputprefix) |outputPrefix syn scan 的配置选项,设置本次扫描结果保存到文件时添加自定义前缀,比如 tcp:// https:// http:// 等,需要配合 outputFile 使用 @param {string} prefix 前缀 @return {scanOpt} 返回配置选项...|
| [synscan.rateLimit](#ratelimit) |rateLimit syn scan 的配置选项,设置 syn 扫描的速率 @param {int} ms 延迟多少毫秒 @param {int} count 每隔多少个数据包延迟一次 @return {scanOpt} 返回配置选项 |
Expand Down Expand Up @@ -383,6 +383,21 @@ die(err)
### maxPorts

#### 详细描述
maxOpenPorts syn scan 的配置选项,设置单个 IP 允许的最大开放端口数

@param {int} max 最大开放端口数

@return {scanOpt} 返回配置选项

Example:
```
res, err = synscan.Scan("127.0.0.1", "1-65535",
synscan.maxOpenPorts(100) // 单个 IP 最多开放 100 个端口
)
die(err)
```


#### 定义
Expand Down

0 comments on commit 283e8d1

Please sign in to comment.