Agent: Init a callable class and subscribe to it

This commit is contained in:
Ilija Lazoroski 2022-08-15 19:22:58 +02:00
parent d672fcfffe
commit 8f5681b1df
1 changed files with 6 additions and 5 deletions

View File

@ -199,17 +199,18 @@ class InfectionMonkey:
def _build_master(self):
local_network_interfaces = InfectionMonkey._get_local_network_interfaces()
event_queue = PyPubSubEventQueue(Publisher())
event_queue.subscribe_type(
CredentialsStolenEvent, add_credentials_from_event_to_propagation_credentials_repository
)
# TODO control_channel and control_client have same responsibilities, merge them
control_channel = ControlChannel(
self._control_client.server_address, GUID, self._control_client.proxies
)
credentials_store = AggregatingPropagationCredentialsRepository(control_channel)
event_queue = PyPubSubEventQueue(Publisher())
event_queue.subscribe_type(
CredentialsStolenEvent,
add_credentials_from_event_to_propagation_credentials_repository(credentials_store),
)
puppet = self._build_puppet(credentials_store, event_queue)
victim_host_factory = self._build_victim_host_factory(local_network_interfaces)