mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00

核心改进: - 创建LegacyPlugin适配器基础框架,支持老版本插件接入新架构 - 实现适配器模式,保持老版本插件代码完全不变 - 支持不同类型插件的能力配置(漏洞检测、信息收集、服务检测) 已适配插件: - MS17010: SMB远程代码执行漏洞检测 (EternalBlue) - SmbGhost: CVE-2020-0796 远程代码执行漏洞检测 - SMB/SMB2: SMB服务弱密码检测和共享枚举 - RDP: 远程桌面服务弱密码检测 - NetBIOS: 信息收集和主机名解析 - Elasticsearch: 弱密码检测和未授权访问检测 技术特点: - 零代码修改:老版本插件完全不需要修改 - 完整接口实现:适配Plugin、Scanner、Exploiter接口 - 灵活配置:支持暴力破解标志检查、插件类型配置 - 统一管理:通过新的插件注册表统一管理所有插件 测试验证:✓ 所有适配器插件正常工作,与新架构完美集成
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
package netbios
|
||
|
||
import (
|
||
"github.com/shadow1ng/fscan/plugins/adapter"
|
||
"github.com/shadow1ng/fscan/plugins/base"
|
||
Plugins "github.com/shadow1ng/fscan/plugins"
|
||
)
|
||
|
||
// NewNetBiosPlugin 创建NetBIOS信息收集插件
|
||
func NewNetBiosPlugin() base.Plugin {
|
||
// 插件元数据
|
||
metadata := &base.PluginMetadata{
|
||
Name: "netbios",
|
||
Version: "1.0.0",
|
||
Author: "fscan-team",
|
||
Description: "NetBIOS信息收集和主机名解析",
|
||
Category: "information",
|
||
Ports: []int{139, 445}, // NetBIOS端口
|
||
Protocols: []string{"tcp", "udp"},
|
||
Tags: []string{"netbios", "information-gathering", "hostname", "smb"},
|
||
}
|
||
|
||
// 适配器选项
|
||
options := &adapter.LegacyPluginOptions{
|
||
CheckBruteFlag: false, // NetBIOS信息收集不依赖暴力破解标志
|
||
IsVulnPlugin: false, // 这不是漏洞检测插件
|
||
IsInfoPlugin: true, // 这是信息收集插件
|
||
CustomPorts: []int{139, 445}, // NetBIOS/SMB端口
|
||
}
|
||
|
||
// 创建适配器,直接使用老版本的NetBIOS函数
|
||
return adapter.NewLegacyPlugin(metadata, Plugins.NetBIOS, options)
|
||
}
|
||
|
||
// init 自动注册NetBIOS插件
|
||
func init() {
|
||
// 创建插件工厂
|
||
metadata := &base.PluginMetadata{
|
||
Name: "netbios",
|
||
Version: "1.0.0",
|
||
Author: "fscan-team",
|
||
Description: "NetBIOS信息收集和主机名解析",
|
||
Category: "information",
|
||
Ports: []int{139, 445},
|
||
Protocols: []string{"tcp", "udp"},
|
||
Tags: []string{"netbios", "information-gathering", "hostname", "smb"},
|
||
}
|
||
|
||
factory := base.NewSimplePluginFactory(metadata, func() base.Plugin {
|
||
return NewNetBiosPlugin()
|
||
})
|
||
|
||
base.GlobalPluginRegistry.Register("netbios", factory)
|
||
} |