SY0-701Chapter 80 of 212Objective 2.4

Botnets and Command-and-Control (C2)

This chapter covers botnets and command-and-control (C2) infrastructures, a critical topic for the SY0-701 exam under Objective 2.4 (Threats, Vulnerabilities, and Mitigations). Botnets are networks of compromised devices controlled by an attacker, used for various cybercrimes like DDoS attacks, spam, credential theft, and ransomware distribution. Understanding how botnets are structured, how C2 channels operate, and how to detect and disrupt them is essential for any security professional, as botnets remain a persistent and evolving threat.

25 min read
Intermediate
Updated May 31, 2026

The Zombie Army and Its Commander

Imagine a dark fantasy world where a necromancer (the attacker) raises an army of zombies (compromised computers). Each zombie is a mindless, reanimated corpse that follows the necromancer's commands without question. The necromancer does not lead the army directly into battle; instead, he hides in a fortified tower (the command-and-control server) and sends out magical signals (C2 traffic) to control his minions. The zombies communicate back to the necromancer through a series of enchanted mirrors (C2 channels) that can be changed or hidden. If one mirror is discovered and smashed (taken down), the necromancer simply activates another. The army can be used to overwhelm a castle (DDoS attack), steal treasure (data exfiltration), or spread a plague (malware propagation). The key is that the necromancer's identity and location are concealed, and the zombies themselves are unaware they are being controlled—just like a botnet where the infected machines' owners have no idea their device is part of a malicious network.

How It Actually Works

What is a Botnet?

A botnet (short for "robot network") is a collection of internet-connected devices—such as computers, servers, IoT devices, or smartphones—that have been infected with malware and are remotely controlled by an attacker, known as the bot herder or botmaster. Each infected device is called a bot or zombie. The bot herder uses command-and-control (C2 or C&C) infrastructure to issue commands to the bots, enabling coordinated malicious activities.

How Botnets Work Mechanically

The lifecycle of a botnet involves several stages:

1.

Infection: The attacker infects devices through various vectors: phishing emails with malicious attachments, drive-by downloads (exploit kits), malvertising, or exploiting unpatched vulnerabilities. For example, the Mirai botnet exploited default credentials on IoT devices (CVE-2014-8361 related to weak passwords).

2.

C2 Communication: Once infected, the bot establishes a connection to the C2 server. The C2 server issues commands, and the bot reports back with stolen data or status updates. Communication can be over HTTP/HTTPS, IRC, DNS, or peer-to-peer (P2P) protocols.

3.

Command Execution: The bot herder can send commands to perform actions such as:

- Launching DDoS attacks (e.g., SYN flood, UDP flood, HTTP GET flood) - Sending spam emails - Performing credential stuffing or brute-force attacks - Mining cryptocurrency - Distributing ransomware or other malware - Exfiltrating sensitive data

4.

Propagation: Some botnets self-propagate by scanning for vulnerable devices and infecting them, growing the botnet size.

5.

Evasion: Botnets use techniques to avoid detection and takedown, such as using fast-flux DNS, domain generation algorithms (DGAs), or encrypted C2 traffic.

Key Components and Variants

- C2 Server: The central server that sends commands. It can be a single server, but modern botnets use distributed architectures (e.g., multiple servers, P2P). - Bots: The compromised devices. They often connect to the C2 server on specific ports (e.g., TCP 80, 443, 6667 for IRC, 53 for DNS). - C2 Protocol: The method used for communication. Common protocols include: - IRC (Internet Relay Chat): Older botnets like Agobot used IRC channels for C2. IRC uses ports 6660-6669. - HTTP/HTTPS: Modern botnets like Zeus and Emotet use HTTP to blend in with normal web traffic. - DNS: Some botnets use DNS tunneling to exfiltrate data or send commands via DNS queries (e.g., using TXT records). - P2P: Decentralized botnets like Storm and ZeroAccess use P2P networks, making them harder to disrupt because there is no single point of failure. - Fast-Flux DNS: A technique where the IP address associated with a fully qualified domain name (FQDN) is changed rapidly, often using a large pool of compromised machines as proxies. This helps hide the true C2 server. - Domain Generation Algorithm (DGA): An algorithm that generates many domain names periodically. The bot tries to connect to these domains until it finds one that the attacker has registered. This makes it hard to block all possible C2 domains.

