mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-26 10:48:15 +02:00
IndependentNTLMAuthenticationProvider: Workaround for NTLMv2 with LmChallengeResponse length of 0 bytes
This commit is contained in:
parent
efce34f5d6
commit
af50099f22
1 changed files with 8 additions and 4 deletions
|
@ -300,6 +300,9 @@ namespace SMBLibrary.Authentication.NTLM
|
||||||
/// LM v2 / NTLM v2
|
/// LM v2 / NTLM v2
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool AuthenticateV2(string domainName, string accountName, string password, byte[] serverChallenge, byte[] lmResponse, byte[] ntResponse)
|
private bool AuthenticateV2(string domainName, string accountName, string password, byte[] serverChallenge, byte[] lmResponse, byte[] ntResponse)
|
||||||
|
{
|
||||||
|
// Note: Linux CIFS VFS 3.10 will send LmChallengeResponse with length of 0 bytes
|
||||||
|
if (lmResponse.Length == 24)
|
||||||
{
|
{
|
||||||
byte[] _LMv2ClientChallenge = ByteReader.ReadBytes(lmResponse, 16, 8);
|
byte[] _LMv2ClientChallenge = ByteReader.ReadBytes(lmResponse, 16, 8);
|
||||||
byte[] expectedLMv2Response = NTLMCryptography.ComputeLMv2Response(serverChallenge, _LMv2ClientChallenge, password, accountName, domainName);
|
byte[] expectedLMv2Response = NTLMCryptography.ComputeLMv2Response(serverChallenge, _LMv2ClientChallenge, password, accountName, domainName);
|
||||||
|
@ -307,6 +310,7 @@ namespace SMBLibrary.Authentication.NTLM
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (AuthenticationMessageUtils.IsNTLMv2NTResponse(ntResponse))
|
if (AuthenticationMessageUtils.IsNTLMv2NTResponse(ntResponse))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue