Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smbprotocol.exceptions.AccessDenied with require_signing=False #290

Open
mxmlnkn opened this issue Oct 4, 2024 · 5 comments
Open

smbprotocol.exceptions.AccessDenied with require_signing=False #290

mxmlnkn opened this issue Oct 4, 2024 · 5 comments

Comments

@mxmlnkn
Copy link

mxmlnkn commented Oct 4, 2024

I have set up a samba share:

sudo apt install samba
        cat <<EOF | sudo tee /etc/samba/smb.conf
[global]
usershare allow guests = no

[test]
path = /tmp/smbshare
browsable = yes
guest ok = no
read only = yes
create mask = 0755
EOF
    sudo adduser --no-create-home --disabled-password --disabled-login sambauser
    sudo smbpasswd -a sambauser  # type password here
    sudo systemctl restart smbd nmbd

I have successfully connected to it with:

smbclient --user=sambauser --password=password --port 445 -c ls //127.0.0.1/test

and even with:

import smbclient
smbclient.register_session(server="127.0.0.1", username="sambauser", password="password", port=445)
print(smbclient.listdir("127.0.0.1//test/", port=445))

However, with require_signing=False, i.e.:

import smbclient
smbclient.register_session(server="127.0.0.1", username="sambauser", password="password", port=445, require_signing=False)
print(smbclient.listdir("127.0.0.1//test/", port=445))

