mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
优化自适应扫描系统 & 修复 POC 调度问题
自适应扫描优化: - target/ceiling 分离,自适应池可向上探索而非锁死在 target - assessHealth 阈值按网络环境区分(LAN 收紧 / Internet 放宽) - RTT 漂移时动态压低 target,配合 AIMD 双重降速 - 去掉 semaphore 双层流控,由 ants pool 统一反压 - 探测端口从 3 个扩充到 8 个,减少 RTT 采样偏差 - computeRetries 按环境调整目标概率和上限 Bug 修复: - AdaptivePool.Wait() 加 10 分钟超时,防止 goroutine 卡死时永久挂起 - CEL 环境初始化失败后允许重试(sync.Once → sync.Mutex + 标志位) - CAS 自旋加 runtime.Gosched() 退避,减少高并发下 CPU 空转 - -full 模式下 web 插件跳过 IsMarkedWebService 检查 #588 - 不确定服务补做 HTTP 回退探测,覆盖自定义框架漏网场景 - POC sets 纯字面量值跳过 CEL 编译,消除大量误报错误日志
This commit is contained in:
@@ -25,6 +25,7 @@ type Config struct {
|
||||
Timeout time.Duration // 通用超时
|
||||
TimeoutExplicit bool // 用户显式指定了 -time
|
||||
ThreadNum int // 主线程数
|
||||
ThreadCeiling int // 线程数上限(自适应池允许的最大值)
|
||||
ThreadNumExplicit bool // 用户显式指定了 -t
|
||||
ModuleThreadNum int // 模块线程数
|
||||
ModuleThreadNumExplicit bool // 用户显式指定了 -mt
|
||||
@@ -39,6 +40,7 @@ type Config struct {
|
||||
AliveOnly bool // 仅存活检测
|
||||
MaxRetries int // 最大重试次数
|
||||
MaxRetriesExplicit bool // 用户显式指定了 -retry
|
||||
DetectedNetworkEnv int // 探测到的网络环境(来自 core.NetworkEnv)
|
||||
|
||||
// 高级功能(从AdvancedConfig合并)
|
||||
Shellcode string // Shellcode
|
||||
@@ -180,6 +182,7 @@ func NewConfig() *Config {
|
||||
// 高频字段 - 使用默认常量
|
||||
Timeout: time.Duration(DefaultTimeout) * time.Second,
|
||||
ThreadNum: DefaultThreadNum,
|
||||
ThreadCeiling: DefaultThreadNum,
|
||||
ModuleThreadNum: 10,
|
||||
DisableBrute: false,
|
||||
DisablePing: false,
|
||||
|
||||
@@ -547,6 +547,8 @@ adaptive_pool_increase:
|
||||
other: "Concurrency adjusted: {{.Arg1}} -> {{.Arg2}} (network healthy)"
|
||||
adaptive_pool_slowstart_exit:
|
||||
other: "Slow start exit: current {{.Arg1}} (congestion detected)"
|
||||
adaptive_pool_wait_timeout:
|
||||
other: "Thread pool wait timed out (10 minutes), forcing exit"
|
||||
net_probe_result:
|
||||
other: "Network probe: {{.Arg1}}, RTT {{.Arg2}}ms, loss {{.Arg3}}%, concurrency {{.Arg4}}/{{.Arg5}}"
|
||||
net_env_lan:
|
||||
|
||||
@@ -547,6 +547,8 @@ adaptive_pool_increase:
|
||||
other: "并发调整: {{.Arg1}} -> {{.Arg2}} (网络健康)"
|
||||
adaptive_pool_slowstart_exit:
|
||||
other: "慢启动退出: 当前 {{.Arg1}} (检测到拥塞)"
|
||||
adaptive_pool_wait_timeout:
|
||||
other: "线程池等待超时(10分钟),强制退出"
|
||||
net_probe_result:
|
||||
other: "网络探测: {{.Arg1}}, RTT {{.Arg2}}ms, 丢包 {{.Arg3}}%, 并发 {{.Arg4}}/{{.Arg5}}"
|
||||
net_env_lan:
|
||||
|
||||
Reference in New Issue
Block a user