mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 19:21:52 +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
29 lines
754 B
Go
29 lines
754 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/shadow1ng/fscan/common"
|
|
"github.com/shadow1ng/fscan/plugins"
|
|
)
|
|
|
|
// 插件接口定义 - 统一命名风格
|
|
type Plugin interface {
|
|
Name() string
|
|
Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *ScanResult
|
|
}
|
|
|
|
type ScanResult = plugins.Result
|
|
type ExploitResult = plugins.ExploitResult
|
|
type Exploiter = plugins.Exploiter
|
|
type Credential = plugins.Credential
|
|
|
|
// RegisterPluginWithPorts 高效注册:直接传递端口信息,避免实例创建
|
|
func RegisterPluginWithPorts(name string, factory func() Plugin, ports []int) {
|
|
plugins.RegisterWithPorts(name, func() plugins.Plugin {
|
|
return factory()
|
|
}, ports)
|
|
}
|
|
|
|
var GenerateCredentials = plugins.GenerateCredentials
|