I get:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.local/lib/python3.10/site-packages/smbclient/_os.py", line 237, in listdir
    with SMBDirectoryIO(path, mode="r", share_access="r", **kwargs) as dir_fd:
  File "/home/user/.local/lib/python3.10/site-packages/smbclient/_io.py", line 362, in __init__
    tree, fd_path = get_smb_tree(path, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/smbclient/_pool.py", line 320, in get_smb_tree
    tree.connect(require_secure_negotiate=client_config.require_secure_negotiate)
  File "/home/user/.local/lib/python3.10/site-packages/smbprotocol/tree.py", line 248, in connect
    response = self.session.connection.receive(request)
  File "/home/user/.local/lib/python3.10/site-packages/smbprotocol/connection.py", line 1103, in receive
    raise SMBResponseException(response)
smbprotocol.exceptions.AccessDenied: Received unexpected status from the server:
A process has requested access to an object but has not been granted those access rights.
(3221225506) STATUS_ACCESS_DENIED: 0xc0000022

which make no sense to me. I am only lowering requirements, not outright disabling signing. And why should the login still succeed but only result in an access rights error for listing the share further on?

@adiroiban
Copy link
Contributor

Thanks Max, for the report

Is this test executed using a Samba container?

See the last part of the "Testing" section from the Readme

https://github.com/jborean93/smbprotocol/blob/master/README.md#testing

source ./build_helpers/lib.sh

lib::setup::smb_server

There are various automated tests

for example this one

def test_dialect_3_1_1_not_require_signing(self, smb_real):
connection = Connection(uuid.uuid4(), smb_real[2], smb_real[3], False)
connection.connect(Dialects.SMB_3_1_1)
try:
assert connection.dialect == Dialects.SMB_3_1_1
assert connection.negotiated_dialects == [Dialects.SMB_3_1_1]
assert connection.gss_negotiate_token is not None
assert len(connection.preauth_integrity_hash_value) == 2
assert len(connection.salt) == 32
assert connection.sequence_window["low"] == 1
assert connection.sequence_window["high"] == 2
assert connection.client_security_mode == SecurityMode.SMB2_NEGOTIATE_SIGNING_ENABLED
assert connection.supports_encryption
if connection.server_security_mode & SecurityMode.SMB2_NEGOTIATE_SIGNING_REQUIRED:
assert connection.require_signing
else:
assert not connection.require_signing
finally:
connection.disconnect()


It would help to get this reproduced using the automated tests.

In this way, if this needs an improvement to the tests, once this is fixed, we know that this use case is covered for any of the future releases

@mxmlnkn
Copy link
Author

mxmlnkn commented Oct 6, 2024

Is this test executed using a Samba container?

No. I have simply installed the Ubuntu samba package via apt.

There are various automated tests

At this point, I feel veritably cursed to trigger every possible issue. The tests failed because I had an smbclient.py file in my PATH:

ImportError while loading conftest 'smbprotocol/tests/conftest.py'.
tests/conftest.py:9: in <module>
    from smbclient import ClientConfig, delete_session, mkdir
E   ImportError: cannot import name 'ClientConfig' from 'smbclient' (/home/user/.local/bin/smbclient.py)

After renaming that by stripping the .py extension, the tests run through successfully. Although there are some skipped ones because of The SMB_SHARE env var was not set, integration tests will be skipped. After setting up the environment variables with: SMB_USER=$user SMB_PASSWORD=$password SMB_SERVER=127.0.0.1 SMB_PORT=445 SMB_SHARE=test-share py.test -v --cov smbprotocol --cov-report term-missing, a lot of the tests are still failing:

Partial log output
tests/test_change_notify.py::TestFileNotifyInformation::test_create_message PASSED                                                                                           [  0%]
tests/test_change_notify.py::TestFileNotifyInformation::test_parse_message PASSED                                                                                            [  0%]
tests/test_change_notify.py::TestSMB2ChangeNotifyRequest::test_create_message PASSED                                                                                         [  0%]
tests/test_change_notify.py::TestSMB2ChangeNotifyRequest::test_parse_message PASSED                                                                                          [  0%]
tests/test_change_notify.py::TestSMB2ChangeNotifyResponse::test_create_message PASSED                                                                                        [  0%]
tests/test_change_notify.py::TestSMB2ChangeNotifyResponse::test_parse_message PASSED                                                                                         [  0%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_on_dir FAILED                                                                                              [  0%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_on_dir_compound FAILED                                                                                     [  0%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_no_data FAILED                                                                                             [  0%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_underlying_close FAILED                                                                                    [  0%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_cancel FAILED                                                                                              [  1%]
tests/test_change_notify.py::TestChangeNotify::test_change_notify_on_a_file FAILED                                                                                           [  1%]
tests/test_connection.py::TestSMB2NegotiateRequest::test_create_message PASSED                                                                                               [  1%]
tests/test_connection.py::TestSMB2NegotiateRequest::test_parse_message PASSED                                                                                                [  1%]
tests/test_connection.py::TestSMB3NegotiateRequest::test_create_message PASSED                                                                                               [  1%]
tests/test_connection.py::TestSMB3NegotiateRequest::test_create_message_one_dialect PASSED                                                                                   [  1%]
tests/test_connection.py::TestSMB3NegotiateRequest::test_parse_message PASSED                                                                                                [  1%]
tests/test_connection.py::TestSMB3NegotiateRequest::test_create_message_with_context_no_padding PASSED                                                                       [  1%]
tests/test_connection.py::TestSMB3NegotiateRequest::test_parse_message_with_context_no_padding PASSED                                                                        [  1%]
tests/test_connection.py::TestSMB2NegotiateContextRequest::test_create_message PASSED                                                                                        [  1%]
tests/test_connection.py::TestSMB2NegotiateContextRequest::test_parse_message PASSED                                                                                         [  2%]
tests/test_connection.py::TestSMB2NegotiateContextRequest::test_parse_message_invalid_context_type PASSED                                                                    [  2%]
tests/test_connection.py::TestSMB2PreauthIntegrityCapabilities::test_create_message PASSED                                                                                   [  2%]
tests/test_connection.py::TestSMB2PreauthIntegrityCapabilities::test_parse_message PASSED                                                                                    [  2%]
tests/test_connection.py::TestSMB2EncryptionCapabilities::test_create_message PASSED                                                                                         [  2%]
tests/test_connection.py::TestSMB2EncryptionCapabilities::test_parse_message PASSED                                                                                          [  2%]
tests/test_connection.py::TestSMB2NetnameNegotiateContextId::test_create_message PASSED                                                                                      [  2%]
tests/test_connection.py::TestSMB2NetnameNegotiateContextId::test_parse_message PASSED                                                                                       [  2%]
tests/test_connection.py::TestSMB2SigningCapabilities::test_create_message PASSED                                                                                            [  2%]
tests/test_connection.py::TestSMB2SigningCapabilities::test_parse_message PASSED                                                                                             [  2%]
tests/test_connection.py::TestSMB2NegotiateResponse::test_create_message PASSED                                                                                              [  2%]
tests/test_connection.py::TestSMB2NegotiateResponse::test_create_message_3_1_1 PASSED                                                                                        [  3%]
tests/test_connection.py::TestSMB2NegotiateResponse::test_parse_message PASSED                                                                                               [  3%]
tests/test_connection.py::TestSMB2NegotiateResponse::test_parse_message_3_1_1 PASSED                                                                                         [  3%]
tests/test_connection.py::TestSMB2Echo::test_create_message PASSED                                                                                                           [  3%]
tests/test_connection.py::TestSMB2Echo::test_parse_message PASSED                                                                                                            [  3%]
tests/test_connection.py::TestSMB2CancelRequest::test_create_message PASSED                                                                                                  [  3%]
tests/test_connection.py::TestSMB2CancelRequest::test_parse_message PASSED                                                                                                   [  3%]
tests/test_connection.py::TestSMB2TransformHeader::test_create_message PASSED                                                                                                [  3%]
tests/test_connection.py::TestSMB2TransformHeader::test_parse_message PASSED                                                                                                 [  3%]
tests/test_connection.py::TestConnection::test_dialect_2_0_2 PASSED                                                                                                          [  3%]
tests/test_connection.py::TestConnection::test_dialect_2_1_0 PASSED                                                                                                          [  4%]
tests/test_connection.py::TestConnection::test_dialect_3_0_0 PASSED                                                                                                          [  4%]
tests/test_connection.py::TestConnection::test_dialect_3_0_2 PASSED                                                                                                          [  4%]
tests/test_connection.py::TestConnection::test_dialect_3_1_1_not_require_signing PASSED                                                                                      [  4%]
tests/test_connection.py::TestConnection::test_dialect_implicit_require_signing PASSED                                                                                       [  4%]
tests/test_connection.py::TestConnection::test_verify_message_skip PASSED                                                                                                    [  4%]
tests/test_connection.py::TestConnection::test_broken_message_worker_closed_socket PASSED                                                                                    [  4%]
tests/test_connection.py::TestConnection::test_broken_message_worker_exception PASSED                                                                                        [  4%]
tests/test_connection.py::TestConnection::test_message_worker_timeout PASSED                                                                                                 [  4%]
tests/test_connection.py::TestConnection::test_message_worker_timeout_connection_dead PASSED                                                                                 [  4%]
tests/test_connection.py::TestConnection::test_verify_fail_no_session PASSED                                                                                                 [  5%]
tests/test_connection.py::TestConnection::test_verify_mistmatch PASSED                                                                                                       [  5%]
tests/test_connection.py::TestConnection::test_decrypt_invalid_flag PASSED                                                                                                   [  5%]
tests/test_connection.py::TestConnection::test_decrypt_invalid_session_id PASSED                                                                                             [  5%]
tests/test_connection.py::TestConnection::test_requested_credits_greater_than_available PASSED                                                                               [  5%]
tests/test_connection.py::TestConnection::test_send_invalid_tree_id PASSED                                                                                                   [  5%]
tests/test_connection.py::TestConnection::test_connection_echo PASSED                                                                                                        [  5%]
tests/test_connection.py::TestConnection::test_encrypt_ccm[AES128_CCM] PASSED                                                                                                [  5%]
tests/test_connection.py::TestConnection::test_encrypt_ccm[AES256_CCM] PASSED                                                                                                [  5%]
tests/test_connection.py::TestConnection::test_encrypt_gcm[AES128_CCM] PASSED                                                                                                [  5%]
tests/test_connection.py::TestConnection::test_encrypt_gcm[AES256_CCM] PASSED                                                                                                [  5%]
tests/test_connection.py::TestConnection::test_connection_echo_more PASSED                                                                                                   [  6%]
tests/test_connection.py::TestConnection::test_disconnect_wait_for_thread PASSED                                                                                             [  6%]
tests/test_connection.py::TestConnection::test_disconnect_already_disconnected PASSED                                                                                        [  6%]
tests/test_create_contexts.py::TestCreateContextName::test_get_response_known PASSED                                                                                         [  6%]
tests/test_create_contexts.py::TestCreateContextName::test_get_response_unknown PASSED                                                                                       [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_create_message PASSED                                                                                         [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_pack_multiple_raw_context PASSED                                                                              [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_pack_multiple_bad_message PASSED                                                                              [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_parse_message PASSED                                                                                          [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_get_context_data_known PASSED                                                                                 [  6%]
tests/test_create_contexts.py::TestSMB2CreateContextName::test_get_context_data_unknown PASSED                                                                               [  7%]
tests/test_create_contexts.py::TestSMB2CreateEABuffer::test_create_message PASSED                                                                                            [  7%]
tests/test_create_contexts.py::TestSMB2CreateEABuffer::test_parse_message PASSED                                                                                             [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleRequest::test_create_message PASSED                                                                                [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleRequest::test_parse_message PASSED                                                                                 [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleResponse::test_create_message PASSED                                                                               [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleResponse::test_parse_message PASSED                                                                                [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleReconnect::test_create_message PASSED                                                                              [  7%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleReconnect::test_parse_message PASSED                                                                               [  7%]
tests/test_create_contexts.py::TestSMB2CreateQueryMaximalAccessRequest::test_create_message PASSED                                                                           [  7%]
tests/test_create_contexts.py::TestSMB2CreateQueryMaximalAccessRequest::test_parse_message PASSED                                                                            [  8%]
tests/test_create_contexts.py::TestSMB2CreateQueryMaximalAccessResponse::test_create_message PASSED                                                                          [  8%]
tests/test_create_contexts.py::TestSMB2CreateQueryMaximalAccessResponse::test_parse_message PASSED                                                                           [  8%]
tests/test_create_contexts.py::TestSMB2CreateAllocationSize::test_create_message PASSED                                                                                      [  8%]
tests/test_create_contexts.py::TestSMB2CreateAllocationSize::test_parse_message PASSED                                                                                       [  8%]
tests/test_create_contexts.py::TestSMB2CreateTimewarpToken::test_create_message PASSED                                                                                       [  8%]
tests/test_create_contexts.py::TestSMB2CreateTimewarpToken::test_parse_message PASSED                                                                                        [  8%]
tests/test_create_contexts.py::TestSMB2CreateRequestLease::test_create_message PASSED                                                                                        [  8%]
tests/test_create_contexts.py::TestSMB2CreateRequestLease::test_parse_message PASSED                                                                                         [  8%]
tests/test_create_contexts.py::TestSMB2CreateResponseLease::test_create_message PASSED                                                                                       [  8%]
tests/test_create_contexts.py::TestSMB2CreateResponseLease::test_parse_message PASSED                                                                                        [  8%]
tests/test_create_contexts.py::TestSMB2CreateQueryOnDiskIDResponse::test_create_message PASSED                                                                               [  9%]
tests/test_create_contexts.py::TestSMB2CreateQueryOnDiskIDResponse::test_parse_message PASSED                                                                                [  9%]
tests/test_create_contexts.py::TestSMB2CreateRequestLeaseV2::test_create_message PASSED                                                                                      [  9%]
tests/test_create_contexts.py::TestSMB2CreateRequestLeaseV2::test_parse_message PASSED                                                                                       [  9%]
tests/test_create_contexts.py::TestSMB2CreateResponseLeaseV2::test_create_message PASSED                                                                                     [  9%]
tests/test_create_contexts.py::TestSMB2CreateResponseLeaseV2::test_parse_message PASSED                                                                                      [  9%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleRequestV2::test_create_message PASSED                                                                              [  9%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleRequestV2::test_parse_message PASSED                                                                               [  9%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleReconnectV2::test_create_message PASSED                                                                            [  9%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleReconnectV2::test_parse_message PASSED                                                                             [  9%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleResponseV2::test_create_message PASSED                                                                             [ 10%]
tests/test_create_contexts.py::TestSMB2CreateDurableHandleResponseV2::test_parse_message PASSED                                                                              [ 10%]
tests/test_create_contexts.py::TestSMB2CreateAppInstanceId::test_create_message PASSED                                                                                       [ 10%]
tests/test_create_contexts.py::TestSMB2CreateAppInstanceId::test_parse_message PASSED                                                                                        [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextRequest::test_create_message PASSED                                                                             [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextRequest::test_parse_message PASSED                                                                              [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextResponse::test_create_message PASSED                                                                            [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextResponse::test_parse_message PASSED                                                                             [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextV2Request::test_create_message PASSED                                                                           [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextV2Request::test_parse_message PASSED                                                                            [ 10%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextV2Response::test_create_message PASSED                                                                          [ 11%]
tests/test_create_contexts.py::TestSMB2SVHDXOpenDeviceContextV2Response::test_parse_message PASSED                                                                           [ 11%]
tests/test_create_contexts.py::TestSMB2CreateAppInstanceVersion::test_create_message PASSED                                                                                  [ 11%]
tests/test_create_contexts.py::TestSMB2CreateAppInstanceVersion::test_parse_message PASSED                                                                                   [ 11%]
tests/test_dfs.py::TestDomainEntry::test_domain_entry PASSED                                                                                                                 [ 11%]
tests/test_dfs.py::TestDomainEntry::test_process_dc_referral PASSED                                                                                                          [ 11%]
tests/test_dfs.py::TestDomainEntry::test_process_dc_referral_invalid_hint PASSED                                                                                             [ 11%]
tests/test_dfs.py::TestReferralEntry::test_root_referral_entry PASSED                                                                                                        [ 11%]
tests/test_dfs.py::TestReferralEntry::test_target_referral_entry PASSED                                                                                                      [ 11%]
tests/test_dfs.py::TestReferralEntry::test_target_referral_invalid_hint PASSED                                                                                               [ 11%]
tests/test_dfs.py::TestDFSReferralRequest::test_create_message PASSED                                                                                                        [ 11%]
tests/test_dfs.py::TestDFSReferralRequest::test_parse_message[] PASSED                                                                                                       [ 12%]
tests/test_dfs.py::TestDFSReferralRequest::test_parse_message[\x01\x02\x03\x04] PASSED                                                                                       [ 12%]
tests/test_dfs.py::TestDFSReferralRequestEx::test_create_message PASSED                                                                                                      [ 12%]
tests/test_dfs.py::TestDFSReferralRequestEx::test_parse_message[] PASSED                                                                                                     [ 12%]
tests/test_dfs.py::TestDFSReferralRequestEx::test_parse_message[\x01\x02\x03\x04] PASSED                                                                                     [ 12%]
tests/test_dfs.py::TestDFSReferralResponse::test_parse_message_v1 PASSED                                                                                                     [ 12%]
tests/test_dfs.py::TestDFSReferralResponse::test_parse_message_v2 PASSED                                                                                                     [ 12%]
tests/test_dfs.py::TestDFSReferralResponse::test_parse_message_v3_name_list_referral PASSED                                                                                  [ 12%]
tests/test_dfs.py::TestDFSReferralResponse::test_parse_message_v4 PASSED                                                                                                     [ 12%]
tests/test_exceptions.py::TestSMBException::test_exception PASSED                                                                                                            [ 12%]
tests/test_exceptions.py::TestSMBAuthenticationError::test_exception PASSED                                                                                                  [ 13%]
tests/test_exceptions.py::TestSMBAuthenticationError::test_caught_with_smbexception PASSED                                                                                   [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_error PASSED                                                                                                                  [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_error_with_filename2 PASSED                                                                                                   [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_caught_with_smbexception PASSED                                                                                               [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_caught_with_oserror PASSED                                                                                                    [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_error_with_unknown_error PASSED                                                                                               [ 13%]
tests/test_exceptions.py::TestSMBOSError::test_error_with_override PASSED                                                                                                    [ 13%]
tests/test_exceptions.py::TestSMBUnsupportedFeature::test_exception_needs_newer PASSED                                                                                       [ 13%]
tests/test_exceptions.py::TestSMBUnsupportedFeature::test_exception_needs_older PASSED                                                                                       [ 13%]
tests/test_exceptions.py::TestSMBUnsupportedFeature::test_exception_no_suffix PASSED                                                                                         [ 13%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_default_exception PASSED                                                                                      [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_low_disk PASSED                                                                                               [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_exception_without_header PASSED                                                                               [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_exception_with_symlink_redir PASSED                                                                           [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_exception_with_share_redir PASSED                                                                             [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_exception_with_raw_context PASSED                                                                             [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_throw_exception_with_multiple_contexts PASSED                                                                       [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_exception_no_context_but_data PASSED                                                                                [ 14%]
tests/test_exceptions.py::TestSMBResponseException::test_inherited_exception_no_code PASSED                                                                                  [ 14%]
tests/test_exceptions.py::TestSMB2ErrorResponse::test_create_message_plain PASSED                                                                                            [ 14%]
tests/test_exceptions.py::TestSMB2ErrorResponse::test_create_message_with_context PASSED                                                                                     [ 15%]
tests/test_exceptions.py::TestSMB2ErrorResponse::test_parse_message_plain PASSED                                                                                             [ 15%]
tests/test_exceptions.py::TestSMB2ErrorResponse::test_parse_message_with_context PASSED                                                                                      [ 15%]
tests/test_exceptions.py::TestSMB2ErrorContextResponse::test_create_message PASSED                                                                                           [ 15%]
tests/test_exceptions.py::TestSMB2ErrorContextResponse::test_parse_message PASSED                                                                                            [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_create_message PASSED                                                                                      [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_parse_message PASSED                                                                                       [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path[0-t\xe9st-t\xe9st-1-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\mylink-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\t\xe9st] PASSED [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path[0-..\\t\xe9st-..\\t\xe9st-1-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\mylink-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\t\xe9st] PASSED [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path[42-..\\t\xe9st-..\\t\xe9st-1-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\mylink\\some folder\\file.txt-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\t\xe9st\\some folder\\file.txt] PASSED [ 15%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path[0-\\??\\UNC\\s\xe9rver\\shar\xe9\\fold\xe9r\\test-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\test-0-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\mylink-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\test] PASSED [ 16%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path[42-\\??\\UNC\\s\xe9rver\\shar\xe9\\fold\xe9r\\test-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\test-0-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\subfolder\\mylink\\some folder\\file.txt-\\\\s\xe9rver\\shar\xe9\\fold\xe9r\\test\\some folder\\file.txt] PASSED [ 16%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path_local_fail PASSED                                                                             [ 16%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path_different_share PASSED                                                                        [ 16%]
tests/test_exceptions.py::TestSMB2SymbolicLinkErrorResponse::test_resolve_path_different_host PASSED                                                                         [ 16%]
tests/test_exceptions.py::TestSMB2ShareRedirectErrorContext::test_create_message PASSED                                                                                      [ 16%]
tests/test_exceptions.py::TestSMB2ShareRedirectErrorContext::test_parse_message PASSED                                                                                       [ 16%]
tests/test_exceptions.py::TestSMB2MoveDstIpAddrStructure::test_create_message_v4 PASSED                                                                                      [ 16%]
tests/test_exceptions.py::TestSMB2MoveDstIpAddrStructure::test_create_message_v6 PASSED                                                                                      [ 16%]
tests/test_exceptions.py::TestSMB2MoveDstIpAddrStructure::test_fail_invalid_ipv6_address PASSED                                                                              [ 16%]
tests/test_exceptions.py::TestSMB2MoveDstIpAddrStructure::test_parse_message_v4 PASSED                                                                                       [ 16%]
tests/test_exceptions.py::TestSMB2MoveDstIpAddrStructure::test_parse_message_v6 PASSED                                                                                       [ 17%]
tests/test_file_info.py::TestFileNameInformation::test_create_message PASSED                                                                                                 [ 17%]
tests/test_file_info.py::TestFileNameInformation::test_parse_message PASSED                                                                                                  [ 17%]
tests/test_file_info.py::TestFileAllInformation::test_create_message PASSED                                                                                                  [ 17%]
tests/test_file_info.py::TestFileAllInformation::test_parse_message PASSED                                                                                                   [ 17%]
tests/test_file_info.py::TestFileBothDirectoryInformation::test_create_message PASSED                                                                                        [ 17%]
tests/test_file_info.py::TestFileBothDirectoryInformation::test_parse_message PASSED                                                                                         [ 17%]
tests/test_file_info.py::TestFileDirectoryInformation::test_create_message PASSED                                                                                            [ 17%]
tests/test_file_info.py::TestFileDirectoryInformation::test_parse_message PASSED                                                                                             [ 17%]
tests/test_file_info.py::TestFileDispositionInformation::test_create_message PASSED                                                                                          [ 17%]
tests/test_file_info.py::TestFileDispositionInformation::test_parse_message PASSED                                                                                           [ 18%]
tests/test_file_info.py::TestFileEndOfFileInformation::test_create_message PASSED                                                                                            [ 18%]
tests/test_file_info.py::TestFileEndOfFileInformation::test_parse_message PASSED                                                                                             [ 18%]
tests/test_file_info.py::TestFileFullDirectoryInformation::test_create_message PASSED                                                                                        [ 18%]
tests/test_file_info.py::TestFileFullDirectoryInformation::test_parse_message PASSED                                                                                         [ 18%]
tests/test_file_info.py::TestFileFullEaInformation::test_create_message PASSED                                                                                               [ 18%]
tests/test_file_info.py::TestFileFullEaInformation::test_parse_message PASSED                                                                                                [ 18%]
tests/test_file_info.py::TestFileGetEaInformation::test_create_message PASSED                                                                                                [ 18%]
tests/test_file_info.py::TestFileGetEaInformation::test_parse_message PASSED                                                                                                 [ 18%]
tests/test_file_info.py::TestFileIdBothDirectoryInformation::test_create_message PASSED                                                                                      [ 18%]
tests/test_file_info.py::TestFileIdBothDirectoryInformation::test_parse_message PASSED                                                                                       [ 19%]
tests/test_file_info.py::TestFileIdFullDirectoryInformation::test_create_message PASSED                                                                                      [ 19%]
tests/test_file_info.py::TestFileIdFullDirectoryInformation::test_parse_message PASSED                                                                                       [ 19%]
tests/test_file_info.py::TestFileLinkInformation::test_create_message PASSED                                                                                                 [ 19%]
tests/test_file_info.py::TestFileLinkInformation::test_parse_message PASSED                                                                                                  [ 19%]
tests/test_file_info.py::TestFileNamesInformation::test_create_message PASSED                                                                                                [ 19%]
tests/test_file_info.py::TestFileNamesInformation::test_parse_message PASSED                                                                                                 [ 19%]
tests/test_file_info.py::TestFileRenameInformation::test_create_message PASSED                                                                                               [ 19%]
tests/test_file_info.py::TestFileRenameInformation::test_parse_message PASSED                                                                                                [ 19%]
tests/test_file_info.py::TestFileStandardInformation::test_create_message PASSED                                                                                             [ 19%]
tests/test_file_info.py::TestFileStandardInformation::test_parse_message PASSED                                                                                              [ 19%]
tests/test_file_info.py::TestFileFsObjectInformation::test_create_message PASSED                                                                                             [ 20%]
tests/test_file_info.py::TestFileFsObjectInformation::test_parse_message PASSED                                                                                              [ 20%]
tests/test_file_info.py::TestFileFsVolumeInformation::test_create_message PASSED                                                                                             [ 20%]
tests/test_file_info.py::TestFileFsVolumeInformation::test_parse_message PASSED                                                                                              [ 20%]
tests/test_file_info.py::TestFileFsFullSizeInformation::test_create_message PASSED                                                                                           [ 20%]
tests/test_file_info.py::TestFileFsFullSizeInformation::test_parse_message PASSED                                                                                            [ 20%]
tests/test_header.py::TestSMB2HeaderAsync::test_create_message PASSED                                                                                                        [ 20%]
tests/test_header.py::TestSMB2HeaderAsync::test_parse_message PASSED                                                                                                         [ 20%]
tests/test_header.py::TestSMB2HeaderRequest::test_create_message PASSED                                                                                                      [ 20%]
tests/test_header.py::TestSMB2HeaderRequest::test_parse_message PASSED                                                                                                       [ 20%]
tests/test_header.py::TestSMB2HeaderResponse::test_create_message PASSED                                                                                                     [ 21%]
tests/test_header.py::TestSMB2HeaderResponse::test_parse_message PASSED                                                                                                      [ 21%]
tests/test_ioctl.py::TestSMB2IOCTLRequest::test_create_message PASSED                                                                                                        [ 21%]
tests/test_ioctl.py::TestSMB2IOCTLRequest::test_create_message_no_buffer PASSED                                                                                              [ 21%]
tests/test_ioctl.py::TestSMB2IOCTLRequest::test_parse_message PASSED                                                                                                         [ 21%]
tests/test_ioctl.py::TestSMB2SrvCopyChunkCopy::test_create_message PASSED                                                                                                    [ 21%]
tests/test_ioctl.py::TestSMB2SrvCopyChunkCopy::test_parse_message PASSED                                                                                                     [ 21%]
tests/test_ioctl.py::TestSMB2SrvCopyChunk::test_create_message PASSED                                                                                                        [ 21%]
tests/test_ioctl.py::TestSMB2SrvCopyChunk::test_parse_message PASSED                                                                                                         [ 21%]
tests/test_ioctl.py::TestSMB2SrcReadHashRequest::test_create_message PASSED                                                                                                  [ 21%]
tests/test_ioctl.py::TestSMB2SrcReadHashRequest::test_parse_message PASSED                                                                                                   [ 22%]
tests/test_ioctl.py::TestSMB2SrvNetworkResiliencyRequest::test_create_message PASSED                                                                                         [ 22%]
tests/test_ioctl.py::TestSMB2SrvNetworkResiliencyRequest::test_parse_message PASSED                                                                                          [ 22%]
tests/test_ioctl.py::TestSMB2ValidateNegotiateInfoRequest::test_create_message PASSED                                                                                        [ 22%]
tests/test_ioctl.py::TestSMB2ValidateNegotiateInfoRequest::test_parse_message PASSED                                                                                         [ 22%]
tests/test_ioctl.py::TestSMB2IOCTLResponse::test_create_message PASSED                                                                                                       [ 22%]
tests/test_ioctl.py::TestSMB2IOCTLResponse::test_parse_message PASSED                                                                                                        [ 22%]
tests/test_ioctl.py::TestSMB2SrvCopyChunkResponse::test_create_message PASSED                                                                                                [ 22%]
tests/test_ioctl.py::TestSMB2SrvCopyChunkResponse::test_parse_message PASSED                                                                                                 [ 22%]
tests/test_ioctl.py::TestSMB2SrvSnapshotArray::test_create_message PASSED                                                                                                    [ 22%]
tests/test_ioctl.py::TestSMB2SrvSnapshotArray::test_parse_message PASSED                                                                                                     [ 22%]
tests/test_ioctl.py::TestSMB2SrvRequestResumeKey::test_create_message PASSED                                                                                                 [ 23%]
tests/test_ioctl.py::TestSMB2SrvRequestResumeKey::test_parse_message PASSED                                                                                                  [ 23%]
tests/test_ioctl.py::TestSMB2NetworkInterfaceInfo::test_create_message PASSED                                                                                                [ 23%]
tests/test_ioctl.py::TestSMB2NetworkInterfaceInfo::test_parse_message PASSED                                                                                                 [ 23%]
tests/test_ioctl.py::TestSockAddrStorage::test_create_message_ipv4 PASSED                                                                                                    [ 23%]
tests/test_ioctl.py::TestSockAddrStorage::test_create_message_ipv6 PASSED                                                                                                    [ 23%]
tests/test_ioctl.py::TestSockAddrStorage::test_parse_message_ipv4 PASSED                                                                                                     [ 23%]
tests/test_ioctl.py::TestSockAddrStorage::test_parse_message_ipv6 PASSED                                                                                                     [ 23%]
tests/test_ioctl.py::TestSockAddrIn::test_create_message PASSED                                                                                                              [ 23%]
tests/test_ioctl.py::TestSockAddrIn::test_create_message_subnet PASSED                                                                                                       [ 23%]
tests/test_ioctl.py::TestSockAddrIn::test_parse_message PASSED                                                                                                               [ 24%]
tests/test_ioctl.py::TestSockAddrIn6::test_create_message PASSED                                                                                                             [ 24%]
tests/test_ioctl.py::TestSockAddrIn6::test_set_ipaddress_invalid_format PASSED                                                                                               [ 24%]
tests/test_ioctl.py::TestSockAddrIn6::test_parse_message PASSED                                                                                                              [ 24%]
tests/test_ioctl.py::TestSMB2ValidateNegotiateInfoResponse::test_create_message PASSED                                                                                       [ 24%]
tests/test_ioctl.py::TestSMB2ValidateNegotiateInfoResponse::test_parse_message PASSED                                                                                        [ 24%]
tests/test_open.py::TestSMB2CreateRequest::test_create_message PASSED                                                                                                        [ 24%]
tests/test_open.py::TestSMB2CreateRequest::test_create_message_no_contexts PASSED                                                                                            [ 24%]
tests/test_open.py::TestSMB2CreateRequest::test_parse_message PASSED                                                                                                         [ 24%]
tests/test_open.py::TestSMB2CreateRequest::test_parse_message_no_contexts PASSED                                                                                             [ 24%]
tests/test_open.py::TestSMB2CreateResponse::test_create_message PASSED                                                                                                       [ 25%]
tests/test_open.py::TestSMB2CreateResponse::test_create_message_no_contexts PASSED                                                                                           [ 25%]
tests/test_open.py::TestSMB2CreateResponse::test_parse_message PASSED                                                                                                        [ 25%]
tests/test_open.py::TestSMB2CreateResponse::test_parse_message_no_contexts PASSED                                                                                            [ 25%]
tests/test_open.py::TestSMB2CloseRequest::test_create_message PASSED                                                                                                         [ 25%]
tests/test_open.py::TestSMB2CloseRequest::test_parse_message PASSED                                                                                                          [ 25%]
tests/test_open.py::TestSMB2CloseResponse::test_create_message PASSED                                                                                                        [ 25%]
tests/test_open.py::TestSMB2CloseResponse::test_parse_message PASSED                                                                                                         [ 25%]
tests/test_open.py::TestSMB2FlushRequest::test_create_message PASSED                                                                                                         [ 25%]
tests/test_open.py::TestSMB2FlushRequest::test_parse_message PASSED                                                                                                          [ 25%]
tests/test_open.py::TestSMB2FlushResponse::test_create_message PASSED                                                                                                        [ 25%]
tests/test_open.py::TestSMB2FlushResponse::test_parse_message PASSED                                                                                                         [ 26%]
tests/test_open.py::TestSMB2ReadRequest::test_create_message PASSED                                                                                                          [ 26%]
tests/test_open.py::TestSMB2ReadRequest::test_create_message_channel_info PASSED                                                                                             [ 26%]
tests/test_open.py::TestSMB2ReadRequest::test_parse_message PASSED                                                                                                           [ 26%]
tests/test_open.py::TestSMB2ReadRequest::test_parse_message_channel_info PASSED                                                                                              [ 26%]
tests/test_open.py::TestSMB2ReadResponse::test_create_message PASSED                                                                                                         [ 26%]
tests/test_open.py::TestSMB2ReadResponse::test_parse_message PASSED                                                                                                          [ 26%]
tests/test_open.py::TestSMB2WriteRequest::test_create_message PASSED                                                                                                         [ 26%]
tests/test_open.py::TestSMB2WriteRequest::test_create_message_channel_info PASSED                                                                                            [ 26%]
tests/test_open.py::TestSMB2WriteRequest::test_parse_message PASSED                                                                                                          [ 26%]
tests/test_open.py::TestSMB2WriteRequest::test_parse_message_channel_info PASSED                                                                                             [ 27%]
tests/test_open.py::TestSMB2WriteResponse::test_create_message PASSED                                                                                                        [ 27%]
tests/test_open.py::TestSMB2WriteResponse::test_parse_message PASSED                                                                                                         [ 27%]
tests/test_open.py::TestSMB2QueryDirectoryRequest::test_create_message PASSED                                                                                                [ 27%]
tests/test_open.py::TestSMB2QueryDirectoryRequest::test_parse_message PASSED                                                                                                 [ 27%]
tests/test_open.py::TestSMB2QueryDirectoryResponse::test_create_message PASSED                                                                                               [ 27%]
tests/test_open.py::TestSMB2QueryDirectoryResponse::test_parse_message PASSED                                                                                                [ 27%]
tests/test_open.py::TestSMB2QueryInfoRequest::test_create_message PASSED                                                                                                     [ 27%]
tests/test_open.py::TestSMB2QueryInfoRequest::test_parse_message PASSED                                                                                                      [ 27%]
tests/test_open.py::TestSMB2QueryInfoResponse::test_create_message PASSED                                                                                                    [ 27%]
tests/test_open.py::TestSMB2QueryInfoResponse::test_parse_message PASSED                                                                                                     [ 27%]
tests/test_open.py::TestSMB2QueryInfoResponse::test_unpack_multiple_ea_response PASSED                                                                                       [ 28%]
tests/test_open.py::TestSMB2SetInfoRequest::test_create_message PASSED                                                                                                       [ 28%]
tests/test_open.py::TestSMB2SetInfoRequest::test_parse_message PASSED                                                                                                        [ 28%]
tests/test_open.py::TestSMB2SetInfoResponse::test_create_message PASSED                                                                                                      [ 28%]
tests/test_open.py::TestSMB2SetInfoResponse::test_parse_message PASSED                                                                                                       [ 28%]
tests/test_open.py::TestOpen::test_dialect_2_0_2 FAILED                                                                                                                      [ 28%]
tests/test_open.py::TestOpen::test_dialect_2_1_0 FAILED                                                                                                                      [ 28%]
tests/test_open.py::TestOpen::test_dialect_3_0_0 FAILED                                                                                                                      [ 28%]
tests/test_open.py::TestOpen::test_dialect_3_0_2 FAILED                                                                                                                      [ 28%]
tests/test_open.py::TestOpen::test_dialect_3_1_1 FAILED                                                                                                                      [ 28%]
tests/test_open.py::TestOpen::test_open_root_directory FAILED                                                                                                                [ 29%]
tests/test_open.py::TestOpen::test_create_directory FAILED                                                                                                                   [ 29%]
tests/test_open.py::TestOpen::test_create_file_create_contexts FAILED                                                                                                        [ 29%]
tests/test_open.py::TestOpen::test_create_file_with_lease[v1] FAILED                                                                                                         [ 29%]
tests/test_open.py::TestOpen::test_create_file_with_lease[v2] FAILED                                                                                                         [ 29%]
tests/test_open.py::TestOpen::test_create_read_write_from_file FAILED                                                                                                        [ 29%]
tests/test_open.py::TestOpen::test_flush_file FAILED                                                                                                                         [ 29%]
tests/test_open.py::TestOpen::test_close_file_dont_get_attributes FAILED                                                                                                     [ 29%]
tests/test_open.py::TestOpen::test_close_file_get_attributes FAILED                                                                                                          [ 29%]
tests/test_open.py::TestOpen::test_read_file_unbuffered FAILED                                                                                                               [ 29%]
tests/test_open.py::TestOpen::test_read_file_unbuffered_unsupported FAILED                                                                                                   [ 30%]
tests/test_open.py::TestOpen::test_write_file_write_through FAILED                                                                                                           [ 30%]
tests/test_open.py::TestOpen::test_write_file_write_through_unsupported FAILED                                                                                               [ 30%]
tests/test_open.py::TestOpen::test_write_file_unbuffered FAILED                                                                                                              [ 30%]
tests/test_open.py::TestOpen::test_write_file_unbuffered_unsupported FAILED                                                                                                  [ 30%]
tests/test_open.py::TestOpen::test_query_directory FAILED                                                                                                                    [ 30%]
tests/test_open.py::TestOpen::test_compounding_related_opens_encrypted FAILED                                                                                                [ 30%]
tests/test_open.py::TestOpen::test_compounding_related_opens_signed FAILED                                                                                                   [ 30%]
tests/test_open.py::TestOpen::test_compounding_open_requests FAILED                                                                                                          [ 30%]
tests/test_open.py::TestOpen::test_compounding_open_requests_unencrypted FAILED                                                                                              [ 30%]
tests/test_open.py::TestOpen::test_close_file_already_closed FAILED                                                                                                          [ 30%]
tests/test_open.py::TestOpen::test_read_greater_than_max_size FAILED                                                                                                         [ 31%]
tests/test_open.py::TestOpen::test_write_greater_than_max_size FAILED                                                                                                        [ 31%]
tests/test_open.py::TestOpen::test_read_file_multi_credits FAILED                                                                                                            [ 31%]
tests/test_open.py::TestOpen::test_receive_with_timeout FAILED                                                                                                               [ 31%]
tests/test_open.py::TestOpen::test_close_file_invalid_id FAILED                                                                                                              [ 31%]
tests/test_open.py::TestOpen::test_truncate_file FAILED                                                                                                                      [ 31%]
tests/test_query_info.py::test_query_info_deprecation PASSED                                                                                                                 [ 31%]
tests/test_reparse_point.py::TestReparseTags::test_tag_is_microsoft PASSED                                                                                                   [ 31%]
tests/test_reparse_point.py::TestReparseTags::test_tag_is_name_surrogate PASSED                                                                                              [ 31%]
tests/test_reparse_point.py::TestReparseTags::test_tag_is_directory PASSED                                                                                                   [ 31%]
tests/test_reparse_point.py::TestReparseDataBuffer::test_create_message PASSED                                                                                               [ 32%]
tests/test_reparse_point.py::TestReparseDataBuffer::test_parse_message PASSED                                                                                                [ 32%]
tests/test_reparse_point.py::TestSymbolicLinkReparseDataBuffer::test_create_message PASSED                                                                                   [ 32%]
tests/test_reparse_point.py::TestSymbolicLinkReparseDataBuffer::test_create_message_with_set_name PASSED                                                                     [ 32%]
tests/test_reparse_point.py::TestSymbolicLinkReparseDataBuffer::test_parse_message PASSED                                                                                    [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_create_message PASSED                                                                                                 [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_create_domain_sid PASSED                                                                                              [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_parse_string_fail_no_s PASSED                                                                                         [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_parse_string_fail_too_small PASSED                                                                                    [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_parse_message PASSED                                                                                                  [ 32%]
tests/test_security_descriptor.py::TestSIDPacket::test_parse_message_domain_sid PASSED                                                                                       [ 33%]
tests/test_security_descriptor.py::TestAccessAllowedAce::test_create_message PASSED                                                                                          [ 33%]
tests/test_security_descriptor.py::TestAccessAllowedAce::test_parse_message PASSED                                                                                           [ 33%]
tests/test_security_descriptor.py::TestAccessDeniedAce::test_create_message PASSED                                                                                           [ 33%]
tests/test_security_descriptor.py::TestAccessDeniedAce::test_parse_message PASSED                                                                                            [ 33%]
tests/test_security_descriptor.py::TestSystemAuditAce::test_create_message PASSED                                                                                            [ 33%]
tests/test_security_descriptor.py::TestSystemAuditAce::test_parse_message PASSED                                                                                             [ 33%]
tests/test_security_descriptor.py::TestAclPacket::test_create_message PASSED                                                                                                 [ 33%]
tests/test_security_descriptor.py::TestAclPacket::test_parse_message PASSED                                                                                                  [ 33%]
tests/test_security_descriptor.py::TestSMB2SDBuffer::test_create_message PASSED                                                                                              [ 33%]
tests/test_security_descriptor.py::TestSMB2SDBuffer::test_create_message_sacl_group PASSED                                                                                   [ 33%]
tests/test_security_descriptor.py::TestSMB2SDBuffer::test_parse_message_sacl_group PASSED                                                                                    [ 34%]
tests/test_security_descriptor.py::TestSMB2SDBuffer::test_parse_message PASSED                                                                                               [ 34%]
tests/test_security_descriptor.py::TestSMB2SDBuffer::test_parse_acl_respect_ace_count PASSED                                                                                 [ 34%]
tests/test_session.py::TestSMB2SessionSetupRequest::test_create_message PASSED                                                                                               [ 34%]
tests/test_session.py::TestSMB2SessionSetupRequest::test_parse_message PASSED                                                                                                [ 34%]
tests/test_session.py::TestSMB2SessionSetupResponse::test_create_message PASSED                                                                                              [ 34%]
tests/test_session.py::TestSMB2SessionSetupResponse::test_parse_message PASSED                                                                                               [ 34%]
tests/test_session.py::TestSMB2Logoff::test_create_message PASSED                                                                                                            [ 34%]
tests/test_session.py::TestSMB2Logoff::test_parse_message PASSED                                                                                                             [ 34%]
tests/test_session.py::TestSession::test_dialect_2_0_2 PASSED                                                                                                                [ 34%]
tests/test_session.py::TestSession::test_dialect_2_1_0 PASSED                                                                                                                [ 35%]
tests/test_session.py::TestSession::test_dialect_3_0_0 PASSED                                                                                                                [ 35%]
tests/test_session.py::TestSession::test_dialect_3_0_2 PASSED                                                                                                                [ 35%]
tests/test_session.py::TestSession::test_dialect_3_1_1 PASSED                                                                                                                [ 35%]
tests/test_session.py::TestSession::test_require_encryption PASSED                                                                                                           [ 35%]
tests/test_session.py::TestSession::test_require_encryption_not_supported PASSED                                                                                             [ 35%]
tests/test_session.py::TestSession::test_connect_fail PASSED                                                                                                                 [ 35%]
tests/test_session.py::TestSession::test_setup_session_with_ms_gss_token PASSED                                                                                              [ 35%]
tests/test_session.py::TestSession::test_setup_session_with_ntlm_only PASSED                                                                                                 [ 35%]
tests/test_smbclient_os.py::test_open_bad_path[\\\\only_server] PASSED                                                                                                       [ 35%]
tests/test_smbclient_os.py::test_open_bad_path[\\\\server_slash\\] PASSED                                                                                                    [ 36%]
tests/test_smbclient_os.py::test_reset_connection[share] ERROR                                                                                                               [ 36%]
tests/test_smbclient_os.py::test_reset_connection[share-encrypted] ERROR                                                                                                     [ 36%]
tests/test_smbclient_os.py::test_delete_session[share] ERROR                                                                                                                 [ 36%]
tests/test_smbclient_os.py::test_delete_session[share-encrypted] ERROR                                                                                                       [ 36%]
tests/test_smbclient_os.py::test_copy_across_paths_raises[share] ERROR                                                                                                       [ 36%]
tests/test_smbclient_os.py::test_copy_across_paths_raises[share-encrypted] ERROR                                                                                             [ 36%]
tests/test_smbclient_os.py::test_copyfile_src_not_unc PASSED                                                                                                                 [ 36%]
tests/test_smbclient_os.py::test_copyfile_dst_not_unc PASSED                                                                                                                 [ 36%]
tests/test_smbclient_os.py::test_server_side_copy_multiple_chunks[share] ERROR                                                                                               [ 36%]
tests/test_smbclient_os.py::test_server_side_copy_multiple_chunks[share-encrypted] ERROR                                                                                     [ 36%]
tests/test_smbclient_os.py::test_write_large_bytes[share] ERROR                                                                                                              [ 37%]
tests/test_smbclient_os.py::test_write_large_bytes[share-encrypted] ERROR                                                                                                    [ 37%]
tests/test_smbclient_os.py::test_write_large_text[share] ERROR                                                                                                               [ 37%]
tests/test_smbclient_os.py::test_write_large_text[share-encrypted] ERROR                                                                                                     [ 37%]
tests/test_smbclient_os.py::test_server_side_copy_large_file[share] ERROR                                                                                                    [ 37%]
tests/test_smbclient_os.py::test_server_side_copy_large_file[share-encrypted] ERROR                                                                                          [ 37%]
tests/test_smbclient_os.py::test_link_relative_path_fail[share] ERROR                                                                                                        [ 37%]
tests/test_smbclient_os.py::test_link_relative_path_fail[share-encrypted] ERROR                                                                                              [ 37%]
tests/test_smbclient_os.py::test_link_different_root_fail[share] ERROR                                                                                                       [ 37%]
tests/test_smbclient_os.py::test_link_different_root_fail[share-encrypted] ERROR                                                                                             [ 37%]
tests/test_smbclient_os.py::test_link_dir_fail[share] ERROR                                                                                                                  [ 38%]
tests/test_smbclient_os.py::test_link_dir_fail[share-encrypted] ERROR                                                                                                        [ 38%]
tests/test_smbclient_os.py::test_link_existing_file_failed[share] ERROR                                                                                                      [ 38%]
tests/test_smbclient_os.py::test_link_existing_file_failed[share-encrypted] ERROR                                                                                            [ 38%]
tests/test_smbclient_os.py::test_link_missing_src_fail[share] ERROR                                                                                                          [ 38%]
tests/test_smbclient_os.py::test_link_missing_src_fail[share-encrypted] ERROR                                                                                                [ 38%]
tests/test_smbclient_os.py::test_link_to_file[share] ERROR                                                                                                                   [ 38%]
tests/test_smbclient_os.py::test_link_to_file[share-encrypted] ERROR                                                                                                         [ 38%]
tests/test_smbclient_os.py::test_link_to_symbolic_link_follows[share] SKIPPED (cannot create symlinks on Samba)                                                              [ 38%]
tests/test_smbclient_os.py::test_link_to_symbolic_link_follows[share-encrypted] SKIPPED (cannot create symlinks on Samba)                                                    [ 38%]
tests/test_smbclient_os.py::test_link_to_symbolic_link_not_follows[share] SKIPPED (cannot create symlinks on Samba)                                                          [ 38%]
tests/test_smbclient_os.py::test_link_to_symbolic_link_not_follows[share-encrypted] SKIPPED (cannot create symlinks on Samba)                                                [ 39%]
tests/test_smbclient_os.py::test_listdir_missing[share-missing-0xc0000034] ERROR                                                                                             [ 39%]
tests/test_smbclient_os.py::test_listdir_missing[share-missing\\missing_sub-0xc000003a] ERROR                                                                                [ 39%]
tests/test_smbclient_os.py::test_listdir_missing[share-encrypted-missing-0xc0000034] ERROR                                                                                   [ 39%]
tests/test_smbclient_os.py::test_listdir_missing[share-encrypted-missing\\missing_sub-0xc000003a] ERROR                                                                      [ 39%]
tests/test_smbclient_os.py::test_listdir_file_fail[share] ERROR                                                                                                              [ 39%]
tests/test_smbclient_os.py::test_listdir_file_fail[share-encrypted] ERROR                                                                                                    [ 39%]
tests/test_smbclient_os.py::test_listdir[share-dirname0] ERROR                                                                                                               [ 39%]
tests/test_smbclient_os.py::test_listdir[share-dirname1] ERROR                                                                                                               [ 39%]
tests/test_smbclient_os.py::test_listdir[share-encrypted-dirname0] ERROR                                                                                                     [ 39%]
tests/test_smbclient_os.py::test_listdir[share-encrypted-dirname1] ERROR                                                                                                     [ 40%]
tests/test_smbclient_os.py::test_listdir_with_pattern[share] ERROR                                                                                                           [ 40%]
tests/test_smbclient_os.py::test_listdir_with_pattern[share-encrypted] ERROR                                                                                                 [ 40%]
tests/test_smbclient_os.py::test_listdir_with_pattern_no_match[share] ERROR                                                                                                  [ 40%]
tests/test_smbclient_os.py::test_listdir_with_pattern_no_match[share-encrypted] ERROR                                                                                        [ 40%]
tests/test_smbclient_os.py::test_lstat_on_file[share] ERROR                                                                                                                  [ 40%]
tests/test_smbclient_os.py::test_lstat_on_file[share-encrypted] ERROR                                                                                                        [ 40%]
tests/test_smbclient_os.py::test_lstat_on_dir[share] ERROR                                                                                                                   [ 40%]
tests/test_smbclient_os.py::test_lstat_on_dir[share-encrypted] ERROR                                                                                                         [ 40%]
tests/test_smbclient_os.py::test_lstat_on_symlink_file[share] SKIPPED (cannot create symlinks on Samba)                                                                      [ 40%]
tests/test_smbclient_os.py::test_lstat_on_symlink_file[share-encrypted] SKIPPED (cannot create symlinks on Samba)        
[...]
ERROR tests/test_smbclient_shutil.py::test_rmtree_as_file[share-encrypted] - smbprotocol.exceptions.NotFound: Received unexpected status from the server: The object was not found. (3221226021) STATUS_NOT_FOUND: 0xc0000225
============================================================= 42 failed, 562 passed, 132 skipped, 300 errors in 44.02s =============================================================

I am probably still misconfiguring something ... The credentials work with smbclient (and anonymous login also works, so they shouldn't even be necessary).

Your linked test_dialect_3_1_1_not_require_signing test shows up as PASSED.

@jborean93
Copy link
Owner

jborean93 commented Oct 6, 2024

Potentially Samba is adding another check on the tree to not allow tree connects without signing. I'll have to try and set up a test environment to try this out to see what is happening here.

Edit: This actually shouldn't matter, require_signing=False doesn't disable signing, it just allows the client to connect to a server where signing is not available.

@sec13b
Copy link

sec13b commented Oct 8, 2024

sudo apt install samba
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.old
sudo nano /etc/samba/smb.conf

[visualstudio]
path = /home/kali/data
browseable = yes
read only = no

sudo smbpasswd -a kali

sudo systemctl start smbd
sudo systemctl start nmbd

mkdir /home/kali/data
chmod -R 777 /home/kali/data

@jborean93
Copy link
Owner

Ok I was wrong, the require_signing kwarg does control whether the client will sign the data or not. When enabling the debug logs you can see the Samba is rejecting the tree connect with

smbd_smb2_tree_connect: reject request to share [test] as '6380EEC6753A\sambauser' without encryption or signing. Disconnecting.
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_tcon.c:151
Server exit (NT_STATUS_END_OF_FILE)

It looks like Samba requires either signing or encryption to be used when the dialect is SMB 3.11 or greater. The check for this is at https://github.com/samba-team/samba/blame/9ad287ed9c4a06c34db4e6431e5845ffd2100e2a/source3/smbd/smb2_tcon.c#L240-L253 and doesn't seem to be controllable. While the kwarg name is poorly named it's not something I can change at this point in time and Samba requires signing or encryption for non-guest sessions. Without it you'll see this failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants