From 320a4cb969e681163b37e3472e3ad51a682c5666 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 1 Sep 2017 18:32:57 +0300 Subject: [PATCH] Corrected implementaion SMB_COM_SESSION_SETUP_ANDX Extended Security response --- SMBLibrary/SMB1/Commands/SessionSetupAndXRequestExtended.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SMBLibrary/SMB1/Commands/SessionSetupAndXRequestExtended.cs b/SMBLibrary/SMB1/Commands/SessionSetupAndXRequestExtended.cs index 7543f65..72b0dbb 100644 --- a/SMBLibrary/SMB1/Commands/SessionSetupAndXRequestExtended.cs +++ b/SMBLibrary/SMB1/Commands/SessionSetupAndXRequestExtended.cs @@ -69,6 +69,7 @@ namespace SMBLibrary.SMB1 LittleEndianWriter.WriteUInt32(this.SMBParameters, 10, SessionKey); LittleEndianWriter.WriteUInt16(this.SMBParameters, 14, SecurityBlobLength); LittleEndianWriter.WriteUInt32(this.SMBParameters, 16, Reserved); + LittleEndianWriter.WriteUInt32(this.SMBParameters, 20, (uint)Capabilities); int padding = 0; if (isUnicode) @@ -76,7 +77,7 @@ namespace SMBLibrary.SMB1 // A Unicode string MUST be aligned to a 16-bit boundary with respect to the beginning of the SMB Header. // Note: SMBData starts at an odd offset. padding = (SecurityBlobLength + 1) % 2; - this.SMBData = new byte[SecurityBlob.Length + (NativeOS.Length + 1) * 2 + (NativeLanMan.Length + 1) * 2]; + this.SMBData = new byte[SecurityBlob.Length + padding + (NativeOS.Length + 1) * 2 + (NativeLanMan.Length + 1) * 2]; } else {