Agent: Use credential intercepting messenger in Zerologon

This commit is contained in:
Ilija Lazoroski 2022-03-29 11:42:59 +02:00
parent b8a72a9719
commit e7e6201d75
1 changed files with 10 additions and 4 deletions

View File

@ -89,6 +89,7 @@ class InfectionMonkey:
self._default_server = self._opts.server self._default_server = self._opts.server
# TODO used in propogation phase # TODO used in propogation phase
self._monkey_inbound_tunnel = None self._monkey_inbound_tunnel = None
self._credentials_store = None
self.telemetry_messenger = LegacyTelemetryMessengerAdapter() self.telemetry_messenger = LegacyTelemetryMessengerAdapter()
self._current_depth = self._opts.depth self._current_depth = self._opts.depth
self._master = None self._master = None
@ -189,13 +190,13 @@ class InfectionMonkey:
) )
control_channel = ControlChannel(self._default_server, GUID) control_channel = ControlChannel(self._default_server, GUID)
credentials_store = AggregatingCredentialsStore(control_channel) self._credentials_store = AggregatingCredentialsStore(control_channel)
telemetry_messenger = CredentialsInterceptingTelemetryMessenger( telemetry_messenger = CredentialsInterceptingTelemetryMessenger(
ExploitInterceptingTelemetryMessenger( ExploitInterceptingTelemetryMessenger(
self.telemetry_messenger, self._monkey_inbound_tunnel self.telemetry_messenger, self._monkey_inbound_tunnel
), ),
credentials_store, self._credentials_store,
) )
self._master = AutomatedMaster( self._master = AutomatedMaster(
@ -205,7 +206,7 @@ class InfectionMonkey:
victim_host_factory, victim_host_factory,
control_channel, control_channel,
local_network_interfaces, local_network_interfaces,
credentials_store, self._credentials_store,
) )
@staticmethod @staticmethod
@ -256,9 +257,14 @@ class InfectionMonkey:
puppet.load_plugin( puppet.load_plugin(
"MSSQLExploiter", exploit_wrapper.wrap(MSSQLExploiter), PluginType.EXPLOITER "MSSQLExploiter", exploit_wrapper.wrap(MSSQLExploiter), PluginType.EXPLOITER
) )
zerologon_telemetry_messenger = CredentialsInterceptingTelemetryMessenger(
self.telemetry_messenger, self._credentials_store
)
zerologon_wrapper = ExploiterWrapper(zerologon_telemetry_messenger, agent_repository)
puppet.load_plugin( puppet.load_plugin(
"ZerologonExploiter", "ZerologonExploiter",
exploit_wrapper.wrap(ZerologonExploiter), zerologon_wrapper.wrap(ZerologonExploiter),
PluginType.EXPLOITER, PluginType.EXPLOITER,
) )