How Attackers Exploit Botnets

Attackers exploit botnets for financial gain, espionage, or disruption. Common uses include:

Distributed Denial of Service (DDoS): Overwhelming a target with traffic from many bots. For example, the Mirai botnet launched a 1.2 Tbps DDoS attack against KrebsOnSecurity in 2016.

Spam Campaigns: Bots send millions of spam emails, often for phishing or selling counterfeit products.

Credential Theft: Bots capture keystrokes, steal saved passwords, or perform man-in-the-browser attacks (e.g., Zeus botnet stealing online banking credentials).

Ransomware Delivery: Bots act as a delivery mechanism for ransomware like Ryuk or Conti, often through initial access brokers.

Click Fraud: Bots simulate ad clicks to defraud advertisers.

Cryptocurrency Mining: Bots mine cryptocurrency like Monero using the device's CPU/GPU resources.

How Defenders Detect and Disrupt Botnets

Defenders use several techniques:

Network Monitoring: Analyze traffic for unusual patterns: frequent connections to known bad IPs, non-standard ports, or periodic beaconing (regular check-ins with a C2 server).

DNS Monitoring: Detect DGA-generated domains or excessive DNS queries to the same domain.

Honeypots: Decoy systems that mimic vulnerable devices to capture botnet traffic and analyze C2 protocols.

Sinkholing: Redirecting traffic from known C2 domains to a server controlled by defenders, which can then analyze and block bot activity. For example, the FBI sinkholed the GameOver Zeus botnet in 2014.

Botnet Takedowns: Coordinated law enforcement actions to seize C2 servers and arrest operators. Example: Operation Tovar dismantled the GameOver Zeus botnet.

Endpoint Detection: Antivirus and EDR solutions can detect bot malware through signatures, behavioral analysis, or indicators of compromise (IoCs).

Real Command/Tool Examples

Zeus Botnet: Used HTTP-based C2 with encrypted configuration files. Its builder allowed attackers to customize the malware.

Conficker: Used a DGA that generated 250 domains per day across multiple top-level domains.

Mirai: Scanned for IoT devices with default credentials and used a centralized C2 server over TCP port 23 (Telnet) or 2323.

Emotet: Originally a banking trojan, evolved into a botnet that delivered other malware (e.g., TrickBot, Ryuk). Used HTTP C2 with encrypted payloads.

TrickBot: A modular botnet that used a P2P C2 layer alongside HTTP for redundancy.

Summary

Botnets are a versatile tool for cybercriminals, enabling large-scale attacks while hiding the attacker's identity. Defenders must understand C2 architectures, communication patterns, and detection methods to effectively combat them. On the SY0-701 exam, expect questions on botnet components, C2 types (IRC, HTTP, P2P), and mitigation strategies like sinkholing and fast-flux detection.

Walk-Through

1

Infection and Initial Compromise

The attacker delivers the bot malware to a target device. Common delivery methods include phishing emails with malicious attachments (e.g., Word macro, JavaScript file), drive-by downloads from compromised websites, or exploiting unpatched vulnerabilities (e.g., EternalBlue for SMB). The user may unknowingly run the payload, or an exploit kit like Angler or RIG automatically infects the device. Once executed, the malware installs itself persistently (e.g., registry run keys, scheduled tasks) and hides its presence using rootkit techniques. The device becomes a bot, awaiting further instructions.

2

Establishing C2 Communication

