Agent: improved type hints in mimikatz_cred_collector.py

This commit is contained in:
vakarisz 2022-02-15 18:41:19 +02:00
parent ac376a0014
commit 811434ff22
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from typing import List
from typing import Iterable
from infection_monkey.credential_collectors import (
Credentials,
@ -13,12 +13,12 @@ from .windows_credentials import WindowsCredentials
class MimikatzCredentialCollector(ICredentialCollector):
def collect_credentials(self, options=None) -> List[Credentials]:
def collect_credentials(self, options=None) -> Iterable[Credentials]:
creds = pypykatz_handler.get_windows_creds()
return MimikatzCredentialCollector._to_credentials(creds)
@staticmethod
def _to_credentials(win_creds: List[WindowsCredentials]) -> [Credentials]:
def _to_credentials(win_creds: Iterable[WindowsCredentials]) -> [Credentials]:
all_creds = []
for win_cred in win_creds:
identities = []