Fix + make linux PBA commands cleaner

This commit is contained in:
Shreya 2020-06-20 23:30:32 +05:30
parent e5f92d29b5
commit 8d2aaac65f
2 changed files with 4 additions and 9 deletions

View File

@ -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()

View File

@ -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