forked from p34709852/monkey
UT: Move PROPAGATION_CREDENTIALS into data_for_tests
This commit is contained in:
parent
aaf1009504
commit
1af21b372c
|
@ -0,0 +1,18 @@
|
||||||
|
from common.credentials import Credentials, LMHash, NTHash, Password, Username
|
||||||
|
|
||||||
|
username = "m0nk3y_user"
|
||||||
|
special_username = "m0nk3y.user"
|
||||||
|
nt_hash = "C1C58F96CDF212B50837BC11A00BE47C"
|
||||||
|
lm_hash = "299BD128C1101FD6299BD128C1101FD6"
|
||||||
|
password_1 = "trytostealthis"
|
||||||
|
password_2 = "password"
|
||||||
|
password_3 = "12345678"
|
||||||
|
|
||||||
|
PROPAGATION_CREDENTIALS_1 = Credentials(
|
||||||
|
identities=(Username(username),),
|
||||||
|
secrets=(NTHash(nt_hash), LMHash(lm_hash), Password(password_1)),
|
||||||
|
)
|
||||||
|
PROPAGATION_CREDENTIALS_2 = Credentials(
|
||||||
|
identities=(Username(username), Username(special_username)),
|
||||||
|
secrets=(Password(password_1), Password(password_2), Password(password_3)),
|
||||||
|
)
|
|
@ -4,7 +4,4 @@ from .open_error_file_repository import OpenErrorFileRepository
|
||||||
from .in_memory_agent_configuration_repository import InMemoryAgentConfigurationRepository
|
from .in_memory_agent_configuration_repository import InMemoryAgentConfigurationRepository
|
||||||
from .in_memory_simulation_configuration import InMemorySimulationRepository
|
from .in_memory_simulation_configuration import InMemorySimulationRepository
|
||||||
from .stub_propagation_credentials_repository import StubPropagationCredentialsRepository
|
from .stub_propagation_credentials_repository import StubPropagationCredentialsRepository
|
||||||
from .stub_propagation_credentials_repository import (
|
from .in_memory_credentials_repository import InMemoryCredentialsRepository
|
||||||
PROPAGATION_CREDENTIALS_1,
|
|
||||||
PROPAGATION_CREDENTIALS_2,
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,23 +1,12 @@
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
from common.credentials import Credentials, LMHash, NTHash, Password, Username
|
from tests.data_for_tests.propagation_credentials import (
|
||||||
from monkey_island.cc.repository import ICredentialsRepository
|
PROPAGATION_CREDENTIALS_1,
|
||||||
|
PROPAGATION_CREDENTIALS_2,
|
||||||
|
)
|
||||||
|
|
||||||
fake_username = "m0nk3y_user"
|
from common.credentials import Credentials
|
||||||
fake_special_username = "m0nk3y.user"
|
from monkey_island.cc.repository import ICredentialsRepository
|
||||||
fake_nt_hash = "C1C58F96CDF212B50837BC11A00BE47C"
|
|
||||||
fake_lm_hash = "299BD128C1101FD6299BD128C1101FD6"
|
|
||||||
fake_password_1 = "trytostealthis"
|
|
||||||
fake_password_2 = "password"
|
|
||||||
fake_password_3 = "12345678"
|
|
||||||
PROPAGATION_CREDENTIALS_1 = Credentials(
|
|
||||||
identities=(Username(fake_username),),
|
|
||||||
secrets=(NTHash(fake_nt_hash), LMHash(fake_lm_hash), Password(fake_password_1)),
|
|
||||||
)
|
|
||||||
PROPAGATION_CREDENTIALS_2 = Credentials(
|
|
||||||
identities=(Username(fake_username), Username(fake_special_username)),
|
|
||||||
secrets=(Password(fake_password_1), Password(fake_password_2), Password(fake_password_3)),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class StubPropagationCredentialsRepository(ICredentialsRepository):
|
class StubPropagationCredentialsRepository(ICredentialsRepository):
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from tests.monkey_island import PROPAGATION_CREDENTIALS_1, PROPAGATION_CREDENTIALS_2
|
from tests.data_for_tests.propagation_credentials import (
|
||||||
|
PROPAGATION_CREDENTIALS_1,
|
||||||
|
PROPAGATION_CREDENTIALS_2,
|
||||||
|
)
|
||||||
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
||||||
|
|
||||||
from monkey_island.cc.resources.credentials.configured_propagation_credentials import (
|
from monkey_island.cc.resources.credentials.configured_propagation_credentials import (
|
||||||
ConfiguredPropagationCredentials,
|
ConfiguredPropagationCredentials,
|
||||||
)
|
)
|
||||||
from monkey_island.cc.resources.credentials.stolen_propagation_credentials import (
|
|
||||||
StolenPropagationCredentials,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_configured_propagation_credentials_endpoint_get(flask_client):
|
def test_configured_propagation_credentials_endpoint_get(flask_client):
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from tests.monkey_island import PROPAGATION_CREDENTIALS_1, PROPAGATION_CREDENTIALS_2
|
from tests.data_for_tests.propagation_credentials import (
|
||||||
|
PROPAGATION_CREDENTIALS_1,
|
||||||
|
PROPAGATION_CREDENTIALS_2,
|
||||||
|
)
|
||||||
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
||||||
|
|
||||||
from monkey_island.cc.resources.credentials.stolen_propagation_credentials import (
|
from monkey_island.cc.resources.credentials.stolen_propagation_credentials import (
|
||||||
|
|
Loading…
Reference in New Issue