The bot attempts to contact the C2 server. It may use a hardcoded IP address, a DGA-generated domain, or a P2P network to find peers. The communication is often encrypted (HTTPS) or disguised as legitimate traffic (HTTP). The bot sends a beacon (e.g., HTTP GET request to a specific URL) with a unique identifier. The C2 server responds with commands or configuration updates. If the initial C2 is blocked, the bot may fall back to alternative channels (e.g., DNS tunneling, social media profiles).

3

Receiving Commands and Execution

The C2 server issues commands to the bot. Commands can be sent in various formats: plain text (IRC), encrypted JSON (HTTP), or binary (P2P). Example commands: 'download and execute' (retrieve secondary payload), 'scan' (find vulnerable hosts), 'send spam' (use SMTP credentials), 'launch DDoS' (generate traffic). The bot executes the command and may report results back to the C2. For DDoS, multiple bots receive the same target IP and start sending packets simultaneously.

4

Propagation and Growth

Many botnets include self-propagation modules. The bot scans the local network or the internet for vulnerable devices (e.g., open Telnet ports with default passwords, unpatched SMB services). When a vulnerable device is found, the bot exploits it and installs the malware, turning it into a new bot. This recursive process grows the botnet exponentially. For example, the Mirai botnet scanned for IoT devices using a list of default usernames and passwords. Propagation can be detected by sudden spikes in outbound scans or unusual traffic patterns.

5

Evasion and Persistence

To avoid detection and takedown, botnets employ evasion techniques. Fast-flux DNS changes the IP address of the C2 domain rapidly (e.g., every 3 minutes) using a rotating set of compromised machines as proxies. DGA generates thousands of domain names daily; the attacker registers a small subset, making it hard for defenders to pre-block all domains. Bots may also use peer-to-peer networks, where each bot acts as a relay, eliminating a central C2. Rootkits hide bot processes and files. Antivirus evasion includes polymorphic code (changing signature each time) and packing (compression/encryption).

6

Detection and Disruption by Defenders

Defenders detect botnets through network monitoring: beaconing patterns (regular intervals, same payload size), connections to known malicious IPs, or anomalous DNS queries (high NXDOMAIN rate for DGA). Tools like Zeek (formerly Bro), Snort, or commercial SIEMs can alert on these patterns. Once identified, defenders can sinkhole the C2 domain by redirecting traffic to a controlled server, capturing bot communication and potentially issuing 'uninstall' commands. Law enforcement may seize servers and arrest operators. Endpoint detection (EDR) can isolate infected machines. Regular patching and strong authentication reduce infection vectors.

What This Looks Like on the Job

Scenario 1: SOC Analyst Detecting a Botnet Infection

A SOC analyst notices an internal workstation making frequent HTTPS connections to a domain that was registered only two days ago (e.g., 'xyz123.info'). The connections occur every 60 seconds, and the request sizes are consistent (~500 bytes). The analyst queries the domain in a threat intelligence platform and finds it is associated with the Emotet botnet. Using a network packet capture tool (Wireshark), the analyst sees the HTTP GET request to '/gate.php' with a unique bot ID. The correct response is to isolate the workstation from the network (block its MAC address), initiate incident response, and block the C2 domain at the firewall. A common mistake is to ignore the traffic because it uses HTTPS, assuming it is encrypted and thus safe. However, botnets commonly use HTTPS to evade detection.

Scenario 2: DDoS Attack from a Botnet

An e-commerce site experiences a massive traffic spike, overwhelming its web servers. The security engineer examines firewall logs and sees thousands of source IPs sending SYN packets to port 80. The traffic pattern shows each IP sends a small number of packets, but the aggregate is huge. The engineer identifies this as a SYN flood DDoS attack from a botnet. The correct response is to enable rate limiting, use a DDoS mitigation service (e.g., Cloudflare, AWS Shield), and contact the ISP. A common mistake is to block individual IPs, which is ineffective because the botnet has many IPs. Instead, the engineer should look for common patterns (e.g., same User-Agent string) to create more effective filters.

Scenario 3: Sinkholing a Botnet

