Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PiranhaSa committed Nov 21, 2023
1 parent be30259 commit d360d5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
12 changes: 0 additions & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,3 @@ def check(self, target: definitions.Target) -> list[definitions.Vulnerability]:

yield TestExploit
exploits_registry.unregister(TestExploit)


@pytest.fixture()
def target_vulnerable_to_cve_2018_13382() -> definitions.Target:
"""Creates a target vulnerable to CVE-2018-13382."""
return definitions.Target("https", "109.239.246.106", 10443)


@pytest.fixture()
def target_not_vulnerable_to_cve_2018_13382() -> definitions.Target:
"""Creates a target vulnerable to CVE-2018-13382."""
return definitions.Target("https", "139.255.255.218", 10443)
8 changes: 4 additions & 4 deletions tests/exploits_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def testCVE_2021_22941_whenVulnerable_reportFinding(

def test_CVE_2018_13382_whenVulnerable_reportFinding(
requests_mock: req_mock.mocker.Mocker,
target_vulnerable_to_cve_2018_13382: definitions.Target,
) -> None:
"""Ensure that the exploit reports findings when the application is vulnerable."""
exploit_instance = cve_2018_13382.CVE201813382Exploit()
Expand All @@ -96,7 +95,8 @@ def test_CVE_2018_13382_whenVulnerable_reportFinding(
status_code=200,
)

vulnerabilities = exploit_instance.check(target_vulnerable_to_cve_2018_13382)
target = definitions.Target("https", "109.239.246.106", 10443)
vulnerabilities = exploit_instance.check(target)
vulnerability = vulnerabilities[0]

assert (
Expand All @@ -111,7 +111,6 @@ def test_CVE_2018_13382_whenVulnerable_reportFinding(

def test_CVE_2018_13382_whenNotVulnerable_reportFinding(
requests_mock: req_mock.mocker.Mocker,
target_not_vulnerable_to_cve_2018_13382: definitions.Target,
) -> None:
"""Ensure that there is not findings when the application is not vulnerable."""
exploit_instance = cve_2018_13382.CVE201813382Exploit()
Expand All @@ -122,6 +121,7 @@ def test_CVE_2018_13382_whenNotVulnerable_reportFinding(
status_code=200,
)

vulnerabilities = exploit_instance.check(target_not_vulnerable_to_cve_2018_13382)
target = definitions.Target("https", "139.255.255.218", 10443)
vulnerabilities = exploit_instance.check(target)

assert len(vulnerabilities) == 0

0 comments on commit d360d5d

Please sign in to comment.