Skip to content

Commit

Permalink
codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
nmasdoufi-ol committed Dec 20, 2024
1 parent 9d985ab commit 7fb613b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/exploits/cve_2023_34990_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,24 @@ def testCVE202334990_whenError_fetchLogFileHandlesErrorGracefully(

assert accept is True
assert len(vulnerabilities) == 0


def testCVE202334990_whenLogFileFetchSucceeds_vulnerabilitiesFound(
requests_mock: req_mock.mocker.Mocker,
) -> None:
"""CVE-2023-34990 unit test: case when _fetch_log_file successfully fetches the log file."""

mock_log_content = "sessionid=ABC1234 sessionid=XYZ5678"
requests_mock.get(
"http://localhost:80/ems/cgi-bin/ezrf_lighttpd.cgi",
text=mock_log_content,
status_code=200,
)

exploit_instance = cve_2023_34990.CVE202334990Exploit()
target = definitions.Target("http", "localhost", 80)

vulnerabilities = exploit_instance.check(target)

assert len(vulnerabilities) == 1
assert vulnerabilities[0].entry.title == cve_2023_34990.VULNERABILITY_TITLE

0 comments on commit 7fb613b

Please sign in to comment.