BB: Fix some minor configuration issue in CredentialsReuse

This commit is contained in:
Ilija Lazoroski 2022-09-20 18:06:12 +02:00
parent a2b8fceb28
commit 3af38d7841
3 changed files with 13 additions and 6 deletions

View File

@ -10,7 +10,7 @@ from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIs
from envs.monkey_zoo.blackbox.island_client.test_configuration_parser import get_target_ips from envs.monkey_zoo.blackbox.island_client.test_configuration_parser import get_target_ips
from envs.monkey_zoo.blackbox.log_handlers.test_logs_handler import TestLogsHandler from envs.monkey_zoo.blackbox.log_handlers.test_logs_handler import TestLogsHandler
from envs.monkey_zoo.blackbox.test_configurations import ( from envs.monkey_zoo.blackbox.test_configurations import (
credential_reuse_ssh_key_test_configuration, credentials_reuse_ssh_key_test_configuration,
depth_1_a_test_configuration, depth_1_a_test_configuration,
depth_2_a_test_configuration, depth_2_a_test_configuration,
depth_3_a_test_configuration, depth_3_a_test_configuration,
@ -166,7 +166,7 @@ class TestMonkeyBlackbox:
def test_credentials_reuse_ssh_key(self, island_client): def test_credentials_reuse_ssh_key(self, island_client):
TestMonkeyBlackbox.run_exploitation_test( TestMonkeyBlackbox.run_exploitation_test(
island_client, credential_reuse_ssh_key_test_configuration, "Credentials_Reuse_SSH_Key" island_client, credentials_reuse_ssh_key_test_configuration, "Credentials_Reuse_SSH_Key"
) )
# Not grouped because conflicts with SMB. # Not grouped because conflicts with SMB.

View File

@ -7,4 +7,4 @@ from .powershell_credentials_reuse import powershell_credentials_reuse_test_conf
from .smb_pth import smb_pth_test_configuration from .smb_pth import smb_pth_test_configuration
from .wmi_mimikatz import wmi_mimikatz_test_configuration from .wmi_mimikatz import wmi_mimikatz_test_configuration
from .zerologon import zerologon_test_configuration from .zerologon import zerologon_test_configuration
from .credential_reuse_ssh_key import credential_reuse_ssh_key_test_configuration from .credentials_reuse_ssh_key import credentials_reuse_ssh_key_test_configuration

View File

@ -10,6 +10,8 @@ from .utils import (
add_subnets, add_subnets,
add_tcp_ports, add_tcp_ports,
replace_agent_configuration, replace_agent_configuration,
replace_propagation_credentials,
set_keep_tunnel_open_time,
set_maximum_depth, set_maximum_depth,
) )
@ -45,7 +47,8 @@ def _add_tcp_ports(agent_configuration: AgentConfiguration) -> AgentConfiguratio
return add_tcp_ports(agent_configuration, ports) return add_tcp_ports(agent_configuration, ports)
test_agent_configuration = set_maximum_depth(noop_test_configuration.agent_configuration, 1) test_agent_configuration = set_maximum_depth(noop_test_configuration.agent_configuration, 3)
test_agent_configuration = set_keep_tunnel_open_time(test_agent_configuration, 20)
test_agent_configuration = _add_exploiters(test_agent_configuration) test_agent_configuration = _add_exploiters(test_agent_configuration)
test_agent_configuration = _add_subnets(test_agent_configuration) test_agent_configuration = _add_subnets(test_agent_configuration)
test_agent_configuration = _add_credential_collectors(test_agent_configuration) test_agent_configuration = _add_credential_collectors(test_agent_configuration)
@ -57,8 +60,12 @@ CREDENTIALS = (
Credentials(identity=None, secret=Password(password="5BuYHeVl")), Credentials(identity=None, secret=Password(password="5BuYHeVl")),
) )
credential_reuse_ssh_key_test_configuration = dataclasses.replace(noop_test_configuration) credentials_reuse_ssh_key_test_configuration = dataclasses.replace(noop_test_configuration)
replace_agent_configuration( replace_agent_configuration(
test_configuration=credential_reuse_ssh_key_test_configuration, test_configuration=credentials_reuse_ssh_key_test_configuration,
agent_configuration=test_agent_configuration, agent_configuration=test_agent_configuration,
) )
replace_propagation_credentials(
test_configuration=credentials_reuse_ssh_key_test_configuration,
propagation_credentials=CREDENTIALS,
)