feat: 添加凭据测试未发现弱密码的提示

- credential_tester.go: 失败时设置 Type=ResultTypeCredential
- scanner.go: 根据结果类型在 error 级别输出'未发现弱密码'提示
- 新增 i18n 翻译 brute_no_weak_pass

使用 -log all 或 -log error 可看到此提示
This commit is contained in:
ZacharyZcR
2026-01-20 13:01:59 +08:00
parent 4ef21f3841
commit eec3941fba
4 changed files with 12 additions and 3 deletions
+7 -3
View File
@@ -212,11 +212,15 @@ func executeScanTask(config *common.Config, state *common.State, pluginName stri
if plugin != nil {
result := plugin.Scan(context.Background(), &target, config, state)
if result != nil {
if result.Error != nil {
common.LogError(i18n.Tr("plugin_scan_error", target.Host, target.Port, result.Error))
} else if result.Success {
if result.Success {
// 保存成功的扫描结果到文件
savePluginResult(&target, pluginName, result)
} else if result.Type == plugins.ResultTypeCredential {
// 凭据测试完成但未发现弱密码,在error级别输出提示
common.LogError(i18n.Tr("brute_no_weak_pass", target.Host, target.Port, pluginName))
} else if result.Error != nil {
// 其他类型的错误
common.LogError(i18n.Tr("plugin_scan_error", target.Host, target.Port, result.Error))
}
}
}