修复凭证测试器计数器、消除panic、补齐i18n

- credential_tester: testCredentialWithRetry返回ErrorType,修复网络错误计数器永久不递增的bug
- scanner: os.Exit(1)改为return,defer Cleanup可正常执行
- probe_parser: 5处panic改为error返回,调用链透传到init()
- common库: parsers/initialize/network/session共17处硬编码中文改用i18n
- services插件: 18个文件115处硬编码中文改用i18n
- locale: 补齐service/parser/network相关~25个中英文键
This commit is contained in:
ZacharyZcR
2026-05-18 04:55:20 +08:00
parent c266912dcb
commit 77827bef66
33 changed files with 221 additions and 100 deletions
+4 -4
View File
@@ -46,7 +46,7 @@ func (p *RabbitMQPlugin) Scan(ctx context.Context, info *common.HostInfo, sessio
return &ScanResult{
Success: false,
Service: "rabbitmq",
Error: fmt.Errorf("没有可用的测试凭据"),
Error: fmt.Errorf(i18n.GetText("service_no_credentials")),
}
}
@@ -121,7 +121,7 @@ func (p *RabbitMQPlugin) doRabbitMQAuth(ctx context.Context, info *common.HostIn
return &AuthResult{
Success: false,
ErrorType: ErrorTypeAuth,
Error: fmt.Errorf("认证失败,状态码: %d", resp.StatusCode),
Error: fmt.Errorf(i18n.GetText("service_auth_failed")+": %d", resp.StatusCode),
}
}
@@ -184,7 +184,7 @@ func (p *RabbitMQPlugin) testUnauthorizedAccess(ctx context.Context, info *commo
Type: plugins.ResultTypeVuln,
Success: true,
Service: "rabbitmq",
Banner: "未授权访问",
Banner: i18n.GetText("service_unauthorized"),
}
}
}
@@ -307,7 +307,7 @@ func (p *RabbitMQPlugin) testManagementInterface(ctx context.Context, info *comm
return &ScanResult{
Success: false,
Service: "rabbitmq",
Error: fmt.Errorf("无法识别为RabbitMQ服务"),
Error: fmt.Errorf(i18n.Tr("service_not_identified", "RabbitMQ")),
}
}