From b3446764255450b00c3c01149979846d0933c11e Mon Sep 17 00:00:00 2001 From: vakaris_zilius Date: Fri, 18 Feb 2022 11:56:21 +0000 Subject: [PATCH] Agent: add basic log statements to the mimikatz collector --- .../mimikatz_collector/mimikatz_credential_collector.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 1cbef911e..0ef75ed1b 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 @@ -1,3 +1,4 @@ +import logging from typing import Sequence from infection_monkey.credential_collectors import LMHash, NTHash, Password, Username @@ -6,10 +7,15 @@ from infection_monkey.i_puppet.credential_collection import Credentials, ICreden from . import pypykatz_handler from .windows_credentials import WindowsCredentials +logger = logging.getLogger(__name__) + class MimikatzCredentialCollector(ICredentialCollector): + def collect_credentials(self, options=None) -> Sequence[Credentials]: + logger.info("Attempting to collect windows credentials with pypykatz.") creds = pypykatz_handler.get_windows_creds() + logger.info(f"Pypykatz gathered {len(creds)} credentials.") return MimikatzCredentialCollector._to_credentials(creds) @staticmethod