diff --git a/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py b/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py index 8417849db..09063fa2d 100644 --- a/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py +++ b/monkey/infection_monkey/post_breach/actions/modify_shell_startup_files.py @@ -37,6 +37,3 @@ class ModifyShellStartupFile(PBA): super(ModifyShellStartupFile, self).__init__(name=POST_BREACH_SHELL_STARTUP_FILE_MODIFICATION, linux_cmd=linux_cmds, windows_cmd=windows_cmds) - - def run(self): - super(ModifyShellStartupFile, self).run() diff --git a/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py b/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py index 745caf6c8..552904506 100644 --- a/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py +++ b/monkey/infection_monkey/post_breach/shell_startup_files/linux/shell_startup_files_modification.py @@ -11,11 +11,9 @@ STARTUP_FILES = [ def get_linux_commands_to_modify_shell_startup_files(): return [ - 'echo \"# Succesfully modified {0}\"', - '3<{0} 3<&- |', # check for existence of file - 'tee -a', # append to file - '{0}', - '&&', - 'sed -i \'$d\' {0}', # remove last line of file + '3<{0} 3<&- &&', # check for existence of file + 'echo \"# Succesfully modified {0}\" |', + 'tee -a {0} &&', # append to file + 'sed -i \'$d\' {0}', # remove last line of file (undo changes) ],\ STARTUP_FILES