fscan/plugins/legacy/smb/plugin.go
ZacharyZcR 4a3f281b6b refactor: 统一Plugins目录大小写为小写
- 将所有Plugins路径重命名为plugins
- 修复Git索引与实际文件系统大小写不一致问题
- 确保跨平台兼容性和路径一致性
2025-08-12 13:08:06 +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 smb
import (
"github.com/shadow1ng/fscan/plugins/adapters"
"github.com/shadow1ng/fscan/plugins/base"
LegacyPlugins "github.com/shadow1ng/fscan/plugins/legacy"
)
// NewSmbPlugin 创建SMB弱密码检测插件
func NewSmbPlugin() base.Plugin {
// 插件元数据
metadata := &base.PluginMetadata{
Name: "smb",
Version: "1.0.0",
Author: "fscan-team",
Description: "SMB服务弱密码检测和共享枚举",
Category: "service",
Ports: []int{445, 139}, // SMB端口
Protocols: []string{"tcp"},
Tags: []string{"smb", "weak-password", "service", "brute-force"},
}
// 适配器选项
options := &adapters.LegacyPluginOptions{
CheckBruteFlag: true, // SMB依赖暴力破解标志
IsVulnPlugin: false, // 这是服务检测插件,不是漏洞检测
IsInfoPlugin: true, // 包含信息收集功能
CustomPorts: []int{445, 139}, // SMB端口
}
// 创建适配器直接使用老版本的SmbScan函数
return adapters.NewLegacyPlugin(metadata, LegacyPlugins.SmbScan, options)
}
// init 自动注册SMB插件
func init() {
// 创建插件工厂
metadata := &base.PluginMetadata{
Name: "smb",
Version: "1.0.0",
Author: "fscan-team",
Description: "SMB服务弱密码检测和共享枚举",
Category: "service",
Ports: []int{445, 139},
Protocols: []string{"tcp"},
Tags: []string{"smb", "weak-password", "service", "brute-force"},
}
factory := base.NewSimplePluginFactory(metadata, func() base.Plugin {
return NewSmbPlugin()
})
base.GlobalPluginRegistry.Register("smb", factory)
}