forked from p34709852/monkey
Agent: Re-raise exceptions in HostExploiter
The AutomatedMaster can't process the exceptions if the HostExploiter swallows them. The HostExploiter can log and re-raise the exceptions so they can be processed by the AutomatedMaster.
This commit is contained in:
parent
00829ac094
commit
fd2143a4df
|
@ -82,16 +82,16 @@ class HostExploiter:
|
||||||
self.options = options
|
self.options = options
|
||||||
|
|
||||||
self.pre_exploit()
|
self.pre_exploit()
|
||||||
result = None
|
|
||||||
try:
|
try:
|
||||||
result = self._exploit_host()
|
return self._exploit_host()
|
||||||
except FailedExploitationError as e:
|
except FailedExploitationError as e:
|
||||||
logger.debug(f"Exploiter failed: {e}.")
|
logger.debug(f"Exploiter failed: {e}.")
|
||||||
except Exception:
|
raise e
|
||||||
|
except Exception as e:
|
||||||
logger.error("Exception in exploit_host", exc_info=True)
|
logger.error("Exception in exploit_host", exc_info=True)
|
||||||
|
raise e
|
||||||
finally:
|
finally:
|
||||||
self.post_exploit()
|
self.post_exploit()
|
||||||
return result
|
|
||||||
|
|
||||||
def pre_exploit(self):
|
def pre_exploit(self):
|
||||||
self.exploit_result = ExploiterResultData(
|
self.exploit_result = ExploiterResultData(
|
||||||
|
|
Loading…
Reference in New Issue