Little changes based on review

This commit is contained in:
Shreya 2020-06-07 20:21:09 +05:30
parent 6b4e90e6d0
commit eea5352084
2 changed files with 6 additions and 5 deletions

View File

@ -10,7 +10,7 @@ from infection_monkey.utils.hidden_files import\
from infection_monkey.utils.environment import is_windows_os from infection_monkey.utils.environment import is_windows_os
CREATE_HIDDEN = [get_commands_to_hide_files, HIDDEN_FSO_CREATION_COMMANDS = [get_commands_to_hide_files,
get_commands_to_hide_folders] get_commands_to_hide_folders]
@ -24,8 +24,8 @@ class HiddenFiles(PBA):
def run(self): def run(self):
# create hidden files and folders # create hidden files and folders
for method_to_create in CREATE_HIDDEN: for function_to_get_commands in HIDDEN_FSO_CREATION_COMMANDS:
linux_cmds, windows_cmds = method_to_create() linux_cmds, windows_cmds = function_to_get_commands()
super(HiddenFiles, self).__init__(name=POST_BREACH_HIDDEN_FILES, super(HiddenFiles, self).__init__(name=POST_BREACH_HIDDEN_FILES,
linux_cmd=' '.join(linux_cmds), linux_cmd=' '.join(linux_cmds),
windows_cmd=windows_cmds) windows_cmd=windows_cmds)

View File

@ -6,7 +6,8 @@ def get_linux_commands_to_hide_files():
return [ return [
'touch', # create file 'touch', # create file
HIDDEN_FILE, HIDDEN_FILE,
'; echo \"Successfully created hidden file: {}\" |'.format(HIDDEN_FILE), # output '&&'
'echo \"Successfully created hidden file: {}\" |'.format(HIDDEN_FILE), # output
'tee -a', # and write to file 'tee -a', # and write to file
HIDDEN_FILE HIDDEN_FILE
] ]