fscan/plugins/legacy/smbinfo/plugin.go
ZacharyZcR e3c14e9f8e feat: 新增SMBInfo插件,增强SMB协议信息收集能力
- 新增smbinfo插件,专门用于SMB协议信息收集和操作系统检测
- 实现完整的NTLM Type 2消息解析,提取详细的系统信息
- 支持Windows版本识别、计算机名、域名等信息提取
- 采用标准插件输出格式,与其他插件保持一致
- 保留原始NetBIOS插件,两个插件功能互补
- 优化SMB协议数据包处理,提升兼容性和稳定性
2025-08-12 23:06:01 +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 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)
}