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

Login issue with empty domain name #71

Open
witjon opened this issue Jan 24, 2023 · 1 comment
Open

Login issue with empty domain name #71

witjon opened this issue Jan 24, 2023 · 1 comment

Comments

@witjon
Copy link

witjon commented Jan 24, 2023

I need to login to a SMB server that requires a empty domain. By default, go-smb2 fetches a default domain name from the network. So I tried:

Initiator: &smb2.NTLMInitiator{
	User: "user",
	Domain: "",
	Password: "secret",
	Workstation: "",
},

However, this still uses a default domain name. I tried various values, like nil, \ etc. but none of them work. go-smb2 always prefixes the \ string with an additional \ so setting Domain to "\\" (remember to escape the \) results in a \\ in the login string. Samba's smbclient works for me.

I can verify this behaviour in Wireshark. Here are the relevant parts of the NTLMSSP_AUTH frames:

Samba:

 Session Id: 0x000 Acct:user Domain: Host:
    [Account: user]
    [Domain: ]
    [Host: ]
    [Authenticated in Frame: 000]

\user is used as full authentication string, access granted.

go-smb2 (with Domain: "\\"):

Session Id: 0x000 Acct:user Domain:\ Host:
    [Account: user]
    [Domain: \]
    [Host: ]
    [Authenticated in Frame: 000]

\\user is used as full authentication string, access denied.

It seems that there is no way to set an empty Domain in go-smb2.

@ozanh
Copy link

ozanh commented May 3, 2023

Is there any update about this issue @witjon ? I solved an issue that may be related to this issue by setting SAMBA to the domain field.

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