fscan/Plugins/legacy/smbghost/plugin.go
ZacharyZcR 99b0481616 refactor: 完成插件架构重构,移除冗余文件并统一legacy插件引用
- 移动adapters目录到plugins下统一管理
- 删除已迁移的老版本插件文件,避免代码重复
- 更新所有legacy适配器引用,统一使用legacy目录下的源文件
- 新增FindNet插件的legacy适配器,支持135端口RPC扫描
- 修复包导入路径,确保适配器正常工作
- 清理插件目录结构,分离新架构插件和legacy插件
2025-08-09 17:17:45 +08:00

54 lines
1.6 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 smbghost
import (
"github.com/shadow1ng/fscan/plugins/adapters"
"github.com/shadow1ng/fscan/plugins/base"
LegacyPlugins "github.com/shadow1ng/fscan/plugins/legacy"
)
// NewSmbGhostPlugin 创建SMBGhost漏洞检测插件
func NewSmbGhostPlugin() base.Plugin {
// 插件元数据
metadata := &base.PluginMetadata{
Name: "smbghost",
Version: "1.0.0",
Author: "fscan-team",
Description: "SMBGhost (CVE-2020-0796) 远程代码执行漏洞检测",
Category: "vulnerability",
Ports: []int{445}, // SMB端口
Protocols: []string{"tcp"},
Tags: []string{"smb", "smbghost", "cve-2020-0796", "vulnerability"},
}
// 适配器选项
options := &adapters.LegacyPluginOptions{
CheckBruteFlag: false, // SMBGhost不依赖暴力破解标志
IsVulnPlugin: true, // 这是漏洞检测插件
IsInfoPlugin: false,
CustomPorts: []int{445}, // 固定使用SMB端口
}
// 创建适配器直接使用老版本的SmbGhost函数
return adapters.NewLegacyPlugin(metadata, LegacyPlugins.SmbGhost, options)
}
// init 自动注册SmbGhost插件
func init() {
// 创建插件工厂
metadata := &base.PluginMetadata{
Name: "smbghost",
Version: "1.0.0",
Author: "fscan-team",
Description: "SMBGhost (CVE-2020-0796) 远程代码执行漏洞检测",
Category: "vulnerability",
Ports: []int{445},
Protocols: []string{"tcp"},
Tags: []string{"smb", "smbghost", "cve-2020-0796", "vulnerability"},
}
factory := base.NewSimplePluginFactory(metadata, func() base.Plugin {
return NewSmbGhostPlugin()
})
base.GlobalPluginRegistry.Register("smbghost", factory)
}