fix: credential TCP precheck bypass proxy and pipeline goroutine leak

- Skip TCP precheck when proxy is enabled, net.DialTimeout cannot
  reach targets behind SOCKS5/HTTP proxy
- Drain stream channel on ctx cancellation to prevent EnhancedPortScan
  goroutine from blocking on a full channel
This commit is contained in:
ZacharyZcR
2026-05-13 01:55:27 +08:00
parent bc4e657e58
commit f30a153b67
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ func TestCredentialsConcurrently(
}
// TCP 预检:快速验证目标可达,避免对不可达目标浪费全部凭据尝试
if testConfig.TargetAddr != "" {
// 代理模式下跳过:net.DialTimeout 直连无法到达代理后的内网目标
if testConfig.TargetAddr != "" && !common.IsProxyEnabled() {
preConn, err := net.DialTimeout("tcp", testConfig.TargetAddr, 3*time.Second)
if err != nil {
return &ScanResult{