mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00

- 更新插件初始化器集成三个插件系统(Service、Web、Local) - 清理WebPOC插件:移除重复端口检测和模拟漏洞数据 - 简化WebTitle插件:去除过度设计的WebInfo结构和技术检测 - 移除Web插件系统中的冗余辅助函数 - 统一插件接口实现,提升代码一致性
60 lines
1.2 KiB
Go
60 lines
1.2 KiB
Go
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()
|
||
})
|
||
}
|