From d06163caf5fe22b545305b9c5f975fb7a8ccbd94 Mon Sep 17 00:00:00 2001 From: Leonardo de Oliveira Maia <101437950+LeoOMaia@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:01:45 -0300 Subject: [PATCH] updating xml openvas parser --- dojo/tools/openvas/xml_parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dojo/tools/openvas/xml_parser.py b/dojo/tools/openvas/xml_parser.py index d765de9541..d5495a2035 100644 --- a/dojo/tools/openvas/xml_parser.py +++ b/dojo/tools/openvas/xml_parser.py @@ -28,8 +28,9 @@ def get_findings(self, filename, test): title = title + "_" + finding.text description.append(f"**Port**: {finding.text}") if finding.tag == "nvt": - script_id = finding.get("oid") - description.append(f"**NVT**: {script_id}") + script_id = finding.get("oid") or finding.text + text = f"{script_id}\n{finding.text}" if finding.get("oid") and finding.text else script_id + description.append(f"**NVT**: {text}") if finding.tag == "severity": severity = self.convert_cvss_score(finding.text) description.append(f"**Severity**: {finding.text}") @@ -40,7 +41,6 @@ def get_findings(self, filename, test): finding = Finding( title=str(title), - test=test, description="\n".join(description), severity=severity, dynamic_finding=True,