A threat hunter exports thousands of DNS query records from an enterprise resolver to search for malware using a Domain Generation Algorithm (DGA) to locate its command-and-control server. Which automated analysis technique in Python is best suited for uncovering these domains?
Select an answer to reveal the explanation.
Short Explanation
When malware generates hundreds of random-looking domains to phone home, static blocklists fall behind almost immediately. Calculating Shannon entropy and character distribution across DNS query logs in Python helps you spot algorithmic domain patterns at scale. The trap is relying on manual packet inspection or static lists against fast-rotating infrastructure.
Full Explanation
The best approach is Calculating Shannon entropy and character distribution across DNS query logs in Python. Many DGAs generate high-entropy names and many NXDOMAINs, but word-list DGAs can produce plausible low-entropy domains. Entropy is a heuristic; combine it with response patterns, first-seen context, query cadence, and endpoint evidence. Scripting entropy and character-distribution checks in Python allows a hunter to rapidly score and rank thousands of queried domains, surfacing suspicious algorithmic candidates without needing prior threat feeds. By comparison, Hardcoding static IP blocklists into perimeter router ACLs fails because DGAs are specifically designed to rotate domains and underlying IPs faster than manual lists can update. Disabling recursive DNS resolution for all internal corporate subnets would break normal business web access rather than detect compromised hosts. Similarly, Manually inspecting individual packet payloads in a graphical viewer does not scale to large resolver datasets and misses statistical patterns across thousands of queries. As a caveat, some content delivery networks and cloud services use randomized subdomains, so filter against known benign domains. For an operational check, run your entropy scoring script against recent NXDOMAIN records and inspect the highest-scoring host-domain pairs.