From d29990769b80fb1b922b1aed9f497f072a9b692c Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 16 Mar 2022 20:14:13 +0100 Subject: [PATCH] Agent: Use current_depth in SSH exploit --- monkey/infection_monkey/exploit/sshexec.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monkey/infection_monkey/exploit/sshexec.py b/monkey/infection_monkey/exploit/sshexec.py index 0192ae3ed..17ae7f0f6 100644 --- a/monkey/infection_monkey/exploit/sshexec.py +++ b/monkey/infection_monkey/exploit/sshexec.py @@ -8,7 +8,6 @@ from common.utils.attack_utils import ScanStatus from common.utils.exceptions import FailedExploitationError from common.utils.exploit_enum import ExploitType from infection_monkey.exploit.HostExploiter import HostExploiter -from infection_monkey.exploit.tools.helpers import get_monkey_depth from infection_monkey.i_puppet import ExploiterResultData from infection_monkey.model import MONKEY_ARG from infection_monkey.network.tools import check_tcp_port, get_interface_to_target @@ -189,7 +188,7 @@ class SSHExploiter(HostExploiter): try: cmdline = "%s %s" % (self.options["dropper_target_path_linux"], MONKEY_ARG) - cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1) + cmdline += build_monkey_commandline(self.host, self.current_depth - 1) cmdline += " > /dev/null 2>&1 &" ssh.exec_command(cmdline)