fscan/plugins/web/webpoc.go
ZacharyZcR 8a79f3cf0f refactor: 简化Web插件系统并移除冗余代码
- 更新插件初始化器集成三个插件系统(Service、Web、Local)
- 清理WebPOC插件:移除重复端口检测和模拟漏洞数据
- 简化WebTitle插件:去除过度设计的WebInfo结构和技术检测
- 移除Web插件系统中的冗余辅助函数
- 统一插件接口实现,提升代码一致性
2025-08-26 16:30:46 +08:00

60 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package web
import (
"context"
"fmt"
"github.com/shadow1ng/fscan/common"
"github.com/shadow1ng/fscan/webscan"
)
// WebPocPlugin Web漏洞扫描插件
type WebPocPlugin struct {
name string
}
// NewWebPocPlugin 创建Web POC插件
func NewWebPocPlugin() *WebPocPlugin {
return &WebPocPlugin{
name: "webpoc",
}
}
// GetName 实现Plugin接口
func (p *WebPocPlugin) GetName() string {
return p.name
}
// GetPorts 实现Plugin接口 - Web插件不需要预定义端口依赖全局检测器
func (p *WebPocPlugin) GetPorts() []int {
return []int{}
}
// 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()
})
}