package smbghost import ( "github.com/shadow1ng/fscan/adapters" "github.com/shadow1ng/fscan/plugins/base" Plugins "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, Plugins.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) }