forked from p15670423/monkey
Agent: Fix SSH exploiter to be able to exploit unknown OS
Previously if the agent couldn't detect the OS, agent failed with errors
This commit is contained in:
parent
d509ee7216
commit
f3fd2fca8b
|
@ -4,6 +4,7 @@ from pathlib import PurePath
|
|||
|
||||
import paramiko
|
||||
|
||||
from common import OperatingSystem
|
||||
from common.common_consts.timeouts import LONG_REQUEST_TIMEOUT, MEDIUM_REQUEST_TIMEOUT
|
||||
from common.credentials.credentials import get_plaintext
|
||||
from common.utils import Timer
|
||||
|
@ -181,7 +182,8 @@ class SSHExploiter(HostExploiter):
|
|||
_, stdout, _ = ssh.exec_command("uname -o", timeout=SSH_EXEC_TIMEOUT)
|
||||
uname_os = stdout.read().lower().strip().decode()
|
||||
if "linux" in uname_os:
|
||||
self.exploit_result.os = "linux"
|
||||
self.exploit_result.os = OperatingSystem.LINUX
|
||||
self.host.os["type"] = OperatingSystem.LINUX
|
||||
else:
|
||||
self.exploit_result.error_message = f"SSH Skipping unknown os: {uname_os}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue