forked from p15670423/monkey
log exceptions in exploit_host
This commit is contained in:
parent
f3f124ce76
commit
2d48001f7b
|
@ -1,3 +1,4 @@
|
|||
import logging
|
||||
from abc import abstractmethod
|
||||
|
||||
from infection_monkey.config import WormConfiguration
|
||||
|
@ -10,6 +11,9 @@ import infection_monkey.exploit
|
|||
__author__ = 'itamar'
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HostExploiter(Plugin):
|
||||
@staticmethod
|
||||
def should_run(class_name):
|
||||
|
@ -67,8 +71,11 @@ class HostExploiter(Plugin):
|
|||
|
||||
def exploit_host(self):
|
||||
self.pre_exploit()
|
||||
result = None
|
||||
try:
|
||||
result = self._exploit_host()
|
||||
except Exception as e:
|
||||
logger.warning(f'Exception in exploit_host: {e}')
|
||||
finally:
|
||||
self.post_exploit()
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue