SMBLibrary域登录始终返回STATUS_LOGON_FAILURE错误求助
AD域环境下SMBLibrary登录返回STATUS_LOGON_FAILURE问题求助
- 已耗时数月排查该问题,使用SMBLibrary进行AD域登录时始终返回
STATUS_LOGON_FAILURE错误,凭证正确且时间戳设置准确 - 非AD登录场景(仅使用用户名密码)可正常登录并列出共享目录
- 已执行的排查操作:修复时间戳同步问题、更换不同AD测试环境、在多台设备上验证凭证与代码有效性,可提供抓包(pcap)及事件日志文件
使用的测试代码如下:
using SMBLibrary.Client; using SMBLibrary; using System.Net; class test { static void Main() { SMB2Client client = new SMB2Client(); // SMB2Client can be used as well bool isConnected = client.Connect(IPAddress.Parse("10.10.254.242"), SMBTransportType.DirectTCPTransport); if (isConnected) { NTStatus status = client.Login("lab.enterprise.thm", "nik", "ToastyBoi!",AuthenticationMethod.NTLMv2); if (status == NTStatus.STATUS_SUCCESS) { List<string> shares = client.ListShares(out status); foreach (var share in shares) { Console.WriteLine(share); } client.Logoff(); } else { Console.WriteLine(status.ToString()); } client.Disconnect(); } } }
相关问题已在SMBLibrary的GitHub仓库提交Issue(编号259)
内容的提问来源于stack exchange,提问作者mesut yıldırım
相关产品推荐
相关产品推荐

