What Is a DGA
DGA (Domain Generation Algorithm) is the standard way malware fights "domain blocklists": the trojan embeds an algorithm that generates hundreds or thousands of candidate domains every day (or every hour) and tries connecting to C2 with each in turn. The security team blocks one; the attacker changes the seed and the next day there is an entirely new batch.
For traffic analysis, DGA domains have a very distinctive "look" — because the algorithm's goal is to cheaply generate large volumes of unpredictable strings, not to generate memorable domains.
Morphological Traits of DGA Domains
Trait 1: Meaningless letter strings
Normal domains are either brand words (google.com) or descriptive phrases (openweathermap.org). DGA domains are random strings spat out by an algorithm: sisouehnmnxxd.top, barbie69.xyz — no vowel rhythm, matching the word-formation habits of no language.
Trait 2: Abnormal consonant clusters
Consonant runs in English words rarely exceed 3-4 in a row. Clusters of 5-8 consonants are common in DGA strings (the hnmnxx in sisouehnmnxxd is a run of 6), making this one of the most reliable statistical markers of a pseudo-word.
Trait 3: Unconventional TLDs
Cheap new generic top-level domains like .top, .xyz, .online, and .biz are DGA hotbeds. Not an absolute signal, but combined with the first two traits it carries a lot of weight.
Trait 4: Abnormal query cadence
A single host issuing queries for large numbers of similar domains in a short time (with most returning NXDOMAIN) is the DGA "trying them one by one." Cross-reference the shape and cadence dimensions and the verdict is basically in.
How-to: Recognition and Verification
Step 1: Open the pcap and review the DNS domain list. PcapDecoder extracts all queried domains. Pull out the subdomain portions and give them a visual scan — DGA domains stand out sharply in a list of normal domains.
Step 2: Run the deep scan's DGA score. PcapDecoder scores every domain against multiple rules (consonant structure, entropy, TLD reputation, digit ratio, etc.) and outputs a confidence value from 0-100. In testing, Formbook's sisouehnmnxxd.top hit the "consonant cluster" rule with a confidence of 60+.
Step 3: Verify the behavior. Correlate the high-scoring domains:
- Whose queries do they appear in (which internal IP)?
- Are there suspicious HTTP connections or exfiltration traffic around them?
- What did resolution return (no A record = a candidate domain not yet activated, meaning the trojan is probing it)?
Step 4: Archive the IOC. Organize the confirmed domains, corresponding internal IPs, and time windows into IOCs and feed them to the threat intelligence platform and DNS sinkhole.
Real-Sample Verification
In the Malware Traffic Analysis 2024-08-12 sample (XLoader/Formbook infection traffic), the writeup lists 33 DGA domains. Tested with PcapDecoder:
- DNS extraction: all DGA domains made it into the extraction list (e.g.,
www.barbie69.xyz,www.coffeemakers.online,www.ueimg.xyz); - DGA scoring:
www.sisouehnmnxxd.top(an 8-consonant cluster) was hit by rule R2 with conf 60; - Attack timeline: DGA queries, HTTP pulls, and exfiltration actions are chained automatically by time, reconstructing the complete infection chain.
False Positives Matter Too
Where DGA detection most often goes wrong is not missed detection — it is false positives. Plenty of legitimate domains also look "random": CDN subdomains (d1a2b3c4.cloudfront.net), URL shorteners, dynamic DNS.
PcapDecoder's scoring system was purpose-built for this, and validated on two legitimate traffic samples:
- MTA 2024-04-18 sample: zero false positives on normal domains such as microsoft and telegram;
- MTA 2024-09-16 sample: zero false positives on normal domains such as dyndns, geoip, and telegram.
Methodologically, remember one rule: DGA scoring is a first pass, not a verdict. High-confidence domains go into the manual review process, and low-scoring ones with anomalous behavior (such as abnormal query cadence) must not be waved through either.
Related reading: "How to Detect DNS Tunneling", "How to Identify Cobalt Strike Beacon Traffic".
