mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00

- 新建本地插件统一架构,包含接口定义和基础类 - 实现三个本地插件:fileinfo(文件信息收集)、dcinfo(域控信息收集)、minidump(内存转储) - 添加-localplugin参数,支持指定单个本地插件执行 - 完善参数验证机制,本地模式必须指定插件 - 集成新插件系统到核心扫描策略 - 修复Go方法调用机制导致的插件执行问题 - 支持跨平台和权限检查功能 支持的本地插件: - fileinfo: 敏感文件扫描 - dcinfo: Windows域控信息收集 - minidump: lsass进程内存转储 使用方式: fscan -local -localplugin <plugin_name>
38 lines
812 B
Go
38 lines
812 B
Go
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"
|
||
)
|
||
|
||
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.Scan(Info)
|
||
}
|