forked from p15670423/monkey
Agent: improved type hints in mimikatz_cred_collector.py
This commit is contained in:
parent
ac376a0014
commit
811434ff22
|
@ -1,4 +1,4 @@
|
||||||
from typing import List
|
from typing import Iterable
|
||||||
|
|
||||||
from infection_monkey.credential_collectors import (
|
from infection_monkey.credential_collectors import (
|
||||||
Credentials,
|
Credentials,
|
||||||
|
@ -13,12 +13,12 @@ from .windows_credentials import WindowsCredentials
|
||||||
|
|
||||||
|
|
||||||
class MimikatzCredentialCollector(ICredentialCollector):
|
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()
|
creds = pypykatz_handler.get_windows_creds()
|
||||||
return MimikatzCredentialCollector._to_credentials(creds)
|
return MimikatzCredentialCollector._to_credentials(creds)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _to_credentials(win_creds: List[WindowsCredentials]) -> [Credentials]:
|
def _to_credentials(win_creds: Iterable[WindowsCredentials]) -> [Credentials]:
|
||||||
all_creds = []
|
all_creds = []
|
||||||
for win_cred in win_creds:
|
for win_cred in win_creds:
|
||||||
identities = []
|
identities = []
|
||||||
|
|
Loading…
Reference in New Issue