Sample captures, DNS

DNS tunnel over TXT queries

Six TXT queries with long base32 labels under t.badexample.net.

Packets
12
Duration
12.521 s
Size
2.3 KB
Protocols
UDP, DNS
License
CC0

What it shows

A client sends data out through DNS: each query's first label is 52 characters of base32 under t.badexample.net, and each TXT answer carries a short base64 reply.

For rules on label length and character set. Suricata can run pcre on dns.query; in Snort 3, byte_test on the first label's length byte does the same job.

Rules for this capture

Suricata 8 and 7

Try these rules
alert dns any any -> any any (msg:"Long base32 label under t.badexample.net"; dns.query; content:".t.badexample.net"; endswith; pcre:"/^[a-z2-7]{40,}\./"; sid:1000001; rev:1;)
alert udp any any -> any 53 (msg:"Long label under t.badexample.net"; byte_test:1,>,39,12; content:"|01|t|0a|badexample|03|net|00 00 10|"; sid:1000001; rev:1;)

Packets

No.TimeSourceDestinationProtocolInfo
10.000192.0.2.10:50100198.51.100.53:53UDPDNS query TXT mnxxe4c4njzw22luna5voskofu3vcmsmjm2dwmjqfyyc4mbogi2d.t.badexample.net
20.021198.51.100.53:53192.0.2.10:50100UDPDNS answer TXT mnxxe4c4njzw22luna5voskofu3vcmsmjm2dwmjqfyyc4mbogi2d.t.badexample.net
32.500192.0.2.10:50101198.51.100.53:53UDPDNS query TXT wv3jnzsg653teaytaicqojxsamrsjazdwylenvuw4pjrhnqxmplo.t.badexample.net
42.521198.51.100.53:53192.0.2.10:50101UDPDNS answer TXT wv3jnzsg653teaytaicqojxsamrsjazdwylenvuw4pjrhnqxmplo.t.badexample.net
55.000192.0.2.10:50102198.51.100.53:53UDPDNS query TXT n5xgko3dn5zhaxdkonwws5dihnlustrng5itetclgq5tcmbogaxd.t.badexample.net
65.021198.51.100.53:53192.0.2.10:50102UDPDNS answer TXT n5xgko3dn5zhaxdkonwws5dihnlustrng5itetclgq5tcmbogaxd.t.badexample.net
77.500192.0.2.10:50103198.51.100.53:53UDPDNS query TXT alrsgq5vo2lomrxxo4zageycaudsn4qdemsigi5wczdnnfxd2mj3.t.badexample.net
87.521198.51.100.53:53192.0.2.10:50103UDPDNS answer TXT alrsgq5vo2lomrxxo4zageycaudsn4qdemsigi5wczdnnfxd2mj3.t.badexample.net
910.000192.0.2.10:50104198.51.100.53:53UDPDNS query TXT mf3d23tpnzstwy3pojyfy2ttnvuxi2b3k5eu4ljxkezeyszuhmyt.t.badexample.net
1010.021198.51.100.53:53192.0.2.10:50104UDPDNS answer TXT mf3d23tpnzstwy3pojyfy2ttnvuxi2b3k5eu4ljxkezeyszuhmyt.t.badexample.net
1112.500192.0.2.10:50105198.51.100.53:53UDPDNS query TXT alrqfyyc4mruhnlws3ten53xgibrgaqfa4tpeazdesbshnqwi3lj.t.badexample.net
1212.521198.51.100.53:53192.0.2.10:50105UDPDNS answer TXT alrqfyyc4mruhnlws3ten53xgibrgaqfa4tpeazdesbshnqwi3lj.t.badexample.net

More DNS samples

  • DNS lookup: An A query for c2.badexample.net and its answer.