Skip to content

Commit

Permalink
fix webhook tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Nov 9, 2023
1 parent edf420c commit 59391ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bbot/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def pytest_sessionfinish(session, exitstatus):

@pytest.fixture
def non_mocked_hosts() -> list:
return ["127.0.0.1", "localhost"] + interactsh_servers
return ["127.0.0.1", "localhost", "github.com"] + interactsh_servers


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions bbot/test/test_step_2/module_tests/test_module_discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestDiscord(ModuleTestBase):
targets = ["http://127.0.0.1:8888/cookie.aspx", "http://127.0.0.1:8888/cookie2.aspx"]
modules_overrides = ["discord", "excavate", "badsecrets", "httpx"]

webhook_url = "output_modules.discord.webhook_url=https://discord.com/api/webhooks/1234/deadbeef-P-uF-asdf"
webhook_url = "https://discord.com/api/webhooks/1234/deadbeef-P-uF-asdf"
config_overrides = {"output_modules": {"discord": {"webhook_url": webhook_url}}}

def custom_setup(self, module_test):
Expand All @@ -31,7 +31,7 @@ def custom_response(request: httpx.Request):
else:
return httpx.Response(status_code=module_test.module.good_status_code)

module_test.httpx_mock.add_callback(custom_response)
module_test.httpx_mock.add_callback(custom_response, url=self.webhook_url)

def check(self, module_test, events):
vulns = [e for e in events if e.type == "VULNERABILITY"]
Expand Down
2 changes: 1 addition & 1 deletion bbot/test/test_step_2/module_tests/test_module_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class TestSlack(DiscordBase):
targets = ["http://127.0.0.1:8888/cookie.aspx", "http://127.0.0.1:8888/cookie2.aspx"]
modules_overrides = ["slack", "excavate", "badsecrets", "httpx"]

webhook_url = "output_modules.slack.webhook_url=https://hooks.slack.com/services/deadbeef/deadbeef/deadbeef"
webhook_url = "https://hooks.slack.com/services/deadbeef/deadbeef/deadbeef"
config_overrides = {"output_modules": {"slack": {"webhook_url": webhook_url}}}
2 changes: 1 addition & 1 deletion bbot/test/test_step_2/module_tests/test_module_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def custom_response(request: httpx.Request):
text="1",
)

module_test.httpx_mock.add_callback(custom_response)
module_test.httpx_mock.add_callback(custom_response, url=self.webhook_url)

0 comments on commit 59391ae

Please sign in to comment.