BadCompressLoop1 - Pointer Loop in Name Field (Variant 1)

BadCompressLoop1 - Pointer Loop in Name Field (Variant 1)

The DNS protocol supports compressing domain names to save space by reducing redundancy for repeated domain names within DNS messages. This compression scheme can be applied to various record (resource) types, such as A, CNAME, MX, or PTR records.

This particular module is designed to respond with a single answer containing a CNAME record (alias) where the Name field is compressed.

The compression pointer in the Name field points to itself, forming a direct loop.

Category: Bad compression

RFCs: RFC1035

Format

badcompressloop1.yourdomain.com

This module has no parameters.

Examples

In this example, we can see that the client (dig) is unable to process the response because of the compression loop:

# dig badcompressloop1.yourdomain.com @127.0.0.1

;; Got bad packet: bad compression pointer
89 bytes
92 be 84 00 00 01 00 01 00 00 00 00 10 62 61 64          .............bad
63 6f 6d 70 72 65 73 73 6c 6f 6f 70 31 0a 79 6f          compressloop1.yo
75 72 64 6f 6d 61 69 6e 03 63 6f 6d 00 00 01 00          urdomain.com....
01 c0 31 00 05 00 01 00 00 00 3c 00 1c 0b 61 6c          ..1.......<...al
77 61 79 73 39 37 32 30 34 0a 79 6f 75 72 64 6f          ways97204.yourdo
6d 61 69 6e 03 63 6f 6d 00                               main.com.

Download PCAP File

By examining the PCAP file in Wireshark, we can see that it detects the loop and displays the error message <Name contains a pointer that loops> while parsing the field. However, different DNS resolvers and clients may handle such malformed responses in vastly different ways, making this an intriguing use case for testing.


Like other features, you can append anything to the feature name to avoid receiving cached responses from the target DNS resolver. This forces the target resolver to actively communicate with our PolarDNS server instead of responding with cached answers. Using a random number is the most effective strategy:

# dig badcompressloop1${RANDOM}.yourdomain.com @10.211.55.2

;; Got bad packet: bad compression pointer
94 bytes
2b ae 84 00 00 01 00 01 00 00 00 00 15 62 61 64          +............bad
63 6f 6d 70 72 65 73 73 6c 6f 6f 70 31 31 36 33          compressloop1163
39 30 0a 79 6f 75 72 64 6f 6d 61 69 6e 03 63 6f          90.yourdomain.co
6d 00 00 01 00 01 c0 36 00 05 00 01 00 00 00 3c          m......6.......<
00 1c 0b 61 6c 77 61 79 73 31 39 32 37 37 0a 79          ...always19277.y
6f 75 72 64 6f 6d 61 69 6e 03 63 6f 6d 00                ourdomain.com.

Download PCAP File


From the same category


Go back to catalogue.