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

- 实现Windows/Linux/macOS三平台痕迹清理功能 - Windows: 清理事件日志、预取文件、注册表、最近文档、临时文件、网络缓存 - Linux: 清理Shell历史、系统日志、用户缓存、临时文件、网络缓存 - macOS: 清理Spotlight索引、LaunchServices数据库、系统日志、缓存文件 - 支持安全文件删除和程序自毁功能 - 采用保守策略避免误删重要文件
62 lines
2.4 KiB
Go
62 lines
2.4 KiB
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" // 已重构,可用
|
||
_ "github.com/shadow1ng/fscan/plugins/local/reverseshell" // 已重构,可用
|
||
_ "github.com/shadow1ng/fscan/plugins/local/socks5proxy" // 已重构,可用
|
||
_ "github.com/shadow1ng/fscan/plugins/local/avdetect" // 已重构,可用
|
||
_ "github.com/shadow1ng/fscan/plugins/local/forwardshell" // 新增,可用
|
||
|
||
// Linux持久化插件
|
||
_ "github.com/shadow1ng/fscan/plugins/local/ldpreload" // Linux LD_PRELOAD持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/shellenv" // Linux Shell环境变量持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/crontask" // Linux Cron计划任务持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/systemdservice" // Linux Systemd服务持久化
|
||
|
||
// Windows持久化插件
|
||
_ "github.com/shadow1ng/fscan/plugins/local/winregistry" // Windows 注册表持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/winstartup" // Windows 启动文件夹持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/winschtask" // Windows 计划任务持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/winservice" // Windows 服务持久化
|
||
_ "github.com/shadow1ng/fscan/plugins/local/winwmi" // Windows WMI事件订阅持久化
|
||
|
||
// 监控插件
|
||
_ "github.com/shadow1ng/fscan/plugins/local/keylogger" // 跨平台键盘记录
|
||
|
||
// 实用工具插件
|
||
_ "github.com/shadow1ng/fscan/plugins/local/downloader" // 跨平台文件下载
|
||
_ "github.com/shadow1ng/fscan/plugins/local/cleaner" // 跨平台系统痕迹清理
|
||
)
|
||
|
||
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)
|
||
}
|