AS216394 · WireShield

Attack Analysis

What is a botnet? How it works and how it is used in DDoS attacks

A botnet is a network of compromised devices controlled remotely by an attacker. Learn how botnets form, the Mirai case, their role in DDoS attacks and how to protect against them.

What is a botnet: compromised devices send attack traffic to a target on commands from a C2 server

A botnet is a network of internet-connected devices such as computers, cameras and routers that have been infected with malware and are controlled remotely by an attacker. The word combines "robot" and "network". Device owners often never notice that their device has been taken over. Botnets are used to send spam, test stolen credentials and, most of all, to launch DDoS attacks. This guide explains what a botnet is, how one is built, how it works and how to protect against it.

How does a botnet form?

Building a botnet usually goes through these steps:

  1. Infection: The attacker scans the internet for exposed or weak devices. Devices with unchanged default usernames and passwords, unpatched software and attachments in phishing e-mails are the most common entry points.
  2. Control: The infected device connects to the attacker's command-and-control (C2) server and waits for orders.
  3. Spreading: Some botnets spread by themselves; every device they take over starts scanning for new ones.
  4. Command: With a single command the attacker tells all bots the target and the method at the same time.

The Mirai botnet example

Mirai showed how simple methods can grow a botnet. According to CISA's 2016 alert, Mirai continuously scans the internet for vulnerable IoT devices and takes them over by trying a list of 62 common default username and password pairs. The same alert ties the attack of more than 620 Gbps on Brian Krebs' blog in September 2016 and an attack of at least 1.1 Tbps on the French hosting provider OVH to Mirai. The release of Mirai's source code also raised the risk of similar botnets appearing. The October 2016 attack on the DNS provider Dyn, which affected many well-known services, also involved a Mirai botnet.

How are botnets used in DDoS attacks?

A botnet's strength is its size. When thousands of devices send packets or requests at the same moment, the capacity of the link and the server is exceeded. Characteristics of botnet attacks:

  • Sources are scattered. Traffic arrives from different countries and networks, over real home and office connections.
  • Each device produces little traffic. A per-device rate limit is therefore not enough.
  • Both volumetric and application attacks are possible. The same botnet can fill the link with a UDP flood or wear out the application with an HTTP flood. We covered the types in types of DDoS attacks.
  • They can be rented. Botnets are rented by the hour as "stressers" or "booters", so people with little technical skill can launch attacks.

We explained the difference between a botnet-driven attack and a single-source attack in DDoS vs DoS.

How do you know a device is part of a botnet?

  • High network traffic or CPU usage while the device is idle.
  • A router or camera that slows down or restarts often.
  • Connections to unfamiliar IP addresses or unusual ports.
  • Heavy mail (SMTP) traffic leaving your network and your IP address landing on blocklists.

For network administrators the most reliable approach is to watch outbound traffic: devices that keep opening connections to the same external addresses are suspect.

How do you protect against botnets?

Keep your devices out of a botnet:

  • Change default passwords and use a unique password on every device.
  • Apply vendor firmware updates.
  • Turn off remote management and UPnP if you do not need them.
  • Put IoT devices on a separate network segment.
  • Close unused services and open ports.

Protect yourself against botnet attacks:

  • For volumetric attacks, move filtering in front of your link. Remote DDoS protection routes traffic to a filtering network and returns the clean part.
  • WireShield protection profiles include threat intelligence categories: Botnet, Reflector (amplifier), Scanner, Tor exit, Open proxy and your own lists. For each category you can choose Monitor, Rate limit or Drop. See rules, lists, GeoIP and threat intelligence in the documentation.
  • For web applications, filter botnet-driven HTTP requests with the WAF, rate limiting and challenge pages of Web Protection.

Threat lists alone are not enough: devices in a botnet change constantly and are often clean-looking addresses that are not on any list. They should be combined with filters based on behaviour and traffic analysis.

Frequently asked questions

Is a botnet the same as a virus?

No. A virus or malware is the program that infects a device; a botnet is the remotely controlled network of devices infected with it. Infection happens through software, while the network is a separate concept.

Is it illegal to be part of a botnet?

If your device joins a botnet without your knowledge, that does not make you a criminal. Building, running or renting out a botnet to launch attacks is a crime in most countries.

Who controls a botnet?

The attacker, called a "botmaster" or "bot herder", controls it through a command-and-control server. Botnets are often rented out.

Can smartphones be part of a botnet?

Yes. Mobile devices can join a botnet through malicious apps. However, the largest botnets are made of IoT devices and unpatched routers.

Can I stop a botnet-driven DDoS by blocking IPs one by one?

No. With so many sources and addresses that keep changing, blocking one by one is not practical. You need filtering in front of the link and behaviour-based rules.

Sources

Next step

Let us look at the source distribution of the traffic reaching your network together. Share the data you have and we will work out what protection a botnet-driven attack requires. You can talk to the technical team.

All posts

Let’s review the right protection model for your network together.

Contact our team to talk through your technical needs.