package web import ( "context" "sync" "github.com/shadow1ng/fscan/common" ) // WebPlugin Web扫描插件接口 type WebPlugin interface { GetName() string GetPorts() []int Scan(ctx context.Context, info *common.HostInfo) *WebScanResult } // WebScanResult Web扫描结果 type WebScanResult struct { Success bool Title string // 网页标题 Status int // HTTP状态码 Server string // 服务器信息 Length int // 响应长度 VulInfo string // 漏洞信息(如果有) Error error } // Web插件注册表 var ( webPluginRegistry = make(map[string]func() WebPlugin) webPluginMutex sync.RWMutex ) // RegisterWebPlugin 注册Web插件 func RegisterWebPlugin(name string, creator func() WebPlugin) { webPluginMutex.Lock() defer webPluginMutex.Unlock() webPluginRegistry[name] = creator } // GetAllWebPlugins 获取所有已注册Web插件的名称 func GetAllWebPlugins() []string { webPluginMutex.RLock() defer webPluginMutex.RUnlock() var plugins []string for name := range webPluginRegistry { plugins = append(plugins, name) } return plugins }