fscan/adapters/legacy_plugins/ms17010/plugin.go
ZacharyZcR f06bd3c1ac refactor: 最终整理插件目录结构,分离已迁移的老版本插件
目录结构:
- 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插件和本地插件整理预留空间

测试验证:✓ 所有功能正常
2025-08-09 16:29:21 +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 ms17010
import (
"github.com/shadow1ng/fscan/adapters"
"github.com/shadow1ng/fscan/plugins/base"
Plugins "github.com/shadow1ng/fscan/plugins/legacy"
)
// NewMS17010Plugin 创建MS17010漏洞检测插件
func NewMS17010Plugin() base.Plugin {
// 插件元数据
metadata := &base.PluginMetadata{
Name: "ms17010",
Version: "1.0.0",
Author: "fscan-team",
Description: "MS17010 SMB远程代码执行漏洞检测 (EternalBlue)",
Category: "vulnerability",
Ports: []int{445}, // SMB端口
Protocols: []string{"tcp"},
Tags: []string{"smb", "ms17010", "eternalblue", "vulnerability"},
}
// 适配器选项
options := &adapters.LegacyPluginOptions{
CheckBruteFlag: false, // MS17010不依赖暴力破解标志
IsVulnPlugin: true, // 这是漏洞检测插件
IsInfoPlugin: false,
CustomPorts: []int{445}, // 固定使用SMB端口
}
// 创建适配器直接使用老版本的MS17010函数
return adapters.NewLegacyPlugin(metadata, Plugins.MS17010, options)
}
// init 自动注册MS17010插件
func init() {
// 创建插件工厂
metadata := &base.PluginMetadata{
Name: "ms17010",
Version: "1.0.0",
Author: "fscan-team",
Description: "MS17010 SMB远程代码执行漏洞检测 (EternalBlue)",
Category: "vulnerability",
Ports: []int{445},
Protocols: []string{"tcp"},
Tags: []string{"smb", "ms17010", "eternalblue", "vulnerability"},
}
factory := base.NewSimplePluginFactory(metadata, func() base.Plugin {
return NewMS17010Plugin()
})
base.GlobalPluginRegistry.Register("ms17010", factory)
}