BB: Rename get_ips_of_targets() -> get_target_ips_from_serialized_config() and pass correct arguments

This commit is contained in:
Shreya Malviya 2022-07-21 12:33:19 +05:30 committed by Mike Salvatore
parent c6ffd16e48
commit 690fb71e10
3 changed files with 6 additions and 4 deletions

View File

@ -11,7 +11,7 @@ class IslandConfigParser:
return agent_configuration.to_json() return agent_configuration.to_json()
@staticmethod @staticmethod
def get_ips_of_targets(raw_config: Mapping) -> Iterable: def get_target_ips_from_serialized_config(raw_config: Mapping) -> Iterable:
return dpath.util.get( return dpath.util.get(
raw_config, "agent_configuration.propagation.network_scan.targets.subnets", "." raw_config, "agent_configuration.propagation.network_scan.targets.subnets", "."
) )

View File

@ -91,7 +91,7 @@ class TestMonkeyBlackbox:
): ):
raw_config = IslandConfigParser.get_serialized_config(agent_configuration) raw_config = IslandConfigParser.get_serialized_config(agent_configuration)
analyzer = CommunicationAnalyzer( analyzer = CommunicationAnalyzer(
island_client, IslandConfigParser.get_ips_of_targets(raw_config) island_client, IslandConfigParser.get_target_ips_from_serialized_config(raw_config)
) )
log_handler = TestLogsHandler( log_handler = TestLogsHandler(
test_name, island_client, TestMonkeyBlackbox.get_log_dir_path() test_name, island_client, TestMonkeyBlackbox.get_log_dir_path()
@ -146,7 +146,7 @@ class TestMonkeyBlackbox:
raw_config = IslandConfigParser.get_serialized_config(zerologon_test_configuration) raw_config = IslandConfigParser.get_serialized_config(zerologon_test_configuration)
zero_logon_analyzer = ZerologonAnalyzer(island_client, expected_creds) zero_logon_analyzer = ZerologonAnalyzer(island_client, expected_creds)
communication_analyzer = CommunicationAnalyzer( communication_analyzer = CommunicationAnalyzer(
island_client, IslandConfigParser.get_ips_of_targets(raw_config) island_client, IslandConfigParser.get_target_ips_from_serialized_config(raw_config)
) )
log_handler = TestLogsHandler( log_handler = TestLogsHandler(
test_name, island_client, TestMonkeyBlackbox.get_log_dir_path() test_name, island_client, TestMonkeyBlackbox.get_log_dir_path()

View File

@ -36,7 +36,9 @@ class ExploitationTest(BasicTest):
def print_test_starting_info(self): def print_test_starting_info(self):
LOGGER.info("Started {} test".format(self.name)) LOGGER.info("Started {} test".format(self.name))
machine_list = ", ".join(IslandConfigParser.get_ips_of_targets(self.raw_config)) machine_list = ", ".join(
IslandConfigParser.get_target_ips_from_serialized_config(self.raw_config)
)
LOGGER.info(f"Machines participating in test: {machine_list}") LOGGER.info(f"Machines participating in test: {machine_list}")
print("") print("")