From 87bfe41c50ff3c36c65c6d6b7fad9f7ef0610608 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 21 Jun 2020 01:06:45 +0530 Subject: [PATCH] Linux: change location of hidden file/folder --- .../utils/linux/hidden_files.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/monkey/infection_monkey/utils/linux/hidden_files.py b/monkey/infection_monkey/utils/linux/hidden_files.py index 26b96b16c..ca03e8809 100644 --- a/monkey/infection_monkey/utils/linux/hidden_files.py +++ b/monkey/infection_monkey/utils/linux/hidden_files.py @@ -1,35 +1,35 @@ -HIDDEN_FILE = '/var/tmp/.monkey-hidden-file' -HIDDEN_FOLDER = '/var/tmp/.monkey-hidden-folder' +HIDDEN_FILE = '$HOME/.monkey-hidden-file' +HIDDEN_FOLDER = '$HOME/.monkey-hidden-folder' def get_linux_commands_to_hide_files(): return [ - 'touch', # create file + 'touch', # create file HIDDEN_FILE, '&&' 'echo \"Successfully created hidden file: {}\" |'.format(HIDDEN_FILE), # output - 'tee -a', # and write to file + 'tee -a', # and write to file HIDDEN_FILE ] def get_linux_commands_to_hide_folders(): return [ - 'mkdir', # make directory + 'mkdir', # make directory HIDDEN_FOLDER, '; touch', # create file - '{}/{}'.format(HIDDEN_FOLDER, 'some-file'), # random file in hidden folder + '{}/{}'.format(HIDDEN_FOLDER, 'some-file'), # random file in hidden folder '; echo \"Successfully created hidden folder: {}\" |'.format(HIDDEN_FOLDER), # output - 'tee -a', # and write to file - '{}/{}'.format(HIDDEN_FOLDER, 'some-file') # random file in hidden folder + 'tee -a', # and write to file + '{}/{}'.format(HIDDEN_FOLDER, 'some-file') # random file in hidden folder ] def get_linux_commands_to_delete(): return [ - 'rm', # remove - '-r', # delete recursively - '-f', # force delete + 'rm', # remove + '-r', # delete recursively + '-f', # force delete HIDDEN_FILE, HIDDEN_FOLDER ]