forked from p34709852/monkey
Agent: Add abstract properties for exploiter tags
This commit is contained in:
parent
95b1d9c62d
commit
12e9aaf42e
|
@ -24,6 +24,16 @@ class HostExploiter:
|
|||
def _EXPLOITED_SERVICE(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def _exploiter_tags(self) -> Tuple[str, ...]:
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def _propagation_tags(self) -> Tuple[str, ...]:
|
||||
pass
|
||||
|
||||
def __init__(self):
|
||||
self.exploit_info = {
|
||||
"display_name": self._EXPLOITED_SERVICE,
|
||||
|
@ -140,7 +150,7 @@ class HostExploiter:
|
|||
success=exploitation_success,
|
||||
exploiter_name=self.__class__.__name__,
|
||||
error_message=error_message,
|
||||
tags=frozenset(tags),
|
||||
tags=frozenset(tags or self._exploiter_tags),
|
||||
)
|
||||
self.agent_event_queue.publish(exploitation_event)
|
||||
|
||||
|
@ -156,6 +166,6 @@ class HostExploiter:
|
|||
success=propagation_success,
|
||||
exploiter_name=self.__class__.__name__,
|
||||
error_message=error_message,
|
||||
tags=frozenset(tags),
|
||||
tags=frozenset(tags or self._propagation_tags),
|
||||
)
|
||||
self.agent_event_queue.publish(propagation_event)
|
||||
|
|
Loading…
Reference in New Issue