From 826652fab936574cc172f41d8129f132e74edf00 Mon Sep 17 00:00:00 2001 From: nmasdoufi-ol Date: Tue, 24 Dec 2024 14:54:30 +0100 Subject: [PATCH] Fix comments. --- agent/exploits/cve_2024_50379.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/exploits/cve_2024_50379.py b/agent/exploits/cve_2024_50379.py index 6496ca2..5b4d337 100644 --- a/agent/exploits/cve_2024_50379.py +++ b/agent/exploits/cve_2024_50379.py @@ -62,7 +62,7 @@ def check(self, target: definitions.Target) -> list[definitions.Vulnerability]: root_response = requests.get( target.origin, timeout=DEFAULT_TIMEOUT.seconds, verify=False ) - if root_response.status_code != 200: + if not (200 <= root_response.status_code < 600 and root_response.text): return vulnerabilities # Extract version information @@ -86,8 +86,7 @@ def check(self, target: definitions.Target) -> list[definitions.Vulnerability]: test_response.status_code in (201, 204) or _is_version_vulnerable(tomcat_version) is True ): - vulnerability = self._create_vulnerability(target) - vulnerabilities.append(vulnerability) + vulnerabilities = [self._create_vulnerability(target)] except requests.RequestException: return vulnerabilities