Agent: Add interrupt check before/after agent upload in wmiexec.py

This commit is contained in:
vakarisz 2022-03-18 14:14:22 +02:00
parent bd07459dab
commit 13e5c03cf9
1 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,9 @@ class WmiExploiter(HostExploiter):
downloaded_agent = self.agent_repository.get_agent_binary(self.host.os["type"])
if self.is_interrupted():
return self.exploit_result
remote_full_path = SmbTools.copy_file(
self.host,
downloaded_agent,
@ -81,6 +84,9 @@ class WmiExploiter(HostExploiter):
self.options["smb_download_timeout"],
)
if self.is_interrupted():
return self.exploit_result
if not remote_full_path:
wmi_connection.close()
return self.exploit_result