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

- 新增forwardshell本地插件,支持跨平台远程Shell访问 - 支持Windows (cmd)、Linux/macOS (/bin/sh) 平台 - 添加-fsh-port参数指定监听端口,默认4444 - 实现并发连接处理和命令超时控制 - 集成生命周期管理,支持长时间运行 - 提供exit命令优雅断开连接
42 lines
1.2 KiB
Go
42 lines
1.2 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" // 新增,可用
|
||
)
|
||
|
||
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)
|
||
}
|