Agent: Move assignment outside of try/except
This commit is contained in:
parent
3bca02af59
commit
39bada5bb1
|
@ -82,13 +82,13 @@ class PowerShellExploiter(HostExploiter):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._execute_monkey_agent_on_victim()
|
self._execute_monkey_agent_on_victim()
|
||||||
self.exploit_result.propagation_success = True
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self._publish_propagation_event(self.host.ip_addr, False, PROPAGATION_TAGS, str(ex))
|
self._publish_propagation_event(self.host.ip_addr, False, PROPAGATION_TAGS, str(ex))
|
||||||
logger.error(f"Failed to propagate to the remote host: {ex}")
|
logger.error(f"Failed to propagate to the remote host: {ex}")
|
||||||
self.exploit_result.error_message = str(ex)
|
self.exploit_result.error_message = str(ex)
|
||||||
return self.exploit_result
|
return self.exploit_result
|
||||||
|
|
||||||
|
self.exploit_result.propagation_success = True
|
||||||
self._publish_propagation_event(self.host.ip_addr, True, PROPAGATION_TAGS)
|
self._publish_propagation_event(self.host.ip_addr, True, PROPAGATION_TAGS)
|
||||||
|
|
||||||
return self.exploit_result
|
return self.exploit_result
|
||||||
|
|
Loading…
Reference in New Issue