forked from p15670423/monkey
Agent: refactor content dict out of credential component
Content dict serves no purpose, because dataclasses can be serialized without explicit conversion to dict
This commit is contained in:
parent
b7003bc231
commit
0fae933477
|
@ -7,4 +7,3 @@ from ..credential_type import CredentialType
|
||||||
@dataclass
|
@dataclass
|
||||||
class ICredentialComponent(ABC):
|
class ICredentialComponent(ABC):
|
||||||
type: CredentialType
|
type: CredentialType
|
||||||
content: dict
|
|
||||||
|
|
|
@ -4,4 +4,5 @@ from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
class LMHash(ICredentialComponent):
|
class LMHash(ICredentialComponent):
|
||||||
def __init__(self, lm_hash: str):
|
def __init__(self, lm_hash: str):
|
||||||
super().__init__(type=CredentialType.NTLM_HASH, content={"lm_hash": lm_hash})
|
super().__init__(type=CredentialType.NTLM_HASH)
|
||||||
|
self.lm_hash = lm_hash
|
||||||
|
|
|
@ -4,4 +4,5 @@ from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
class NTHash(ICredentialComponent):
|
class NTHash(ICredentialComponent):
|
||||||
def __init__(self, nt_hash: str):
|
def __init__(self, nt_hash: str):
|
||||||
super().__init__(type=CredentialType.NTLM_HASH, content={"nt_hash": nt_hash})
|
super().__init__(type=CredentialType.NTLM_HASH)
|
||||||
|
self.nt_hash = nt_hash
|
||||||
|
|
|
@ -4,4 +4,5 @@ from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
class Password(ICredentialComponent):
|
class Password(ICredentialComponent):
|
||||||
def __init__(self, password: str):
|
def __init__(self, password: str):
|
||||||
super().__init__(type=CredentialType.PASSWORD, content={"password": password})
|
super().__init__(type=CredentialType.PASSWORD)
|
||||||
|
self.password = password
|
||||||
|
|
|
@ -4,4 +4,5 @@ from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
class SSHKeypair(ICredentialComponent):
|
class SSHKeypair(ICredentialComponent):
|
||||||
def __init__(self, content: dict):
|
def __init__(self, content: dict):
|
||||||
super().__init__(type=CredentialType.SSH_KEYPAIR, content=content)
|
super().__init__(type=CredentialType.SSH_KEYPAIR)
|
||||||
|
self.content = content
|
||||||
|
|
|
@ -4,4 +4,5 @@ from .i_credential_component import ICredentialComponent
|
||||||
|
|
||||||
class Username(ICredentialComponent):
|
class Username(ICredentialComponent):
|
||||||
def __init__(self, username: str):
|
def __init__(self, username: str):
|
||||||
super().__init__(type=CredentialType.USERNAME, content={"username": username})
|
super().__init__(type=CredentialType.USERNAME)
|
||||||
|
self.username = username
|
||||||
|
|
Loading…
Reference in New Issue