Ejemplo n.º 1
0
        public static byte[] GetAVPairSequence(string domainName, string computerName)
        {
            KeyValuePairList <AVPairKey, byte[]> pairs = new KeyValuePairList <AVPairKey, byte[]>();

            pairs.Add(AVPairKey.NbDomainName, UnicodeEncoding.Unicode.GetBytes(domainName));
            pairs.Add(AVPairKey.NbComputerName, UnicodeEncoding.Unicode.GetBytes(computerName));
            return(AVPairUtils.GetAVPairSequenceBytes(pairs));
        }
Ejemplo n.º 2
0
        public NTLMv2ClientChallengeStructure(byte[] buffer, int offset)
        {
            ResponseVersion     = ByteReader.ReadByte(buffer, offset + 0);
            ResponseVersionHigh = ByteReader.ReadByte(buffer, offset + 1);
            long temp = LittleEndianConverter.ToInt64(buffer, offset + 8);

            Time            = DateTime.FromFileTimeUtc(temp);
            ClientChallenge = ByteReader.ReadBytes(buffer, offset + 16, 8);
            AVPairs         = AVPairUtils.ReadAVPairSequence(buffer, offset + 28);
        }
Ejemplo n.º 3
0
        public byte[] GetBytes()
        {
            byte[] sequenceBytes = AVPairUtils.GetAVPairSequenceBytes(AVPairs);
            byte[] timeBytes     = LittleEndianConverter.GetBytes((ulong)Time.ToFileTimeUtc());

            byte[] buffer = new byte[28 + sequenceBytes.Length];
            ByteWriter.WriteByte(buffer, 0, ResponseVersion);
            ByteWriter.WriteByte(buffer, 1, ResponseVersionHigh);
            ByteWriter.WriteBytes(buffer, 8, timeBytes);
            ByteWriter.WriteBytes(buffer, 16, ClientChallenge, 8);
            ByteWriter.WriteBytes(buffer, 28, sequenceBytes);
            return(buffer);
        }