fix: 修复实机测试发现的可靠性问题 (v2.2.0-rc.1)
测试构建 / 代码检查 (push) Has been cancelled
测试构建 / 单元测试和构建 (push) Has been cancelled
测试构建 / 构建验证 (push) Has been cancelled

- UDP 插件在 -p 指定端口时被跳过
- Redis exploit 无超时保护 / readReply 吞没非超时错误
- service_probe 连接丢失后静默成功
- SNMP 探测成功但终端无输出
- SSH 爆破不稳定 (并发过高 + 自适应超时过短 + 限流误判)
- 进度条 isActive 竞态

新增 Config.ModuleTimeout() 协议级超时下限 (≥3s)
新增 ErrorTypeThrottle 限流错误分类
This commit is contained in:
ZacharyZcR
2026-06-14 22:23:52 +08:00
parent 3babff6863
commit 6d61b661f4
51 changed files with 285 additions and 257 deletions
+5 -5
View File
@@ -84,7 +84,7 @@ func (p *RabbitMQPlugin) doRabbitMQAuth(ctx context.Context, info *common.HostIn
}
baseURL := "http://" + net.JoinHostPort(info.Host, strconv.Itoa(port))
client := &http.Client{Timeout: config.Timeout}
client := &http.Client{Timeout: config.ModuleTimeout()}
req, err := http.NewRequestWithContext(ctx, "GET", baseURL+"/api/overview", nil)
if err != nil {
@@ -165,7 +165,7 @@ func (p *RabbitMQPlugin) testUnauthorizedAccess(ctx context.Context, info *commo
}
baseURL := "http://" + net.JoinHostPort(info.Host, strconv.Itoa(port))
client := &http.Client{Timeout: config.Timeout}
client := &http.Client{Timeout: config.ModuleTimeout()}
// 测试无认证访问
req, err := http.NewRequestWithContext(ctx, "GET", baseURL+"/api/overview", nil)
@@ -213,13 +213,13 @@ func (p *RabbitMQPlugin) testUnauthorizedAccess(ctx context.Context, info *commo
func (p *RabbitMQPlugin) testAMQPProtocol(ctx context.Context, info *common.HostInfo, session *common.ScanSession) *ScanResult {
target := info.Target()
conn, err := session.DialTCP(ctx, "tcp", target, session.Config.Timeout)
conn, err := session.DialTCP(ctx, "tcp", target, session.Config.ModuleTimeout())
if err != nil {
return nil
}
defer func() { _ = conn.Close() }()
_ = conn.SetDeadline(time.Now().Add(session.Config.Timeout))
_ = conn.SetDeadline(time.Now().Add(session.Config.ModuleTimeout()))
// 发送AMQP协议头
amqpHeader := []byte{0x41, 0x4d, 0x51, 0x50, 0x00, 0x00, 0x09, 0x01}
@@ -280,7 +280,7 @@ func (p *RabbitMQPlugin) testManagementInterface(ctx context.Context, info *comm
target := info.Target()
baseURL := "http://" + info.Target()
client := &http.Client{Timeout: config.Timeout}
client := &http.Client{Timeout: config.ModuleTimeout()}
req, err := http.NewRequestWithContext(ctx, "GET", baseURL, nil)
if err != nil {