コード例 #1
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Flags);
     messageData[currentPosition++] = Protocol;
     messageData[currentPosition++] = (byte)Algorithm;
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicKey);
 }
コード例 #2
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Priority);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Weight);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Port);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Target, false, domainNames);
 }
コード例 #3
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, KeyTag);
     messageData[currentPosition++] = (byte)Algorithm;
     messageData[currentPosition++] = (byte)DigestType;
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Digest);
 }
コード例 #4
0
ファイル: AplRecord.cs プロジェクト: zhuyue1314/Xploit
        protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
        {
            foreach (AddressPrefix addressPrefix in Prefixes)
            {
                DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)addressPrefix.AddressFamily);
                messageData[currentPosition++] = addressPrefix.Prefix;

                // no increment of position pointer, just set 1 bit
                if (addressPrefix.IsNegated)
                {
                    messageData[currentPosition] = 128;
                }

                byte[] addressData = addressPrefix.Address.GetNetworkAddress(addressPrefix.Prefix).GetAddressBytes();
                int    length      = addressData.Length;
                for (; length > 0; length--)
                {
                    if (addressData[length - 1] != 0)
                    {
                        break;
                    }
                }
                messageData[currentPosition++] |= (byte)length;
                DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, addressData, length);
            }
        }
コード例 #5
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     messageData[currentPosition++] = (byte)HashAlgorithm;
     messageData[currentPosition++] = Flags;
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Iterations);
     messageData[currentPosition++] = (byte)Salt.Length;
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Salt);
 }
コード例 #6
0
ファイル: EDns.cs プロジェクト: IPA-CyberLab/IPA-DN-Cores
 internal override void EncodeData(Span <byte> messageData, ref int currentPosition)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Version);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OperationCode);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)ErrorCode);
     DnsMessageBase.EncodeULong(messageData, ref currentPosition, Id);
     DnsMessageBase.EncodeUInt(messageData, ref currentPosition, (uint)LeaseTime.TotalSeconds);
 }
コード例 #7
0
        internal void EncodeRecordHeader(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames, out int recordPosition)
        {
            DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Name, true, domainNames);
            DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordType);
            DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordClass);
            DnsMessageBase.EncodeInt(messageData, ref currentPosition, TimeToLive);

            recordPosition = currentPosition + 2;
        }
コード例 #8
0
ファイル: NaptrRecord.cs プロジェクト: zhuyue1314/Xploit
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Order);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference);
     DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, Flags);
     DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, Services);
     DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, RegExp);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Replacement, false, domainNames);
 }
コード例 #9
0
 protected override void EncodePublicKey(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Prime.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Prime);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Generator.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Generator);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)PublicValue.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicValue);
 }
コード例 #10
0
ファイル: EDns.cs プロジェクト: IPA-CyberLab/IPA-DN-Cores
    internal override void EncodeData(Span <byte> messageData, ref int currentPosition)
    {
        DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)(Family == AddressFamily.InterNetwork ? 1 : 2));
        messageData[currentPosition++] = SourceNetmask;
        messageData[currentPosition++] = ScopeNetmask;

        byte[] data = Address.GetAddressBytes();
        DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, data, GetAddressLength());
    }
コード例 #11
0
ファイル: HipRecord.cs プロジェクト: zhuyue1314/Xploit
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     messageData[currentPosition++] = (byte)Hit.Length;
     messageData[currentPosition++] = (byte)Algorithm;
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)PublicKey.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Hit);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicKey);
     foreach (string server in RendezvousServers)
     {
         DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, server, false, domainNames);
     }
 }
コード例 #12
0
ファイル: RrSigRecord.cs プロジェクト: zhuyue1314/Xploit
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)TypeCovered);
     messageData[currentPosition++] = (byte)Algorithm;
     messageData[currentPosition++] = Labels;
     DnsMessageBase.EncodeInt(messageData, ref currentPosition, OriginalTimeToLive);
     EncodeDateTime(messageData, ref currentPosition, SignatureExpiration);
     EncodeDateTime(messageData, ref currentPosition, SignatureInception);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, KeyTag);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, SignersName, false, null);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Signature);
 }
コード例 #13
0
ファイル: TSigRecord.cs プロジェクト: santatic/Xploit
 private void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames, byte[] mac)
 {
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, TSigAlgorithmHelper.GetDomainName(Algorithm), false, domainNames);
     EncodeDateTime(messageData, ref currentPosition, TimeSigned);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Fudge.TotalSeconds);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)mac.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, mac);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, OriginalID);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Error);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OtherData.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, OtherData);
 }
コード例 #14
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, TSigAlgorithmHelper.GetDomainName(Algorithm), false, domainNames);
     EncodeDateTime(messageData, ref currentPosition, Inception);
     EncodeDateTime(messageData, ref currentPosition, Expiration);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Mode);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Error);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Key.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Key);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OtherData.Length);
     DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, OtherData);
 }
コード例 #15
0
ファイル: EDns.cs プロジェクト: IPA-CyberLab/IPA-DN-Cores
 protected internal override void EncodeRecordData(Span <byte> messageData, int offset, ref int currentPosition, Dictionary <DomainName, ushort> domainNames, bool useCanonical)
 {
     if ((Options != null) && (Options.Count != 0))
     {
         foreach (EDnsOptionBase option in Options)
         {
             DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)option.Type);
             DnsMessageBase.EncodeUShort(messageData, ref currentPosition, option.DataLength);
             option.EncodeData(messageData, ref currentPosition);
         }
     }
 }
コード例 #16
0
 internal void EncodeRecordLength(byte[] messageData, int offset, ref int recordDataOffset, Dictionary <string, ushort> domainNames, int recordPosition)
 {
     DnsMessageBase.EncodeUShort(messageData, ref recordDataOffset, (ushort)(recordPosition - recordDataOffset - 2));
     recordDataOffset = recordPosition;
 }
コード例 #17
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)SubType);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Hostname, false, domainNames);
 }
コード例 #18
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Exchanger, true, domainNames);
 }
コード例 #19
0
ファイル: L64Record.cs プロジェクト: zhuyue1314/Xploit
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference);
     DnsMessageBase.EncodeULong(messageData, ref currentPosition, Locator64);
 }