A security researcher reverse-engineers a new botnet sample and finds a DGA that generates 1000 domains daily. The researcher registers a subset of future domains before the attacker can, redirecting bot traffic to a sinkhole server. The sinkhole captures bot beacons and can issue a 'self-destruct' command. Over days, thousands of bots connect to the sinkhole, allowing the researcher to map the botnet size and help ISPs notify infected users. A common mistake is to assume that sinkholing alone stops the botnet—attackers may have a backup C2 mechanism (e.g., P2P) that bypasses the sinkhole.

How SY0-701 Actually Tests This

What SY0-701 Tests on Botnets and C2

The exam focuses on identifying botnet components (bot, C2 server, bot herder), types of C2 architectures (centralized, decentralized, P2P), and common uses (DDoS, spam, credential theft). It also tests mitigation techniques like sinkholing, fast-flux detection, and DGA analysis. Expect scenario-based questions where you must choose the best response to a botnet infection or DDoS attack.

Common Wrong Answers and Why

1.

'Use antivirus to remove the bot': While antivirus can help, the exam emphasizes network-level detection and disruption (e.g., sinkholing, firewall blocks) because bots often evade endpoint security.

2.

'Block all inbound traffic': This is too broad and may block legitimate services. The correct answer is to block specific C2 domains or IPs.

3.

'The botnet uses a centralized C2': Many modern botnets use P2P or hybrid architectures. The exam may describe a scenario where a botnet continues to operate after a C2 server is taken down, indicating a decentralized structure.

4.

'DNS is not used for C2': DNS tunneling is a known C2 technique. The exam may test that DNS can be used for both command and data exfiltration.

Specific Terms and Acronyms

C2 (C&C): Command and Control

DGA: Domain Generation Algorithm

Fast-Flux: Rapidly changing IP addresses

P2P: Peer-to-Peer (decentralized botnet)

IRC: Internet Relay Chat (older C2 protocol)

Bot Herder: The attacker controlling the botnet

Sinkhole: Redirecting C2 traffic to a defender-controlled server

Zombie: Another term for a bot

Common Trick Questions

'Which of the following is a characteristic of a centralized botnet?' A trick answer may be 'No single point of failure'—that is actually a characteristic of a decentralized (P2P) botnet. Centralized has a single point of failure.

'What protocol is commonly used for C2 in older botnets?' The answer is IRC, not HTTP, even though HTTP is more common today.

'A botnet is used to send spam. Which component is responsible for delivering the spam?' The bot itself, not the C2 server. The C2 server issues commands, but the bots execute the spam delivery.

Decision Rule for Scenario Questions

When given a scenario about a botnet attack, first identify the type of attack (DDoS, spam, etc.). Then look for clues about the C2 architecture (e.g., 'after the C2 server was taken down, the botnet continued to operate' implies P2P). For mitigation, prefer network-level actions (sinkholing, firewall rules) over endpoint actions unless the question specifies the infected host is known. If the question asks about detection, look for indicators like regular beaconing, DGA domains, or fast-flux.

Key Takeaways

Botnet = network of compromised devices (bots) controlled by a bot herder via C2 infrastructure.

C2 can be centralized (IRC, HTTP) or decentralized (P2P); decentralized is more resilient.

Common botnet uses: DDoS, spam, credential theft, ransomware delivery, cryptocurrency mining.

Detection methods: beaconing analysis, DGA domain monitoring, fast-flux detection, sinkholing.

Fast-flux DNS rapidly changes IP addresses to hide C2 servers; DGA generates many domains to evade blocklists.

Sinkholing redirects C2 traffic to a defender-controlled server to disrupt botnet operations.

Mitigation includes network segmentation, firewalls, EDR, patching, and strong authentication to prevent initial infection.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Centralized C2 (e.g., IRC, HTTP)

Single C2 server or small set of servers

Single point of failure – takedown of C2 can cripple botnet

Easier to implement and manage for attacker

Easier to detect (traffic to known malicious IPs)

Example: Zeus, Conficker (early versions)

Decentralized C2 (e.g., P2P)

