diff --git a/common/output/stdout_writer.go b/common/output/stdout_writer.go index 56d6d54..5cc7d36 100644 --- a/common/output/stdout_writer.go +++ b/common/output/stdout_writer.go @@ -98,6 +98,9 @@ func (w *StdoutNDJSONWriter) flatten(r *ScanResult) *ndjsonRecord { rec.Title = strVal(d, "title") rec.URL = strVal(d, "url") rec.Vulnerability = strVal(d, "vulnerability") + if rec.Vulnerability == "" { + rec.Vulnerability = strVal(d, "vulnerability_name") + } rec.Username = strVal(d, "username") rec.Password = strVal(d, "password") rec.Plugin = strVal(d, "plugin") diff --git a/common/output/writers.go b/common/output/writers.go index 825226b..c0013eb 100644 --- a/common/output/writers.go +++ b/common/output/writers.go @@ -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 获取格式类型