mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-31 01:33:44 +02:00
SMB1: Minor implementation improvements
This commit is contained in:
parent
320a4cb969
commit
b3445530ac
6 changed files with 27 additions and 12 deletions
|
@ -27,8 +27,8 @@ namespace SMBLibrary.SMB1
|
||||||
public ServerCapabilities Capabilities;
|
public ServerCapabilities Capabilities;
|
||||||
// Data:
|
// Data:
|
||||||
public byte[] SecurityBlob;
|
public byte[] SecurityBlob;
|
||||||
public string NativeOS; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeOS = String.Empty; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
public string NativeLanMan; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeLanMan = String.Empty; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
|
|
||||||
public SessionSetupAndXRequestExtended(): base()
|
public SessionSetupAndXRequestExtended(): base()
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,9 @@ using Utilities;
|
||||||
|
|
||||||
namespace SMBLibrary.SMB1
|
namespace SMBLibrary.SMB1
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SMB_COM_SESSION_SETUP_ANDX Response
|
||||||
|
/// </summary>
|
||||||
public class SessionSetupAndXResponse : SMBAndXCommand
|
public class SessionSetupAndXResponse : SMBAndXCommand
|
||||||
{
|
{
|
||||||
public const int ParametersLength = 6;
|
public const int ParametersLength = 6;
|
||||||
|
@ -20,9 +23,9 @@ namespace SMBLibrary.SMB1
|
||||||
//ushort AndXOffset;
|
//ushort AndXOffset;
|
||||||
public SessionSetupAction Action;
|
public SessionSetupAction Action;
|
||||||
// Data:
|
// Data:
|
||||||
public string NativeOS; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeOS = String.Empty; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
public string NativeLanMan; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeLanMan = String.Empty; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
public string PrimaryDomain; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string PrimaryDomain = String.Empty; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
|
|
||||||
public SessionSetupAndXResponse() : base()
|
public SessionSetupAndXResponse() : base()
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,6 +11,9 @@ using Utilities;
|
||||||
|
|
||||||
namespace SMBLibrary.SMB1
|
namespace SMBLibrary.SMB1
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SMB_COM_SESSION_SETUP_ANDX Response, NT LAN Manager dialect, Extended Security response
|
||||||
|
/// </summary>
|
||||||
public class SessionSetupAndXResponseExtended : SMBAndXCommand
|
public class SessionSetupAndXResponseExtended : SMBAndXCommand
|
||||||
{
|
{
|
||||||
public const int ParametersLength = 8;
|
public const int ParametersLength = 8;
|
||||||
|
@ -22,14 +25,12 @@ namespace SMBLibrary.SMB1
|
||||||
private ushort SecurityBlobLength;
|
private ushort SecurityBlobLength;
|
||||||
// Data:
|
// Data:
|
||||||
public byte[] SecurityBlob;
|
public byte[] SecurityBlob;
|
||||||
public string NativeOS; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeOS = String.Empty; // SMB_STRING (If Unicode, this field MUST be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
public string NativeLanMan; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
public string NativeLanMan = String.Empty; // SMB_STRING (this field WILL be aligned to start on a 2-byte boundary from the start of the SMB header)
|
||||||
|
|
||||||
public SessionSetupAndXResponseExtended() : base()
|
public SessionSetupAndXResponseExtended() : base()
|
||||||
{
|
{
|
||||||
SecurityBlob = new byte[0];
|
SecurityBlob = new byte[0];
|
||||||
NativeOS = String.Empty;
|
|
||||||
NativeLanMan = String.Empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SessionSetupAndXResponseExtended(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
public SessionSetupAndXResponseExtended(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace SMBLibrary.SMB1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WriteRawFinalResponse : SMB1Command
|
public class WriteRawFinalResponse : SMB1Command
|
||||||
{
|
{
|
||||||
public ushort ParametersLength = 2;
|
public const ushort ParametersLength = 2;
|
||||||
// Parameters;
|
// Parameters;
|
||||||
public ushort Count;
|
public ushort Count;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace SMBLibrary.SMB1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WriteRawInterimResponse : SMB1Command
|
public class WriteRawInterimResponse : SMB1Command
|
||||||
{
|
{
|
||||||
public ushort ParametersLength = 2;
|
public const ushort ParametersLength = 2;
|
||||||
// Parameters;
|
// Parameters;
|
||||||
public ushort Available;
|
public ushort Available;
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,17 @@ namespace SMBLibrary.SMB1
|
||||||
{
|
{
|
||||||
return (Flags2 & HeaderFlags2.Unicode) > 0;
|
return (Flags2 & HeaderFlags2.Unicode) > 0;
|
||||||
}
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
this.Flags2 |= HeaderFlags2.Unicode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Flags2 &= ~HeaderFlags2.Unicode;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsValidSMB1Header(byte[] buffer)
|
public static bool IsValidSMB1Header(byte[] buffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue