mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00

- 新增smbinfo插件,专门用于SMB协议信息收集和操作系统检测 - 实现完整的NTLM Type 2消息解析,提取详细的系统信息 - 支持Windows版本识别、计算机名、域名等信息提取 - 采用标准插件输出格式,与其他插件保持一致 - 保留原始NetBIOS插件,两个插件功能互补 - 优化SMB协议数据包处理,提升兼容性和稳定性
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
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)
|
||
} |