forked from p15670423/monkey
Agent: Rename function for returning ExploiterResultData
This commit is contained in:
parent
6cdb86aa4b
commit
4ecc5283e5
|
@ -127,7 +127,7 @@ class HostExploiter:
|
|||
powershell = True if "powershell" in cmd.lower() else False
|
||||
self.exploit_info["executed_cmds"].append({"cmd": cmd, "powershell": powershell})
|
||||
|
||||
def get_exploit_result_data(self) -> ExploiterResultData:
|
||||
def return_exploit_result_data(self) -> ExploiterResultData:
|
||||
return ExploiterResultData(
|
||||
self.exploit_result["exploitation_success"],
|
||||
self.exploit_result["propagation_success"],
|
||||
|
|
|
@ -114,7 +114,7 @@ class SSHExploiter(HostExploiter):
|
|||
self.exploit_result["error_message"] = f"SSH port is closed on {self.host}, skipping"
|
||||
|
||||
logger.info(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
try:
|
||||
ssh = self.exploit_with_ssh_keys(port)
|
||||
|
@ -129,7 +129,7 @@ class SSHExploiter(HostExploiter):
|
|||
self.exploit_result["propagation_success"] = False
|
||||
|
||||
logger.debug(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
if not self.host.os.get("type"):
|
||||
try:
|
||||
|
@ -143,7 +143,7 @@ class SSHExploiter(HostExploiter):
|
|||
|
||||
if not uname_os:
|
||||
logger.error(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
except Exception as exc:
|
||||
self.exploit_result["propagation_success"] = False
|
||||
self.exploit_result[
|
||||
|
@ -151,7 +151,7 @@ class SSHExploiter(HostExploiter):
|
|||
] = f"Error running uname os command on victim {self.host}: ({exc})"
|
||||
|
||||
logger.debug(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
if not self.host.os.get("machine"):
|
||||
try:
|
||||
|
@ -174,7 +174,7 @@ class SSHExploiter(HostExploiter):
|
|||
] = f"Can't find suitable monkey executable for host {self.host}"
|
||||
|
||||
logger.info(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
try:
|
||||
ftp = ssh.open_sftp()
|
||||
|
@ -211,7 +211,7 @@ class SSHExploiter(HostExploiter):
|
|||
)
|
||||
)
|
||||
if status == ScanStatus.SCANNED:
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
try:
|
||||
cmdline = "%s %s" % (self.options["dropper_target_path_linux"], MONKEY_ARG)
|
||||
|
@ -230,7 +230,7 @@ class SSHExploiter(HostExploiter):
|
|||
|
||||
ssh.close()
|
||||
self.add_executed_cmd(cmdline)
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
||||
except Exception as exc:
|
||||
self.exploit_result["propagation_success"] = False
|
||||
|
@ -239,4 +239,4 @@ class SSHExploiter(HostExploiter):
|
|||
] = f"Error running monkey on victim {self.host}: ({exc})"
|
||||
|
||||
logger.error(self.exploit_result["error_message"])
|
||||
return self.get_exploit_result_data()
|
||||
return self.return_exploit_result_data()
|
||||
|
|
Loading…
Reference in New Issue