From 02a30e695065e9f2369d677721191c08978aced3 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 13 Jun 2022 16:28:09 +0200 Subject: [PATCH] Agent: Remove `current_server` option from custom_pba --- .../infection_monkey/post_breach/custom_pba/custom_pba.py | 7 ++----- .../post_breach/actions/test_users_custom_pba.py | 8 -------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/monkey/infection_monkey/post_breach/custom_pba/custom_pba.py b/monkey/infection_monkey/post_breach/custom_pba/custom_pba.py index f86df9e28..5f0b3a9bf 100644 --- a/monkey/infection_monkey/post_breach/custom_pba/custom_pba.py +++ b/monkey/infection_monkey/post_breach/custom_pba/custom_pba.py @@ -37,9 +37,6 @@ class CustomPBA(PBA): return super().run(options) def _set_options(self, options: Dict): - # Required for attack telemetry - self.current_server = options["current_server"] - if is_windows_os(): # Add windows commands to PBA's if options["windows_filename"]: @@ -89,8 +86,8 @@ class CustomPBA(PBA): self.telemetry_messenger.send_telemetry( T1105Telem( status, - self.current_server.split(":")[0], - get_interface_to_target(self.current_server.split(":")[0]), + self.cc_client.server_address.split(":")[0], + get_interface_to_target(self.cc_client.server_address.split(":")[0]), filename, ) ) diff --git a/monkey/tests/unit_tests/infection_monkey/post_breach/actions/test_users_custom_pba.py b/monkey/tests/unit_tests/infection_monkey/post_breach/actions/test_users_custom_pba.py index 75da530b0..b03c098dd 100644 --- a/monkey/tests/unit_tests/infection_monkey/post_breach/actions/test_users_custom_pba.py +++ b/monkey/tests/unit_tests/infection_monkey/post_breach/actions/test_users_custom_pba.py @@ -44,8 +44,6 @@ def fake_custom_pba_linux_options(): "linux_filename": CUSTOM_LINUX_FILENAME, "windows_command": "", "windows_filename": "", - # Current server is used for attack telemetry - "current_server": CUSTOM_SERVER, } @@ -71,8 +69,6 @@ def fake_custom_pba_windows_options(): "linux_filename": "", "windows_command": CUSTOM_WINDOWS_CMD, "windows_filename": CUSTOM_WINDOWS_FILENAME, - # Current server is used for attack telemetry - "current_server": CUSTOM_SERVER, } @@ -94,8 +90,6 @@ def fake_options_files_only(): "linux_filename": CUSTOM_LINUX_FILENAME, "windows_command": "", "windows_filename": CUSTOM_WINDOWS_FILENAME, - # Current server is used for attack telemetry - "current_server": CUSTOM_SERVER, } @@ -113,8 +107,6 @@ def fake_options_commands_only(): "linux_filename": "", "windows_command": CUSTOM_WINDOWS_CMD, "windows_filename": "", - # Current server is used for attack telemetry - "current_server": CUSTOM_SERVER, }