fscan/Core/PortFinger.go
ZacharyZcR 0a60d76f71 refactor: 重构PortFinger.go为模块化架构以提升代码可维护性
将原有的878行单一文件重构为多个专门化模块:
- 类型定义模块:集中管理所有数据结构
- 扫描器核心:初始化和全局状态管理
- 编码工具:处理各种编码格式转换
- 探测器解析:解析nmap-service-probes格式
- 匹配引擎:模式匹配和服务识别
- 版本解析:服务版本信息提取

通过向后兼容层保持原有API接口不变,确保现有代码无需修改即可使用新架构
2025-08-07 02:26:12 +08:00

41 lines
961 B
Go
Raw Permalink 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
// 重新导出portfinger包的类型和函数保持向后兼容性
import (
"github.com/shadow1ng/fscan/core/portfinger"
"github.com/shadow1ng/fscan/common"
)
// 重新导出类型定义
type VScan = portfinger.VScan
type Probe = portfinger.Probe
type Match = portfinger.Match
type Directive = portfinger.Directive
type Extras = portfinger.Extras
type Target = portfinger.Target
// 兼容原有的全局变量访问模式
var v *VScan
var null *Probe
var commonProbe *Probe
func init() {
common.LogDebug("初始化PortFinger兼容层")
// 初始化兼容性全局变量
v = portfinger.GetGlobalVScan()
null = portfinger.GetNullProbe()
commonProbe = portfinger.GetCommonProbe()
common.LogDebug("PortFinger兼容层初始化完成")
}
// 重新导出编码函数
var DecodeData = portfinger.DecodeData
var DecodePattern = portfinger.DecodePattern
// 重新导出探测器字符串
var ProbeString = portfinger.ProbeString