fscan/main.go
ZacharyZcR a86098d6b6 refactor: 重构本地插件架构并支持多平台
- 简化本地插件架构,移除不必要的连接器抽象
- 重构6个本地插件使用统一的简化架构
- 更新平台支持配置:Windows专用插件(avdetect/dcinfo/minidump),跨平台插件(fileinfo/reverseshell/socks5proxy)
- 修复插件注册和系统集成
- 优化代码结构和错误处理
2025-08-11 04:10:04 +08:00

41 lines
1.1 KiB
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 main
import (
"fmt"
"os"
"github.com/shadow1ng/fscan/common"
"github.com/shadow1ng/fscan/core"
// 引入本地插件以触发注册
_ "github.com/shadow1ng/fscan/plugins/local/fileinfo" // 已重构,可用
_ "github.com/shadow1ng/fscan/plugins/local/dcinfo" // 已重构,可用
_ "github.com/shadow1ng/fscan/plugins/local/minidump" // 已重构,可用
_ "github.com/shadow1ng/fscan/plugins/local/reverseshell" // 已重构,可用
_ "github.com/shadow1ng/fscan/plugins/local/socks5proxy" // 已重构,可用
_ "github.com/shadow1ng/fscan/plugins/local/avdetect" // 已重构,可用
)
func main() {
var Info common.HostInfo
common.Flag(&Info)
// 在flag解析后初始化logger确保LogLevel参数生效
common.InitLogger()
// 解析 CLI 参数
if err := common.Parse(&Info); err != nil {
os.Exit(1)
}
// 初始化输出系统,如果失败则直接退出
if err := common.InitOutput(); err != nil {
common.LogError(fmt.Sprintf("初始化输出系统失败: %v", err))
os.Exit(1)
}
defer common.CloseOutput()
// 执行 CLI 扫描逻辑
core.RunScan(Info)
}