mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 04:31:52 +08:00
refactor: 引入 ScanSession,替代全局状态穿透扫描管道 (Phase 1-3)
- 新增 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
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ import (
|
||||
// Plugin 统一插件接口
|
||||
type Plugin interface {
|
||||
Name() string
|
||||
Scan(ctx context.Context, info *common.HostInfo, config *common.Config, state *common.State) *Result
|
||||
Scan(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *Result
|
||||
}
|
||||
|
||||
// BasePlugin 基础插件结构,提供通用的name字段
|
||||
@@ -62,7 +62,7 @@ type Result struct {
|
||||
|
||||
// Exploiter 利用接口
|
||||
type Exploiter interface {
|
||||
Exploit(ctx context.Context, info *common.HostInfo, creds Credential, config *common.Config) *ExploitResult
|
||||
Exploit(ctx context.Context, info *common.HostInfo, creds Credential, session *common.ScanSession) *ExploitResult
|
||||
}
|
||||
|
||||
// ExploitResult 利用结果
|
||||
|
||||
Reference in New Issue
Block a user