mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-23 11:41:53 +08:00
refactor: 增强 systeminfo 插件并合并 envinfo
- systeminfo 新增网卡信息、权限检测、补丁数量、杀软检测、 防火墙状态、敏感环境变量扫描等功能 - 合并 envinfo 到 systeminfo,删除独立的 envinfo 插件 - 修复本地插件通过 -m 指定时仍需 -h 参数的问题 - 通过回调机制解决 common/plugins 循环依赖
This commit is contained in:
+1
-19
@@ -6,7 +6,6 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
@@ -55,7 +54,7 @@ func determineScanMode(config *common.Config, state *common.State) ScanMode {
|
||||
return ScanModeAlive
|
||||
case config.LocalMode:
|
||||
return ScanModeLocal
|
||||
case isAllLocalPlugins(config.Mode):
|
||||
case common.IsLocalMode != nil && common.IsLocalMode(config.Mode):
|
||||
config.LocalMode = true
|
||||
config.LocalPlugin = config.Mode
|
||||
return ScanModeLocal
|
||||
@@ -66,23 +65,6 @@ func determineScanMode(config *common.Config, state *common.State) ScanMode {
|
||||
}
|
||||
}
|
||||
|
||||
// isAllLocalPlugins 检查 -m 指定的插件是否全部为 local 类型
|
||||
func isAllLocalPlugins(mode string) bool {
|
||||
if mode == "" || mode == "all" {
|
||||
return false
|
||||
}
|
||||
for _, name := range strings.Split(mode, ",") {
|
||||
name = strings.TrimSpace(name)
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
if !plugins.HasType(name, plugins.PluginTypeLocal) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// selectStrategy 根据扫描模式选择策略
|
||||
func selectStrategy(config *common.Config, state *common.State, info common.HostInfo) ScanStrategy {
|
||||
mode := determineScanMode(config, state)
|
||||
|
||||
Reference in New Issue
Block a user