Agent: Use current_depth in SSH exploit

This commit is contained in:
Ilija Lazoroski 2022-03-16 20:14:13 +01:00
parent 10bb74e402
commit d29990769b
1 changed files with 1 additions and 2 deletions

View File

@ -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)