Botnets
A botnet is a network of infected machines (bots or zombies) controlled in a coordinated way from a Command & Control infrastructure. What distinguishes a botnet from a standalone RAT is scale and coordination: thousands or millions of hosts executing orders at once. This page covers their architectures, how they resist takedown, and how they’re detected and dismantled.
Threat model
Section titled “Threat model”A botnet is a monetizable asset: rented for DDoS, spam, click fraud, mining, distributing other malware, or mass credential theft. That’s why the operator invests in resilience: a botnet with a single C2 server dies when that server is blocked; hence the evolution toward P2P, DGA, and fast-flux. The defender has two levers: on the host (detect and clean the bot) and on the network/infrastructure (detect the C2, sinkhole the domains, coordinate the takedown).
C2 architectures
Section titled “C2 architectures”flowchart TD C[Centralized<br/>IRC/HTTP: 1 server] -->|easy takedown| W1[Single point of failure] P[P2P<br/>no central server] -->|resilient| W2[Hard to dismantle] F[Fast-flux<br/>rapid IP rotation] --> W2 D[DGA<br/>domains by date] --> W2
- Centralized (IRC/HTTP/HTTPS) — simple and low-latency, but with a single point of failure: blocking the server kills the botnet.
- Decentralized (P2P) — bots communicate with each other; no central server to take down, much more resistant.
- Fast-flux — very rapid rotation of the IPs tied to a domain (and double-flux, also of the DNS servers) so blocking IPs is useless.
- DGA (Domain Generation Algorithm) — the bot generates hundreds of pseudo-random domains by date; the operator registers only a few. Prevents list-based pre-blocking.
- Dynamic DNS — domains pointing to changing IPs controlled by the operator.
Lifecycle
Section titled “Lifecycle”Infection (see fundamentals) → registration with the C2 (the bot “checks in”) → receiving orders → executing the task (DDoS, spam, mining…) → update/maintenance. The bot maintains persistence and often the ability to self-update.
Network detection
Section titled “Network detection”- Beaconing: periodic check-ins to the C2 (see Command & Control); RITA/Zeek over the traffic.
- DNS analysis: a high volume of queries to non-existent domains (NXDOMAIN) = classic DGA signature; long/random subdomains.
- NetFlow/flows: many internal hosts talking to the same rare destination, or coordinated outbound spikes (outbound DDoS).
- IDS/IPS, honeypots, and darknets catch scanning and propagation.
- Reputation/abuse lists: IPs/domains already catalogued as C2.
Host indicators
Section titled “Host indicators”A process with periodic outbound connections, installed persistence, a “single-bot” mutex, and sometimes DDoS/spam/mining modules. These are the same high-fidelity IOCs as in C2 and persistence.
Sinkholing and takedowns
Section titled “Sinkholing and takedowns”- Sinkholing: registering or redirecting the C2 domains (including the DGA-predicted ones, if the algorithm is broken) to a defender-controlled server, which thus “captures” the check-ins and can measure and notify victims. Recognizing the DGA lets you predict future domains.
- Takedown: a coordinated operation (law enforcement + industry) to seize the infrastructure. Effective against centralized botnets; much harder against P2P.
Red Team
Section titled “Red Team”Emulating a full botnet rarely enters an exercise; when it applies, the value is testing detection of coordination (many hosts to the same C2, DGA, outbound DDoS) and response to propagation. Recognizing commodity bot families and their traffic is shared work with the blue team.
Blue Team
Section titled “Blue Team”Telemetry
Section titled “Telemetry”- DNS logs (NXDOMAIN, rare domains), proxy/firewall (low-reputation destinations), NetFlow (coordination), Sysmon (3/22) on the host.
Response
Section titled “Response”Isolate and clean the bots (all persistence), block/sinkhole the C2s, and perform retrospective hunting of the IOCs across the fleet to find the remaining infected hosts.
CVEs and real-world cases
Section titled “CVEs and real-world cases”- Mirai (2016) — an IoT botnet that launched some of the largest DDoS in history; its leaked code spawned countless variants (see IoT pentest).
- Emotet — a modular botnet dismantled in an international operation (2021) and later resurged: a case study of takedown and resilience.
- Conficker — early and massive use of DGA; its sinkholing was a milestone of global cooperation.
- ATT&CK: T1071 (Application Layer Protocol), T1568 (Dynamic Resolution: DGA/fast-flux/DDNS), T1584 (Compromise Infrastructure), T1498/T1499 (Network/Endpoint DoS).
Testing checklist
Section titled “Testing checklist”- Identify the C2 architecture (centralized/P2P/fast-flux/DGA)
- Does it use DGA? → recognize the algorithm to predict and sinkhole domains
- Characterize the beaconing and the task (DDoS/spam/mining/theft)
- Network detection: DNS (NXDOMAIN), NetFlow (coordination), reputation
- Host IOCs (persistence, mutex, process) + retrospective hunting
- Block/sinkhole C2; evaluate takedown if appropriate
- Map to MITRE ATT&CK (T1071/T1568/T1498)