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

目录结构: - plugins/legacy/ - 存放已迁移到新架构的老版本插件 - adapters/legacy_plugins/ - 对应的适配器实现 - plugins/services/ - 新架构服务插件 已迁移的老版本插件: - MS17010.go, MS17010-Exp.go - MS17010漏洞检测 - SmbGhost.go - SMBGhost漏洞检测 - SMB.go, SMB2.go - SMB服务检测 - RDP.go - RDP服务检测 - NetBIOS.go - NetBIOS信息收集 - Elasticsearch.go - Elasticsearch服务检测 - Base.go - 工具函数模块 架构特点: - 老版本插件代码完全不变 - 通过适配器实现与新架构的桥接 - 清晰的职责分离和目录组织 - 为后续Web插件和本地插件整理预留空间 测试验证:✓ 所有功能正常
54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
package netbios
|
||
|
||
import (
|
||
"github.com/shadow1ng/fscan/adapters"
|
||
"github.com/shadow1ng/fscan/plugins/base"
|
||
Plugins "github.com/shadow1ng/fscan/plugins/legacy"
|
||
)
|
||
|
||
// 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 := &adapters.LegacyPluginOptions{
|
||
CheckBruteFlag: false, // NetBIOS信息收集不依赖暴力破解标志
|
||
IsVulnPlugin: false, // 这不是漏洞检测插件
|
||
IsInfoPlugin: true, // 这是信息收集插件
|
||
CustomPorts: []int{139, 445}, // NetBIOS/SMB端口
|
||
}
|
||
|
||
// 创建适配器,直接使用老版本的NetBIOS函数
|
||
return adapters.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)
|
||
} |