diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py index c1ced257c..f70d90b46 100644 --- a/monkey/infection_monkey/master/automated_master.py +++ b/monkey/infection_monkey/master/automated_master.py @@ -198,8 +198,14 @@ class AutomatedMaster(IMaster): name = pba[0] options = pba[1] - result = self._puppet.run_pba(name, options) - self._telemetry_messenger.send_telemetry(PostBreachTelem(result)) + # TEMPORARY; TO AVOID ERRORS SINCE THIS ISN'T IMPLEMENTED YET + if name == "Custom": + return + + for pba_data in self._puppet.run_pba(name, options): + self._telemetry_messenger.send_telemetry( + PostBreachTelem(pba_data.display_name, pba_data.command, pba_data.result) + ) def _can_propagate(self) -> bool: return True diff --git a/monkey/infection_monkey/post_breach/actions/hide_files.py b/monkey/infection_monkey/post_breach/actions/hide_files.py index c6e1d1a6b..6bbeefa68 100644 --- a/monkey/infection_monkey/post_breach/actions/hide_files.py +++ b/monkey/infection_monkey/post_breach/actions/hide_files.py @@ -1,6 +1,6 @@ from common.common_consts.post_breach_consts import POST_BREACH_HIDDEN_FILES +from infection_monkey.i_puppet.i_puppet import PostBreachData from infection_monkey.post_breach.pba import PBA -from infection_monkey.telemetry.post_breach_telem import PostBreachTelem from infection_monkey.utils.environment import is_windows_os from infection_monkey.utils.hidden_files import ( cleanup_hidden_files, @@ -29,10 +29,12 @@ class HiddenFiles(PBA): linux_cmd=" ".join(linux_cmds), windows_cmd=windows_cmds, ) - super(HiddenFiles, self).run() + yield super(HiddenFiles, self).run() + if is_windows_os(): # use winAPI result, status = get_winAPI_to_hide_files() - PostBreachTelem(self, (result, status)).send() + # no command here, used WinAPI + yield PostBreachData(self.name, "", (result, status)) # cleanup hidden files and folders cleanup_hidden_files(is_windows_os())