mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 05:01:53 +08:00
fix: 修复实机测试发现的可靠性问题 (v2.2.0-rc.1)
- UDP 插件在 -p 指定端口时被跳过 - Redis exploit 无超时保护 / readReply 吞没非超时错误 - service_probe 连接丢失后静默成功 - SNMP 探测成功但终端无输出 - SSH 爆破不稳定 (并发过高 + 自适应超时过短 + 限流误判) - 进度条 isActive 竞态 新增 Config.ModuleTimeout() 协议级超时下限 (≥3s) 新增 ErrorTypeThrottle 限流错误分类
This commit is contained in:
+15
-4
@@ -186,10 +186,8 @@ func (s *ServiceScanStrategy) performHostScan(ctx context.Context, session *comm
|
||||
ep.TuneConfig(config, session)
|
||||
}
|
||||
|
||||
// 仅在默认端口扫描时调度 UDP 插件(用户指定 -p 时跳过,避免不相关的 UDP 探测拖慢扫描)
|
||||
if config.Target.Ports == "" || config.Target.Ports == "all" {
|
||||
s.dispatchUDPPlugins(ctx, session, hosts, info, config, ch, wg)
|
||||
}
|
||||
// UDP 插件调度:默认端口模式全量调度,用户指定 -p 时只调度端口有交集的 UDP 插件
|
||||
s.dispatchUDPPlugins(ctx, session, hosts, info, config, ch, wg)
|
||||
s.scanHostBatch(ctx, session, hosts, info, pluginsToRun, isCustomMode, ch, wg)
|
||||
}
|
||||
|
||||
@@ -271,9 +269,22 @@ func (s *ServiceScanStrategy) dispatchUDPPlugins(ctx context.Context, session *c
|
||||
return
|
||||
}
|
||||
|
||||
// 用户指定 -p 时,只调度端口有交集的 UDP 插件
|
||||
var userPorts map[int]bool
|
||||
if config.Target.Ports != "" && config.Target.Ports != "all" {
|
||||
parsed := parsers.ParsePort(config.Target.Ports)
|
||||
userPorts = make(map[int]bool, len(parsed))
|
||||
for _, p := range parsed {
|
||||
userPorts[p] = true
|
||||
}
|
||||
}
|
||||
|
||||
for _, host := range hosts {
|
||||
for _, pluginName := range udpPlugins {
|
||||
for _, port := range plugins.GetPluginPorts(pluginName) {
|
||||
if userPorts != nil && !userPorts[port] {
|
||||
continue
|
||||
}
|
||||
target := baseInfo
|
||||
target.Host = host
|
||||
target.Port = port
|
||||
|
||||
Reference in New Issue
Block a user