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

MechanismList MIC has incorrect type #13

Closed
softworkz opened this issue Dec 21, 2018 · 4 comments
Closed

MechanismList MIC has incorrect type #13

softworkz opened this issue Dec 21, 2018 · 4 comments

Comments

@softworkz
Copy link

Hi,

first - thank you very much for publishing this interesting library.

I'm trying to use this library for client access using the code from issue #9.

I tried to connect to

  • a Linux machine with Samba (Smb2Client)
  • a Windows 2003 Server/PDC in a Domain (Smb1Client)
  • a windows 2016 Server in another Domain (Smb2Client)

I'm always ending up here:

In all cases, the tag is not DerEncodingTag.ByteArray but DerEncodingTag.Sequence instead.

I can't imagine an explanation for this. It's really weird that it happens in all 3 cases. These cases are different otherwise (different buffer length, different parsed mechanisms).

When I ignore the exception, all subsequent operations against the Samba machine are successful (but there's guest access enabled), but not for the Windows servers...

Any ideas?

@TalAloni
Copy link
Owner

Please try changing line 74 in SimpleProtectedNegotiationToken.cs from:

return new SimpleProtectedNegotiationTokenInit(tokenBytes, offset);

to

return new SimpleProtectedNegotiationTokenInit2(tokenBytes, offset);

@softworkz
Copy link
Author

Thanks for the quick response.
That part is solved.

But right for the next step, I'm experiencing odd behavior again:

Smb1Client.Login always returns success, no matter if credentials are right or wrong.
Then I'm calling Smb1Client.ListShares()

  • If credentials were incorrect, I get a list of shares
  • If credentials were correct, ListShares returns ACCESS_DENIED
    (sic!)

Smb1Client.TreeConnect() always returns ACCESS_DENIED.

@TalAloni
Copy link
Owner

You're going to have to dig a little deeper,
Is the server returning 'STATUS_SUCCESS' when the credentials are incorrect? if so, this is an issue with the server.
Does the user have access to the share?
Try to check with a different client to verify if the issue is indeed with the SMBLibrary client. and if it is, try to find what (and where) the issue is exactly.

@TalAloni
Copy link
Owner

My latest commit should have fixed the original issue that you reported.
please test and let me know if there are any additional issues.
please open a separate issue for each issue you encounter.

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

2 participants