fscan/Common/Config.go
ZacharyZcR 7077590bae 重构: 将Config.go拆分为模块化配置文件
优化目标:
- 解决单文件过大问题(970行 -> 4个模块文件)
- 提升代码可维护性和可读性
- 保持包的一致性和向后兼容性

拆分方案:
- Config.go (48行): 主配置文件,包含版本信息和基础配置
- ConfigServiceDict.go (65行): 服务认证字典和默认密码管理
- ConfigPortMapping.go (850行): 端口与探测器映射关系
- ConfigScanOptions.go (260行): 扫描相关的各种配置选项

技术优势:
- 模块化组织,职责分明
- 同包结构避免导入复杂性
- 完全向后兼容,现有代码无需修改
- 便于后续功能扩展和维护

为v2.0.2版本架构优化奠定基础
2025-08-05 01:06:07 +08:00

48 lines
1.2 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 Common
/*
Config.go - 主配置文件 (已拆分为多个模块)
配置文件模块化组织:
- ConfigServiceDict.go - 服务认证字典和默认密码配置
- ConfigPortMapping.go - 端口与探测器映射关系配置
- ConfigScanOptions.go - 扫描相关的各种配置和全局变量
为了减少单文件复杂度将原本970行的Config.go拆分为多个模块文件。
所有配置文件都在Common包中保持包的一致性和向后兼容性。
注意: 服务字典、端口映射等变量现在定义在对应的专门文件中。
*/
import (
"github.com/schollz/progressbar/v3"
"sync"
)
// 版本信息
var version = "2.0.2"
// =========================================================
// 输出配置 (保留在主配置文件中)
// =========================================================
var (
Outputfile string // 输出文件路径
OutputFormat string // 输出格式
)
// 添加一个全局的进度条变量
var ProgressBar *progressbar.ProgressBar
// 添加一个全局互斥锁来控制输出
var OutputMutex sync.Mutex
// PocInfo POC详细信息结构
type PocInfo struct {
Target string
PocName string
}
// GetVersion 获取版本信息
func GetVersion() string {
return version
}