mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-23 03:31:53 +08:00
- 新增 common/session.go: ScanSession 结构体封装 Config/State/Params/Dialer - RunScan/Strategy/ExecuteScanTasks/executeScanTask 全部接收 session - Plugin 接口从 Scan(ctx, info, config, state) 改为 Scan(ctx, info, session) - 48 个插件实现统一更新签名 - Web API 构建 ScanSession 传给 RunScan - CLI 模式通过 Initialize() 创建 session
25 lines
663 B
Go
25 lines
663 B
Go
package web
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/shadow1ng/fscan/common"
|
|
"github.com/shadow1ng/fscan/plugins"
|
|
)
|
|
|
|
// WebPlugin Web插件接口 - 使用智能HTTP检测,不需要预定义端口
|
|
type WebPlugin interface {
|
|
Name() string
|
|
Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *WebScanResult
|
|
}
|
|
|
|
// WebScanResult Web扫描结果类型别名
|
|
type WebScanResult = plugins.Result
|
|
|
|
// RegisterWebPlugin 注册Web插件 - 自动标记web类型
|
|
func RegisterWebPlugin(name string, creator func() WebPlugin) {
|
|
plugins.RegisterWithTypes(name, func() plugins.Plugin {
|
|
return creator()
|
|
}, []int{}, []string{plugins.PluginTypeWeb})
|
|
}
|