No central server; bots communicate with each other

No single point of failure – resilient to takedowns

More complex to implement but harder to disrupt

Harder to detect (traffic distributed among many peers)

Example: Storm, ZeroAccess, Sality

Watch Out for These

Mistake

Botnets only infect computers.

Correct

Botnets can infect any internet-connected device, including IoT devices (cameras, routers), smartphones, and servers. The Mirai botnet famously infected IoT devices using default credentials.

Mistake

All botnets use a centralized C2 server.

Correct

Modern botnets often use decentralized architectures like P2P (e.g., ZeroAccess, Storm) to avoid a single point of failure. Some use hybrid models with multiple C2 servers.

Mistake

Botnets are only used for DDoS attacks.

Correct

Botnets are versatile and used for spam, credential theft, cryptocurrency mining, ransomware delivery, click fraud, and more. DDoS is just one of many uses.

Mistake

If you remove the malware from one bot, the botnet is defeated.

Correct

Removing malware from a single bot does not affect the rest of the botnet. The botnet continues to operate until the C2 infrastructure is disrupted or all bots are cleaned.

Mistake

HTTPS traffic from a botnet is safe and cannot be malicious.

Correct

Botnets commonly use HTTPS to encrypt C2 traffic, making it harder to inspect. The encryption hides the command content, but the traffic pattern (beaconing) can still be detected.

Frequently Asked Questions

What is a botnet in cybersecurity?

A botnet is a network of internet-connected devices infected with malware and controlled remotely by an attacker. The attacker (bot herder) uses command-and-control (C2) servers to issue commands to the bots, enabling coordinated malicious activities like DDoS attacks, spam, or data theft. Each infected device is called a bot or zombie.

How does a botnet work step by step?

First, the attacker infects devices via phishing, exploit kits, or brute-force attacks. The malware installs and connects to a C2 server. The C2 issues commands (e.g., launch DDoS, steal data). The bot executes the command and may report back. Some botnets self-propagate by scanning for vulnerable devices. Defenders detect botnets by monitoring for beaconing traffic, DGA domains, or fast-flux DNS.

What is command and control (C2) in botnets?

C2 (or C&C) is the infrastructure used by an attacker to send commands to bots and receive data from them. It can be a single server, multiple servers, or a peer-to-peer network. Common C2 protocols include IRC, HTTP/HTTPS, DNS, and P2P. C2 servers are often hidden behind fast-flux DNS or use DGA to evade takedown.

What is the difference between centralized and decentralized botnets?

Centralized botnets have a single C2 server or a small set of servers, making them easier to manage but vulnerable to takedown. Decentralized (P2P) botnets have no central server; each bot communicates with peers, making them more resilient but harder to control. The exam may test that P2P botnets survive C2 server seizures.

How can botnets be detected?

Detection methods include network traffic analysis for periodic beaconing (regular check-ins to a C2), unusual DNS queries (high NXDOMAIN rate from DGA), connections to known malicious IPs, or fast-flux patterns. Tools like Zeek, Snort, and SIEMs can alert on these. Endpoint detection (EDR) can also identify bot malware through behavioral analysis.

What is sinkholing in botnet mitigation?

Sinkholing is a technique where defenders redirect traffic from a known C2 domain to a server they control. This allows them to capture bot communication, analyze the botnet, and potentially issue commands to disable bots. It is often used in law enforcement takedowns (e.g., GameOver Zeus). Sinkholing is more effective against centralized botnets than P2P ones.

What is a Domain Generation Algorithm (DGA)?

A DGA is an algorithm that generates a large number of domain names periodically. The attacker registers a small subset of these domains, and the bot attempts to connect to each until it finds a valid C2 domain. This makes it difficult for defenders to pre-block all possible C2 domains. Examples include Conficker (250 domains/day) and Torpig.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Botnets and Command-and-Control (C2) — now see how well it sticks with free SY0-701 practice questions. Full explanations included, no account needed.

Done with this chapter?