fscan/core/Registry.go
ZacharyZcR e3c14e9f8e feat: 新增SMBInfo插件,增强SMB协议信息收集能力
- 新增smbinfo插件,专门用于SMB协议信息收集和操作系统检测
- 实现完整的NTLM Type 2消息解析,提取详细的系统信息
- 支持Windows版本识别、计算机名、域名等信息提取
- 采用标准插件输出格式,与其他插件保持一致
- 保留原始NetBIOS插件,两个插件功能互补
- 优化SMB协议数据包处理,提升兼容性和稳定性
2025-08-12 23:06:01 +08:00

102 lines
4.5 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 core
import (
"fmt"
"github.com/shadow1ng/fscan/common"
"github.com/shadow1ng/fscan/plugins/base"
// 导入跨平台服务插件(可在所有平台上运行)
_ "github.com/shadow1ng/fscan/plugins/services/activemq"
_ "github.com/shadow1ng/fscan/plugins/services/cassandra"
_ "github.com/shadow1ng/fscan/plugins/services/ftp"
_ "github.com/shadow1ng/fscan/plugins/services/imap"
_ "github.com/shadow1ng/fscan/plugins/services/kafka"
_ "github.com/shadow1ng/fscan/plugins/services/ldap"
_ "github.com/shadow1ng/fscan/plugins/services/memcached"
_ "github.com/shadow1ng/fscan/plugins/services/modbus"
_ "github.com/shadow1ng/fscan/plugins/services/mongodb"
_ "github.com/shadow1ng/fscan/plugins/services/mssql"
_ "github.com/shadow1ng/fscan/plugins/services/mysql"
_ "github.com/shadow1ng/fscan/plugins/services/neo4j"
_ "github.com/shadow1ng/fscan/plugins/services/oracle"
_ "github.com/shadow1ng/fscan/plugins/services/pop3"
_ "github.com/shadow1ng/fscan/plugins/services/postgresql"
_ "github.com/shadow1ng/fscan/plugins/services/rabbitmq"
_ "github.com/shadow1ng/fscan/plugins/services/redis"
_ "github.com/shadow1ng/fscan/plugins/services/rsync"
_ "github.com/shadow1ng/fscan/plugins/services/smtp"
_ "github.com/shadow1ng/fscan/plugins/services/snmp"
_ "github.com/shadow1ng/fscan/plugins/services/ssh"
_ "github.com/shadow1ng/fscan/plugins/services/telnet"
_ "github.com/shadow1ng/fscan/plugins/services/vnc"
// 导入跨平台Legacy插件
_ "github.com/shadow1ng/fscan/plugins/legacy/elasticsearch" // 跨平台服务
_ "github.com/shadow1ng/fscan/plugins/legacy/findnet" // 网络发现
_ "github.com/shadow1ng/fscan/plugins/legacy/ms17010" // Windows SMB漏洞但扫描器可跨平台
_ "github.com/shadow1ng/fscan/plugins/legacy/netbios" // NetBIOS协议主要Windows但可跨平台扫描
_ "github.com/shadow1ng/fscan/plugins/legacy/smbinfo" // SMB信息收集主要Windows但可跨平台扫描
_ "github.com/shadow1ng/fscan/plugins/legacy/rdp" // RDP协议扫描可跨平台
_ "github.com/shadow1ng/fscan/plugins/legacy/smb" // SMB协议扫描可跨平台
_ "github.com/shadow1ng/fscan/plugins/legacy/smb2" // SMBv2协议扫描可跨平台
_ "github.com/shadow1ng/fscan/plugins/legacy/smbghost" // SMBGhost漏洞扫描可跨平台
// 导入Web插件适配器
_ "github.com/shadow1ng/fscan/plugins/legacy/webtitle"
_ "github.com/shadow1ng/fscan/plugins/legacy/webpoc"
// 导入跨平台本地插件(可在所有平台上运行)
_ "github.com/shadow1ng/fscan/plugins/local/cleaner" // 系统痕迹清理
_ "github.com/shadow1ng/fscan/plugins/local/downloader" // 文件下载
_ "github.com/shadow1ng/fscan/plugins/local/fileinfo" // 文件信息收集
_ "github.com/shadow1ng/fscan/plugins/local/forwardshell" // 正向Shell
_ "github.com/shadow1ng/fscan/plugins/local/keylogger" // 键盘记录主要Windows但支持跨平台
_ "github.com/shadow1ng/fscan/plugins/local/reverseshell" // 反弹Shell
_ "github.com/shadow1ng/fscan/plugins/local/socks5proxy" // SOCKS5代理
)
// =============================================================================
// 新一代插件注册系统 (New Architecture)
// 完全基于工厂模式和自动发现的现代化插件架构
// =============================================================================
// InitializePluginSystem 初始化插件系统
func InitializePluginSystem() error {
common.LogInfo("初始化新一代插件系统...")
// 统计已注册的插件
registeredPlugins := base.GlobalPluginRegistry.GetAll()
common.LogInfo(fmt.Sprintf("已注册插件数量: %d", len(registeredPlugins)))
// 显示已注册的插件列表
if len(registeredPlugins) > 0 {
common.LogInfo("已注册插件:")
for _, name := range registeredPlugins {
metadata := base.GlobalPluginRegistry.GetMetadata(name)
if metadata != nil {
common.LogInfo(fmt.Sprintf(" - %s v%s (%s)",
metadata.Name, metadata.Version, metadata.Category))
}
}
}
common.LogInfo("插件系统初始化完成")
return nil
}
// 已移除未使用的 GetAllPlugins 方法
// 已移除未使用的 GetPluginMetadata 方法
// 已移除未使用的 CreatePlugin 方法
// 已移除未使用的 GetPluginsByCategory 方法
// 已移除未使用的 GetPluginsByPort 方法
// init 自动初始化插件系统
func init() {
if err := InitializePluginSystem(); err != nil {
common.LogError("插件系统初始化失败: " + err.Error())
}
}