package smbinfo import ( "github.com/shadow1ng/fscan/plugins/adapters" "github.com/shadow1ng/fscan/plugins/base" LegacyPlugins "github.com/shadow1ng/fscan/plugins/legacy" ) // NewSMBInfoPlugin 创建SMB信息收集插件 func NewSMBInfoPlugin() base.Plugin { // 插件元数据 metadata := &base.PluginMetadata{ Name: "smbinfo", Version: "1.0.0", Author: "fscan-team", Description: "SMB协议信息收集和操作系统检测", Category: "service", Ports: []int{139, 445}, // SMB端口 Protocols: []string{"tcp"}, Tags: []string{"smb", "information-gathering", "os-detection", "ntlm"}, } // 适配器选项 options := &adapters.LegacyPluginOptions{ CheckBruteFlag: false, // SMB信息收集不依赖暴力破解标志 IsVulnPlugin: false, // 这不是漏洞检测插件 IsInfoPlugin: true, // 这是信息收集插件 CustomPorts: []int{139, 445}, // SMB端口 } // 创建适配器,使用SMBInfo函数 return adapters.NewLegacyPlugin(metadata, LegacyPlugins.SMBInfo, options) } // init 自动注册SMBInfo插件 func init() { // 创建插件工厂 metadata := &base.PluginMetadata{ Name: "smbinfo", Version: "1.0.0", Author: "fscan-team", Description: "SMB协议信息收集和操作系统检测", Category: "service", Ports: []int{139, 445}, Protocols: []string{"tcp"}, Tags: []string{"smb", "information-gathering", "os-detection", "ntlm"}, } factory := base.NewSimplePluginFactory(metadata, func() base.Plugin { return NewSMBInfoPlugin() }) base.GlobalPluginRegistry.Register("smbinfo", factory) }