From b085df1878323636ddccc6220a0182a6354808c7 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sat, 13 Jun 2026 22:55:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D3=E4=B8=AA=E5=AE=9E?= =?UTF-8?q?=E6=B5=8B=E8=BE=93=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 静默模式NDJSON banner截断至200字符 Redis INFO响应~5KB导致JSONL单行过长,截断后加...后缀 2. CSV漏洞Type列补全 ResultTypeVuln的fillDetail未设type字段,CSV Vulns列为空 统一设为"vulnerability" 3. ICMP权限不足告警精简 4行告警(listen失败/连接失败/权限不足/切换ping)合并为1行 --- common/output/stdout_writer.go | 6 +++++- core/icmp.go | 5 ----- core/scanner.go | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/output/stdout_writer.go b/common/output/stdout_writer.go index b5228c2..56d6d54 100644 --- a/common/output/stdout_writer.go +++ b/common/output/stdout_writer.go @@ -90,7 +90,11 @@ func (w *StdoutNDJSONWriter) flatten(r *ScanResult) *ndjsonRecord { rec.Service = strVal(d, "service") rec.Protocol = strVal(d, "protocol") - rec.Banner = strVal(d, "banner") + if banner := strVal(d, "banner"); len(banner) > 200 { + rec.Banner = banner[:200] + "..." + } else { + rec.Banner = banner + } rec.Title = strVal(d, "title") rec.URL = strVal(d, "url") rec.Vulnerability = strVal(d, "vulnerability") diff --git a/core/icmp.go b/core/icmp.go index dce4907..c77339b 100644 --- a/core/icmp.go +++ b/core/icmp.go @@ -183,9 +183,6 @@ func probeWithICMP(hostslist []string, chanHosts chan string, aliveHosts *[]stri return } - common.LogError(i18n.Tr("icmp_listen_failed", err)) - common.LogInfo(i18n.GetText("trying_no_listen_icmp")) - // 尝试无监听ICMP探测 conn2, err := net.DialTimeout("ip4:icmp", "127.0.0.1", 3*time.Second) if err == nil { @@ -194,8 +191,6 @@ func probeWithICMP(hostslist []string, chanHosts chan string, aliveHosts *[]stri return } - common.LogError(i18n.Tr("icmp_connect_failed", err)) - common.LogError(i18n.GetText("insufficient_privileges")) common.LogInfo(i18n.GetText("switching_to_ping")) // 降级使用ping探测 diff --git a/core/scanner.go b/core/scanner.go index 437b792..7dd6632 100644 --- a/core/scanner.go +++ b/core/scanner.go @@ -398,13 +398,13 @@ var resultSerializers = map[plugins.ResultType]resultSerializer{ return r.Banner }, fillDetail: func(r *plugins.Result, _ *common.HostInfo, d map[string]interface{}) { - // 优先使用VulInfo,为空则回退到Banner vuln := r.VulInfo if vuln == "" { vuln = r.Banner } d["vulnerability"] = vuln d["service"] = r.Service + d["type"] = "vulnerability" }, }, plugins.ResultTypeWeb: {