From c980bfd9153d6c1e53ba058c15c07a7dd1ab7efc Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 6 Oct 2022 09:57:11 -0400 Subject: [PATCH] Agent: Move timestamp closer to ssh.exec_command() --- monkey/infection_monkey/exploit/sshexec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/sshexec.py b/monkey/infection_monkey/exploit/sshexec.py index 233a718ec..0382f99ce 100644 --- a/monkey/infection_monkey/exploit/sshexec.py +++ b/monkey/infection_monkey/exploit/sshexec.py @@ -248,11 +248,11 @@ class SSHExploiter(HostExploiter): if status == ScanStatus.SCANNED: raise FailedExploitationError(self.exploit_result.error_message) - timestamp = time() try: cmdline = f"{monkey_path_on_victim} {MONKEY_ARG}" cmdline += build_monkey_commandline(self.servers, self.current_depth + 1) cmdline += " > /dev/null 2>&1 &" + timestamp = time() ssh.exec_command(cmdline, timeout=SSH_EXEC_TIMEOUT) logger.info(