NTLM: NegotiateFlags: Renamed LanManagerKey to LanManagerSessionKey

This commit is contained in:
Tal Aloni 2017-09-02 10:40:37 +03:00
parent 46d5aa2982
commit f973e56d25
5 changed files with 10 additions and 10 deletions

View file

@ -210,7 +210,7 @@ namespace SMBLibrary.Authentication.NTLM
{ {
if ((negotiateFlags & NegotiateFlags.ExtendedSessionSecurity) == 0) if ((negotiateFlags & NegotiateFlags.ExtendedSessionSecurity) == 0)
{ {
if ((negotiateFlags & NegotiateFlags.LanManagerKey) > 0) if ((negotiateFlags & NegotiateFlags.LanManagerSessionKey) > 0)
{ {
byte[] k1 = ByteReader.ReadBytes(lmowf, 0, 7); byte[] k1 = ByteReader.ReadBytes(lmowf, 0, 7);
byte[] k2 = ByteUtils.Concatenate(ByteReader.ReadBytes(lmowf, 7, 1), new byte[] { 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD }); byte[] k2 = ByteUtils.Concatenate(ByteReader.ReadBytes(lmowf, 7, 1), new byte[] { 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD });

View file

@ -78,9 +78,9 @@ namespace SMBLibrary.Authentication.NTLM
{ {
challengeMessage.NegotiateFlags |= NegotiateFlags.ExtendedSessionSecurity; challengeMessage.NegotiateFlags |= NegotiateFlags.ExtendedSessionSecurity;
} }
else if ((negotiateMessage.NegotiateFlags & NegotiateFlags.LanManagerKey) > 0) else if ((negotiateMessage.NegotiateFlags & NegotiateFlags.LanManagerSessionKey) > 0)
{ {
challengeMessage.NegotiateFlags |= NegotiateFlags.LanManagerKey; challengeMessage.NegotiateFlags |= NegotiateFlags.LanManagerSessionKey;
} }
if ((negotiateMessage.NegotiateFlags & NegotiateFlags.Sign) > 0) if ((negotiateMessage.NegotiateFlags & NegotiateFlags.Sign) > 0)

View file

@ -13,10 +13,10 @@ namespace SMBLibrary.Authentication.NTLM
Datagram = 0x00000040, // NTLMSSP_NEGOTIATE_DATAGRAM Datagram = 0x00000040, // NTLMSSP_NEGOTIATE_DATAGRAM
/// <summary> /// <summary>
/// LanManagerKey and ExtendedSessionSecurity are mutually exclusive /// LanManagerSessionKey and ExtendedSessionSecurity are mutually exclusive
/// If both are set then LanManagerKey must be ignored /// If both are set then LanManagerSessionKey must be ignored
/// </summary> /// </summary>
LanManagerKey = 0x00000080, // NTLMSSP_NEGOTIATE_LM_KEY LanManagerSessionKey = 0x00000080, // NTLMSSP_NEGOTIATE_LM_KEY
NTLMSessionSecurity = 0x00000200, // NTLMSSP_NEGOTIATE_NTLM NTLMSessionSecurity = 0x00000200, // NTLMSSP_NEGOTIATE_NTLM
/// <summary> /// <summary>
@ -31,8 +31,8 @@ namespace SMBLibrary.Authentication.NTLM
TargetTypeServer = 0x00020000, // NTLMSSP_TARGET_TYPE_SERVER TargetTypeServer = 0x00020000, // NTLMSSP_TARGET_TYPE_SERVER
/// <summary> /// <summary>
/// LanManagerKey and ExtendedSessionSecurity are mutually exclusive /// LanManagerSessionKey and ExtendedSessionSecurity are mutually exclusive
/// If both are set then LanManagerKey must be ignored. /// If both are set then LanManagerSessionKey must be ignored.
/// NTLM v2 requires this flag to be set. /// NTLM v2 requires this flag to be set.
/// </summary> /// </summary>
ExtendedSessionSecurity = 0x00080000, // NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ExtendedSessionSecurity = 0x00080000, // NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY

View file

@ -81,7 +81,7 @@ namespace SMBLibrary.Server.SMB1
negotiateMessage.NegotiateFlags = NegotiateFlags.UnicodeEncoding | negotiateMessage.NegotiateFlags = NegotiateFlags.UnicodeEncoding |
NegotiateFlags.OEMEncoding | NegotiateFlags.OEMEncoding |
NegotiateFlags.Sign | NegotiateFlags.Sign |
NegotiateFlags.LanManagerKey | NegotiateFlags.LanManagerSessionKey |
NegotiateFlags.NTLMSessionSecurity | NegotiateFlags.NTLMSessionSecurity |
NegotiateFlags.AlwaysSign | NegotiateFlags.AlwaysSign |
NegotiateFlags.Version | NegotiateFlags.Version |

View file

@ -156,7 +156,7 @@ namespace SMBLibrary.Server.SMB1
} }
else else
{ {
authenticateMessage.NegotiateFlags |= NegotiateFlags.LanManagerKey; authenticateMessage.NegotiateFlags |= NegotiateFlags.LanManagerSessionKey;
} }
authenticateMessage.UserName = accountNameToAuth; authenticateMessage.UserName = accountNameToAuth;
authenticateMessage.LmChallengeResponse = lmChallengeResponse; authenticateMessage.LmChallengeResponse = lmChallengeResponse;