mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
package smb2
|
||
|
||
import (
|
||
"github.com/shadow1ng/fscan/plugins/adapters"
|
||
"github.com/shadow1ng/fscan/plugins/base"
|
||
LegacyPlugins "github.com/shadow1ng/fscan/plugins/legacy"
|
||
)
|
||
|
||
// NewSmb2Plugin 创建SMB2弱密码检测插件
|
||
func NewSmb2Plugin() base.Plugin {
|
||
// 插件元数据
|
||
metadata := &base.PluginMetadata{
|
||
Name: "smb2",
|
||
Version: "1.0.0",
|
||
Author: "fscan-team",
|
||
Description: "SMB2服务弱密码检测和共享枚举 (支持NTLM哈希)",
|
||
Category: "service",
|
||
Ports: []int{445}, // SMB2端口
|
||
Protocols: []string{"tcp"},
|
||
Tags: []string{"smb2", "weak-password", "service", "brute-force", "ntlm"},
|
||
}
|
||
|
||
// 适配器选项
|
||
options := &adapters.LegacyPluginOptions{
|
||
CheckBruteFlag: true, // SMB2依赖暴力破解标志
|
||
IsVulnPlugin: false, // 这是服务检测插件,不是漏洞检测
|
||
IsInfoPlugin: true, // 包含信息收集功能
|
||
CustomPorts: []int{445}, // SMB2端口
|
||
}
|
||
|
||
// 创建适配器,直接使用老版本的SmbScan2函数
|
||
return adapters.NewLegacyPlugin(metadata, LegacyPlugins.SmbScan2, options)
|
||
}
|
||
|
||
// init 自动注册SMB2插件
|
||
func init() {
|
||
// 创建插件工厂
|
||
metadata := &base.PluginMetadata{
|
||
Name: "smb2",
|
||
Version: "1.0.0",
|
||
Author: "fscan-team",
|
||
Description: "SMB2服务弱密码检测和共享枚举 (支持NTLM哈希)",
|
||
Category: "service",
|
||
Ports: []int{445},
|
||
Protocols: []string{"tcp"},
|
||
Tags: []string{"smb2", "weak-password", "service", "brute-force", "ntlm"},
|
||
}
|
||
|
||
factory := base.NewSimplePluginFactory(metadata, func() base.Plugin {
|
||
return NewSmb2Plugin()
|
||
})
|
||
|
||
base.GlobalPluginRegistry.Register("smb2", factory)
|
||
} |