From 70cce742e1bf57e843664efebd504f770419c6ca Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sat, 13 Jun 2026 19:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20DetectPocFormat=20=E8=AF=AF=E5=88=A4?= =?UTF-8?q?=E5=90=AB=20transport=20=E7=9A=84=20fscan=20POC=20=E4=B8=BA=20x?= =?UTF-8?q?ray=20=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 有 transport 字段但 rules 是数组的 POC(如 apache-httpd-cve-2021-40438) 属于 fscan 格式,不应被 xray 分支兜底。移除错误的 fallback return, 让这类 POC 正确落入 fscan 格式检测分支。 修复前: 388个POC成功380个,失败8个 修复后: 388个POC成功388个,失败0个 --- webscan/lib/poc_adapter.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webscan/lib/poc_adapter.go b/webscan/lib/poc_adapter.go index efc69e2..597414e 100644 --- a/webscan/lib/poc_adapter.go +++ b/webscan/lib/poc_adapter.go @@ -89,15 +89,14 @@ func DetectPocFormat(data []byte) PocFormat { } // xray格式特征:name + transport + rules(映射) + // 注意:有 transport 但 rules 是数组的属于 fscan 格式,不能在这里兜底 if _, hasName := raw["name"]; hasName { if _, hasTransport := raw["transport"]; hasTransport { if rules, hasRules := raw["rules"]; hasRules { - // 检查 rules 是否为映射 if _, isMap := rules.(map[interface{}]interface{}); isMap { return FormatXray } } - return FormatXray } }