mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 04:31:52 +08:00
fix: 补全 HTTP/TLS proxy stats 加锁,修复 RPC/SMB 解析越界和 POC 加载逻辑
- httpdialer.go/tlsdialer.go: LastError/LastConnectTime/AverageConnectTime 加 mutex - findnet.go: RPC 响应结束标记位置 < 4 时跳过截断,防止负数切片 panic - ms17010.go: SMB 会话响应最小长度改为 45,sessionSetupResponse 加长度校验 - web_scan.go: POC 加载失败时不标记 pocLoaded,允许后续重试 - Eval.go: DNSLog 配置去掉 sync.Once,允许多次扫描更新配置
This commit is contained in:
@@ -50,7 +50,9 @@ func (t *tlsDialerWrapper) DialTLSContext(ctx context.Context, network, address
|
||||
if err := tlsConn.Handshake(); err != nil {
|
||||
_ = tcpConn.Close() // TLS握手失败,Close错误可忽略
|
||||
atomic.AddInt64(&t.stats.FailedConnections, 1)
|
||||
t.stats.mu.Lock()
|
||||
t.stats.LastError = err.Error()
|
||||
t.stats.mu.Unlock()
|
||||
return nil, NewProxyError(ErrTypeConnection, ErrMsgTLSHandshakeFailed, ErrCodeTLSHandshakeFailed, err)
|
||||
}
|
||||
|
||||
@@ -71,7 +73,8 @@ func (t *tlsDialerWrapper) DialTLSContext(ctx context.Context, network, address
|
||||
|
||||
// updateAverageConnectTime 更新平均连接时间
|
||||
func (t *tlsDialerWrapper) updateAverageConnectTime(duration time.Duration) {
|
||||
// 简单的移动平均
|
||||
t.stats.mu.Lock()
|
||||
defer t.stats.mu.Unlock()
|
||||
if t.stats.AverageConnectTime == 0 {
|
||||
t.stats.AverageConnectTime = duration
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user