diff --git a/monkey/infection_monkey/credential_collectors/credential_components/i_credential_component.py b/monkey/infection_monkey/credential_collectors/credential_components/i_credential_component.py index f2d46c091..97b3e35c4 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/i_credential_component.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/i_credential_component.py @@ -1,9 +1,10 @@ -from abc import ABC -from dataclasses import dataclass +from abc import ABC, abstractmethod -from ..credential_type import CredentialType +from infection_monkey.credential_collectors.credential_type import CredentialType -@dataclass class ICredentialComponent(ABC): - type: CredentialType + @property + @abstractmethod + def type(self) -> CredentialType: + pass diff --git a/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py b/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py index ecfb97d49..603422dca 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py @@ -3,6 +3,7 @@ from .i_credential_component import ICredentialComponent class LMHash(ICredentialComponent): + type = CredentialType.LM_HASH + def __init__(self, lm_hash: str): - super().__init__(type=CredentialType.NTLM_HASH) self.lm_hash = lm_hash diff --git a/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py b/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py index 5ffc83016..9ca0f888d 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py @@ -3,6 +3,7 @@ from .i_credential_component import ICredentialComponent class NTHash(ICredentialComponent): + type = CredentialType.NT_HASH + def __init__(self, nt_hash: str): - super().__init__(type=CredentialType.NTLM_HASH) self.nt_hash = nt_hash diff --git a/monkey/infection_monkey/credential_collectors/credential_components/password.py b/monkey/infection_monkey/credential_collectors/credential_components/password.py index 01b970de0..cf546aac6 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/password.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/password.py @@ -3,6 +3,7 @@ from .i_credential_component import ICredentialComponent class Password(ICredentialComponent): + type = CredentialType.PASSWORD + def __init__(self, password: str): - super().__init__(type=CredentialType.PASSWORD) self.password = password diff --git a/monkey/infection_monkey/credential_collectors/credential_components/username.py b/monkey/infection_monkey/credential_collectors/credential_components/username.py index 154fa3817..578551489 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/username.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/username.py @@ -3,6 +3,7 @@ from .i_credential_component import ICredentialComponent class Username(ICredentialComponent): + type = CredentialType.USERNAME + def __init__(self, username: str): - super().__init__(type=CredentialType.USERNAME) self.username = username