mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix: DetectPocFormat 误判含 transport 的 fscan POC 为 xray 格式
有 transport 字段但 rules 是数组的 POC(如 apache-httpd-cve-2021-40438) 属于 fscan 格式,不应被 xray 分支兜底。移除错误的 fallback return, 让这类 POC 正确落入 fscan 格式检测分支。 修复前: 388个POC成功380个,失败8个 修复后: 388个POC成功388个,失败0个
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user