diff --git a/common/i18n/locales/en.yaml b/common/i18n/locales/en.yaml index bee433c..fbd3d1b 100644 --- a/common/i18n/locales/en.yaml +++ b/common/i18n/locales/en.yaml @@ -309,6 +309,8 @@ plugin_panic: other: "Plugin {{.Arg1}} panic while scanning {{.Arg2}}:{{.Arg3}}: {{.Arg4}}" plugin_scan_error: other: "Plugin scan error {{.Arg1}}:{{.Arg2}} - {{.Arg3}}" +brute_no_weak_pass: + other: "{{.Arg1}}:{{.Arg2}} {{.Arg3}} no weak password found" # ========================= Port Scan Messages ========================= invalid_port: diff --git a/common/i18n/locales/zh.yaml b/common/i18n/locales/zh.yaml index e3f4a64..46ed5be 100644 --- a/common/i18n/locales/zh.yaml +++ b/common/i18n/locales/zh.yaml @@ -309,6 +309,8 @@ plugin_panic: other: "插件 {{.Arg1}} 扫描 {{.Arg2}}:{{.Arg3}} 时panic: {{.Arg4}}" plugin_scan_error: other: "插件扫描错误 {{.Arg1}}:{{.Arg2}} - {{.Arg3}}" +brute_no_weak_pass: + other: "{{.Arg1}}:{{.Arg2}} {{.Arg3}} 未发现弱密码" # ========================= 端口扫描消息 ========================= invalid_port: diff --git a/core/scanner.go b/core/scanner.go index e2459f7..f1f73cb 100644 --- a/core/scanner.go +++ b/core/scanner.go @@ -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)) } } } diff --git a/plugins/services/credential_tester.go b/plugins/services/credential_tester.go index b0cc8a3..9a1f210 100644 --- a/plugins/services/credential_tester.go +++ b/plugins/services/credential_tester.go @@ -188,6 +188,7 @@ func TestCredentialsConcurrently( } return &ScanResult{ + Type: plugins.ResultTypeCredential, // 标记这是凭据测试结果 Success: false, Service: serviceName, Error: fmt.Errorf("未发现弱密码"),