From 9618739811b3330fddb6e46bb85a1fc0b9cd74a4 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Mon, 13 Nov 2023 16:15:11 -0500 Subject: [PATCH] fixed tests --- .../module_tests/test_module_filedownload.py | 8 -------- .../module_tests/test_module_massdns.py | 6 ------ .../module_tests/test_module_secretsdb.py | 8 -------- .../test_module_subdomain_hijack.py | 19 ------------------- 4 files changed, 41 deletions(-) diff --git a/bbot/test/test_step_2/module_tests/test_module_filedownload.py b/bbot/test/test_step_2/module_tests/test_module_filedownload.py index e4471d159..2c04003e1 100644 --- a/bbot/test/test_step_2/module_tests/test_module_filedownload.py +++ b/bbot/test/test_step_2/module_tests/test_module_filedownload.py @@ -12,14 +12,6 @@ class TestFileDownload(ModuleTestBase): 3 0 obj<>endobj trailer <>""" - async def setup_before_prep(self, module_test): - module_test.httpx_mock.add_response( - url="https://raw.githubusercontent.com/jshttp/mime-db/master/db.json", - json={ - "application/pdf": {"source": "iana", "compressible": False, "extensions": ["pdf"]}, - }, - ) - async def setup_after_prep(self, module_test): module_test.set_expect_requests( dict(uri="/"), diff --git a/bbot/test/test_step_2/module_tests/test_module_massdns.py b/bbot/test/test_step_2/module_tests/test_module_massdns.py index 04f4860dd..1b4543788 100644 --- a/bbot/test/test_step_2/module_tests/test_module_massdns.py +++ b/bbot/test/test_step_2/module_tests/test_module_massdns.py @@ -5,12 +5,6 @@ class TestMassdns(ModuleTestBase): subdomain_wordlist = tempwordlist(["www", "asdf"]) config_overrides = {"modules": {"massdns": {"wordlist": str(subdomain_wordlist)}}} - async def setup_before_prep(self, module_test): - module_test.httpx_mock.add_response( - url="https://raw.githubusercontent.com/blacklanternsecurity/public-dns-servers/master/nameservers.txt", - text="8.8.8.8\n8.8.4.4\n1.1.1.1", - ) - def check(self, module_test, events): assert any(e.data == "www.blacklanternsecurity.com" for e in events) assert not any(e.data == "asdf.blacklanternsecurity.com" for e in events) diff --git a/bbot/test/test_step_2/module_tests/test_module_secretsdb.py b/bbot/test/test_step_2/module_tests/test_module_secretsdb.py index 67b6e28bc..f735035bc 100644 --- a/bbot/test/test_step_2/module_tests/test_module_secretsdb.py +++ b/bbot/test/test_step_2/module_tests/test_module_secretsdb.py @@ -6,14 +6,6 @@ class TestSecretsDB(ModuleTestBase): modules_overrides = ["httpx", "secretsdb"] async def setup_before_prep(self, module_test): - module_test.httpx_mock.add_response( - url="https://raw.githubusercontent.com/blacklanternsecurity/secrets-patterns-db/master/db/rules-stable.yml", - text="""patterns: -- pattern: - confidence: 99 - name: Asymmetric Private Key - regex: '-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'""", - ) expect_args = {"method": "GET", "uri": "/"} respond_args = {"response_data": "-----BEGIN PGP PRIVATE KEY BLOCK-----"} module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args) diff --git a/bbot/test/test_step_2/module_tests/test_module_subdomain_hijack.py b/bbot/test/test_step_2/module_tests/test_module_subdomain_hijack.py index ace21d352..7aa6a6680 100644 --- a/bbot/test/test_step_2/module_tests/test_module_subdomain_hijack.py +++ b/bbot/test/test_step_2/module_tests/test_module_subdomain_hijack.py @@ -5,25 +5,6 @@ class TestSubdomain_Hijack(ModuleTestBase): targets = ["http://127.0.0.1:8888"] modules_overrides = ["httpx", "excavate", "subdomain_hijack"] - async def setup_before_prep(self, module_test): - module_test.httpx_mock.add_response( - url="https://raw.githubusercontent.com/EdOverflow/can-i-take-over-xyz/master/fingerprints.json", - json=[ - { - "cicd_pass": True, - "cname": ["us-east-1.elasticbeanstalk.com"], - "discussion": "[Issue #194](https://github.com/EdOverflow/can-i-take-over-xyz/issues/194)", - "documentation": "", - "fingerprint": "NXDOMAIN", - "http_status": None, - "nxdomain": True, - "service": "AWS/Elastic Beanstalk", - "status": "Vulnerable", - "vulnerable": True, - } - ], - ) - async def setup_after_prep(self, module_test): fingerprints = module_test.module.fingerprints assert fingerprints, "No subdomain hijacking fingerprints available"