Exemplo n.º 1
0
 public NTLMv2ClientChallenge(byte[] buffer, int offset)
 {
     CurrentVersion          = ByteReader.ReadByte(buffer, offset + 0);
     MaximumSupportedVersion = ByteReader.ReadByte(buffer, offset + 1);
     Reserved1       = LittleEndianConverter.ToUInt16(buffer, offset + 2);
     Reserved2       = LittleEndianConverter.ToUInt32(buffer, offset + 4);
     TimeStamp       = FileTimeHelper.ReadFileTime(buffer, offset + 8);
     ClientChallenge = ByteReader.ReadBytes(buffer, offset + 16, 8);
     Reserved3       = LittleEndianConverter.ToUInt32(buffer, offset + 24);
     AVPairs         = AVPairUtils.ReadAVPairSequence(buffer, offset + 28);
 }
Exemplo n.º 2
0
        public NegotiateResponseExtended(byte[] buffer, int offset) : base(buffer, offset, false)
        {
            DialectIndex    = LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
            SecurityMode    = (SecurityMode)ByteReader.ReadByte(this.SMBParameters, 2);
            MaxMpxCount     = LittleEndianConverter.ToUInt16(this.SMBParameters, 3);
            MaxNumberVcs    = LittleEndianConverter.ToUInt16(this.SMBParameters, 5);
            MaxBufferSize   = LittleEndianConverter.ToUInt32(this.SMBParameters, 7);
            MaxRawSize      = LittleEndianConverter.ToUInt32(this.SMBParameters, 11);
            SessionKey      = LittleEndianConverter.ToUInt32(this.SMBParameters, 15);
            Capabilities    = (Capabilities)LittleEndianConverter.ToUInt32(this.SMBParameters, 19);
            SystemTime      = FileTimeHelper.ReadFileTime(this.SMBParameters, 23);
            ServerTimeZone  = LittleEndianConverter.ToInt16(this.SMBParameters, 31);
            ChallengeLength = ByteReader.ReadByte(this.SMBParameters, 33);

            ServerGuid   = LittleEndianConverter.ToGuid(this.SMBData, 0);
            SecurityBlob = ByteReader.ReadBytes(this.SMBData, 16, this.SMBData.Length - 16);
        }
Exemplo n.º 3
0
        public NegotiateResponse(byte[] buffer, int offset) : base(buffer, offset)
        {
            DialectIndex    = LittleEndianConverter.ToUInt16(SMBParameters, 0);
            SecurityMode    = (SecurityMode)ByteReader.ReadByte(SMBParameters, 2);
            MaxMpxCount     = LittleEndianConverter.ToUInt16(SMBParameters, 3);
            MaxNumberVcs    = LittleEndianConverter.ToUInt16(SMBParameters, 5);
            MaxBufferSize   = LittleEndianConverter.ToUInt32(SMBParameters, 7);
            MaxRawSize      = LittleEndianConverter.ToUInt32(SMBParameters, 11);
            SessionKey      = LittleEndianConverter.ToUInt32(SMBParameters, 15);
            Capabilities    = (Capabilities)LittleEndianConverter.ToUInt32(SMBParameters, 19);
            SystemTime      = FileTimeHelper.ReadFileTime(SMBParameters, 23);
            ServerTimeZone  = LittleEndianConverter.ToInt16(SMBParameters, 31);
            ChallengeLength = ByteReader.ReadByte(SMBParameters, 33);

            int dataOffset = 0;

            Challenge = ByteReader.ReadBytes(SMBData, ref dataOffset, ChallengeLength);
            // [MS-CIFS] <90> Padding is not added before DomainName
            // DomainName and ServerName are always in Unicode
            DomainName = SMB1Helper.ReadSMBString(SMBData, ref dataOffset, true);
            ServerName = SMB1Helper.ReadSMBString(SMBData, ref dataOffset, true);
        }