package web import ( "context" "fmt" "github.com/shadow1ng/fscan/common" "github.com/shadow1ng/fscan/plugins" "github.com/shadow1ng/fscan/webscan" ) // WebPocPlugin Web漏洞扫描插件 type WebPocPlugin struct { plugins.BasePlugin } // NewWebPocPlugin 创建Web POC插件 func NewWebPocPlugin() *WebPocPlugin { return &WebPocPlugin{ BasePlugin: plugins.NewBasePlugin("webpoc"), } } // Scan 执行Web POC扫描 func (p *WebPocPlugin) Scan(ctx context.Context, info *common.HostInfo) *WebScanResult { if common.DisablePocScan { return &WebScanResult{ Success: false, Error: fmt.Errorf("POC扫描已禁用"), } } target := fmt.Sprintf("%s:%s", info.Host, info.Ports) common.LogSuccess(fmt.Sprintf("WebPOC %s 开始扫描", target)) // 直接执行Web扫描 WebScan.WebScan(info) return &WebScanResult{ Success: true, VulInfo: "WebPOC扫描完成", } } // init 自动注册插件 func init() { RegisterWebPlugin("webpoc", func() WebPlugin { return NewWebPocPlugin() }) }