Lion Cipher Lab

Write a DGA-domain detector from scratch (lexical detection + a dictionary-DGA evasion)

Why it matters

When malware needs to phone home, hard-coding one command-and-control (C2) domain is a fatal weakness: a defender blocks that one name and the malware is deaf. So modern families use a Domain Generation Algorithm -- a seeded routine that produces hundreds of fresh pseudo-random domains a day (think aycxpqmnbdrt.com). The attacker registers just a few of them; every infected host runs the same algorithm, tries the day's domains until one resolves, and reconnects. MITRE ATT&CK catalogs this as Dynamic Resolution: Domain Generation Algorithms (T1568.002), and it is precisely why a static domain…

What you'll learn

Steps in this lab

  1. What a DGA is, and why a domain blocklist loses the race
  2. Generate a self-contained dataset (and write a tiny BENIGN DGA to have something to detect)
  3. Build the lexical features from scratch
  4. Score, classify, and print precision / recall + a confusion matrix
  5. Look at the false positives -- the honest #1 FP class
  6. The adversary round: switch to a DICTIONARY DGA and watch entropy collapse
  7. Re-tune -- add a word-boundary feature, and reason about the DNS context you'd add next
  8. The judgment: when lexical wins, the base-rate trap, and where ML + DGArchive fit

Open the full interactive lab →