learn: DNS TXT Record C2 Communication Pattern
Mixed protocols across DNS, ETHERNET, IPV4
55 DNS transactions against BIND 9.18.39 demonstrating command-and-control communication via TXT records. Three distinct phases are visible:
Phase 1 - Beacon polling: 30 TXT queries to {session_id}.beacon.updates.pcaplab.local at 500ms intervals. Each uses a random hex session ID (e.g., ca13, f082, ba5e). This periodic polling is how malware checks for new commands.
Phase 2 - Data exfiltration: 15 TXT queries encoding base64 data chunks in subdomains under data.updates.pcaplab.local. Each query carries a numbered chunk of stolen data.
Phase 3 - Baseline comparison: 4 legitimate TXT queries (google.com, github.com, cloudflare.com, pcaplab.local) returning real SPF and verification records, plus 3 normal A record queries.
TXT records can carry arbitrary text, making them ideal for C2 data transfer. In Wireshark, filter with dns.qry.type == 16 to isolate TXT queries. In normal browsing you should see very few TXT queries. A high count to a single domain at regular intervals is a strong C2 indicator.