From 04e18179319d941b7233c9fcbc85b681facf07af Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Thu, 3 Oct 2019 12:05:15 +0300 Subject: [PATCH] Added debug log with the deletion commands --- .../post_breach/actions/communicate_as_new_user.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/post_breach/actions/communicate_as_new_user.py b/monkey/infection_monkey/post_breach/actions/communicate_as_new_user.py index 28797b6d0..3118fcca9 100644 --- a/monkey/infection_monkey/post_breach/actions/communicate_as_new_user.py +++ b/monkey/infection_monkey/post_breach/actions/communicate_as_new_user.py @@ -55,8 +55,9 @@ class CommunicateAsNewUser(PBA): exit_status = os.system(final_command) self.send_ping_result_telemetry(exit_status, commandline, username) # delete the user, async in case it gets stuck. - _ = subprocess.Popen( - get_linux_commands_to_delete_user(username), stderr=subprocess.STDOUT, shell=True) + commands_to_delete_user = get_linux_commands_to_delete_user(username) + logger.debug("Trying to delete the user {} with commands {}".format(username, str(commands_to_delete_user))) + _ = subprocess.Popen(commands_to_delete_user, stderr=subprocess.STDOUT, shell=True) # Leaking the process on purpose - nothing we can do if it's stuck. except subprocess.CalledProcessError as e: PostBreachTelem(self, (e.output, False)).send()