From 3af6fff5ca9aac502699271ce592090305943e24 Mon Sep 17 00:00:00 2001 From: VakarisZ <vakarisz@yahoo.com> Date: Tue, 21 Jul 2020 12:10:23 +0300 Subject: [PATCH 1/3] Fixed bug: linux only PBA's throwing errors on Windows --- .../post_breach/actions/change_file_privileges.py | 8 +++----- .../post_breach/actions/use_trap_command.py | 7 +++---- monkey/infection_monkey/post_breach/pba.py | 4 +++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/change_file_privileges.py b/monkey/infection_monkey/post_breach/actions/change_file_privileges.py index 444804f81..1cf5813e3 100644 --- a/monkey/infection_monkey/post_breach/actions/change_file_privileges.py +++ b/monkey/infection_monkey/post_breach/actions/change_file_privileges.py @@ -2,12 +2,10 @@ from common.data.post_breach_consts import POST_BREACH_SETUID_SETGID from infection_monkey.post_breach.pba import PBA from infection_monkey.post_breach.setuid_setgid.setuid_setgid import \ get_commands_to_change_setuid_setgid -from infection_monkey.utils.environment import is_windows_os class ChangeSetuidSetgid(PBA): def __init__(self): - if not is_windows_os(): - linux_cmds = get_commands_to_change_setuid_setgid() - super(ChangeSetuidSetgid, self).__init__(POST_BREACH_SETUID_SETGID, - linux_cmd=' '.join(linux_cmds)) + linux_cmds = get_commands_to_change_setuid_setgid() + super(ChangeSetuidSetgid, self).__init__(POST_BREACH_SETUID_SETGID, + linux_cmd=' '.join(linux_cmds)) diff --git a/monkey/infection_monkey/post_breach/actions/use_trap_command.py b/monkey/infection_monkey/post_breach/actions/use_trap_command.py index 306e92fa3..bd461c974 100644 --- a/monkey/infection_monkey/post_breach/actions/use_trap_command.py +++ b/monkey/infection_monkey/post_breach/actions/use_trap_command.py @@ -7,7 +7,6 @@ from infection_monkey.utils.environment import is_windows_os class TrapCommand(PBA): def __init__(self): - if not is_windows_os(): - linux_cmds = get_trap_commands() - super(TrapCommand, self).__init__(POST_BREACH_TRAP_COMMAND, - linux_cmd=linux_cmds) + linux_cmds = get_trap_commands() + super(TrapCommand, self).__init__(POST_BREACH_TRAP_COMMAND, + linux_cmd=linux_cmds) diff --git a/monkey/infection_monkey/post_breach/pba.py b/monkey/infection_monkey/post_breach/pba.py index 9d6a5eeae..a6a89edf8 100644 --- a/monkey/infection_monkey/post_breach/pba.py +++ b/monkey/infection_monkey/post_breach/pba.py @@ -62,8 +62,10 @@ class PBA(Plugin): exec_funct = self._execute_default result = exec_funct() if self.scripts_were_used_successfully(result): - T1064Telem(ScanStatus.USED, "Scripts were used to execute %s post breach action." % self.name).send() + T1064Telem(ScanStatus.USED, f"Scripts were used to execute {self.name} post breach action.").send() PostBreachTelem(self, result).send() + else: + LOG.debug(f"No command available for PBA '{self.name}' on current OS, skipping.") def is_script(self): """ From d00abde17bf5c6aa2f0810be2b5e76d48ee84517 Mon Sep 17 00:00:00 2001 From: VakarisZ <vakarisz@yahoo.com> Date: Tue, 21 Jul 2020 12:33:08 +0300 Subject: [PATCH 2/3] Removed one more unused import --- monkey/infection_monkey/post_breach/actions/use_trap_command.py | 1 - 1 file changed, 1 deletion(-) diff --git a/monkey/infection_monkey/post_breach/actions/use_trap_command.py b/monkey/infection_monkey/post_breach/actions/use_trap_command.py index bd461c974..589baf1d9 100644 --- a/monkey/infection_monkey/post_breach/actions/use_trap_command.py +++ b/monkey/infection_monkey/post_breach/actions/use_trap_command.py @@ -2,7 +2,6 @@ from common.data.post_breach_consts import POST_BREACH_TRAP_COMMAND from infection_monkey.post_breach.pba import PBA from infection_monkey.post_breach.trap_command.trap_command import \ get_trap_commands -from infection_monkey.utils.environment import is_windows_os class TrapCommand(PBA): From fb5d3a0541ed8063eead810b60335d7d688d8614 Mon Sep 17 00:00:00 2001 From: VakarisZ <vakarisz@yahoo.com> Date: Wed, 22 Jul 2020 11:59:09 +0300 Subject: [PATCH 3/3] Fixed broken attack matrix checkbox UI in config --- monkey/monkey_island/cc/ui/src/styles/Checkbox.scss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss b/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss index bdc9bcb07..2c0a14d58 100644 --- a/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss +++ b/monkey/monkey_island/cc/ui/src/styles/Checkbox.scss @@ -7,7 +7,8 @@ $black: #000000; .ui-checkbox-btn { position: relative; - display: inline-block; + display: flex; + align-items: center; background-color: rgba(red, .6); text-align: center; width: 100%; @@ -100,15 +101,13 @@ $black: #000000; } .attack-matrix .ui-checkbox-btn label { + width:100%; font-weight: 700; padding-top: 0; - position: relative; - float: left; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); padding-left: 5px; padding-right: 5px; + margin-bottom: 5px; + margin-top: 5px; } .attack-matrix div.rt-td>div {