mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 12:41:53 +08:00
fix: 结果文件中 POC 漏洞只显示 vulnerable 不显示漏洞名称 (Closes #591)
POC 扫描结果存入 details["vulnerability_name"], 但 TXT/CSV/NDJSON 三种输出格式只读 details["vulnerability"], key 不匹配导致漏洞名丢失,退化为显示 status 字段 "vulnerable"。 三种 writer 统一兼容两种 key。
This commit is contained in:
@@ -283,6 +283,9 @@ func (w *TXTWriter) formatVulnLine(result *ScanResult) string {
|
||||
}
|
||||
|
||||
vuln := w.getDetailStr(result, "vulnerability")
|
||||
if vuln == "" {
|
||||
vuln = w.getDetailStr(result, "vulnerability_name")
|
||||
}
|
||||
if vuln != "" {
|
||||
return fmt.Sprintf("%s %s", result.Target, vuln)
|
||||
}
|
||||
@@ -789,12 +792,18 @@ func formatFingerprints(value interface{}) string {
|
||||
|
||||
func (w *CSVWriter) formatVulnRecord(result *ScanResult) []string {
|
||||
vulnType := ""
|
||||
vulnName := result.Status
|
||||
if result.Details != nil {
|
||||
if t, ok := result.Details["type"].(string); ok {
|
||||
vulnType = t
|
||||
}
|
||||
if v, ok := result.Details["vulnerability"].(string); ok && v != "" {
|
||||
vulnName = v
|
||||
} else if v, ok := result.Details["vulnerability_name"].(string); ok && v != "" {
|
||||
vulnName = v
|
||||
}
|
||||
}
|
||||
return []string{result.Target, vulnType, result.Status}
|
||||
return []string{result.Target, vulnType, vulnName}
|
||||
}
|
||||
|
||||
// GetFormat 获取格式类型
|
||||
|
||||
Reference in New Issue
Block a user