From 56770d25c68e85f1b251efac72d54eb79676bbdf Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 16 Aug 2022 13:14:59 +0530 Subject: [PATCH] Agent: Publish credentials stolen event in MimikatzCredentialCollector --- .../mimikatz_collector/mimikatz_credential_collector.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/credential_collectors/mimikatz_collector/mimikatz_credential_collector.py b/monkey/infection_monkey/credential_collectors/mimikatz_collector/mimikatz_credential_collector.py index 43bb6bcc7..53197acad 100644 --- a/monkey/infection_monkey/credential_collectors/mimikatz_collector/mimikatz_credential_collector.py +++ b/monkey/infection_monkey/credential_collectors/mimikatz_collector/mimikatz_credential_collector.py @@ -31,8 +31,14 @@ class MimikatzCredentialCollector(ICredentialCollector): def collect_credentials(self, options=None) -> Sequence[Credentials]: logger.info("Attempting to collect windows credentials with pypykatz.") windows_credentials = pypykatz_handler.get_windows_creds() + logger.info(f"Pypykatz gathered {len(windows_credentials)} credentials.") - return MimikatzCredentialCollector._to_credentials(windows_credentials) + + collected_credentials = MimikatzCredentialCollector._to_credentials(windows_credentials) + + self._publish_credentials_stolen_event(collected_credentials) + + return collected_credentials @staticmethod def _to_credentials(windows_credentials: Sequence[WindowsCredentials]) -> Sequence[Credentials]: