What is a botnet?

Basic3 min readUpdated

GET /learn/bots/what-is-a-botnet/ Accept text/html text/markdown

Short answer

A botnet is a group of internet-connected devices, such as home computers, routers, cameras and TV boxes, that malware has taken over and one operator controls remotely. The owners usually do not know. Operators use or rent botnets to flood sites with traffic, send spam, try stolen passwords and sell the devices' home IP addresses as proxies.

A botnet changes what an attack looks like in your logs. One server sending thousands of requests is easy to rate limit. Thousands of home connections sending a few requests each are not, and every one of those IP addresses also carries a real household's traffic.

How does a botnet work?

An operator needs devices to infect, servers to control them and buyers who pay for their use.

Infection starts with whatever is easiest. The Mirai botnet scanned the internet for home routers, network cameras and video recorders and logged in with "a short list of 62 common default usernames and passwords," according to a CISA alert from 2016. Other botnets spread through pirated software, malicious app downloads and fake updates. Some devices are infected before anyone buys them. The FBI's 2025 warning about BADBOX 2.0 describes TV streaming devices, projectors, car infotainment systems and digital picture frames shipped with malicious software, or infected while installing required apps during setup.

Control runs through command and control (C2) servers. Each infected device checks in, receives instructions and reports back. Some botnets use peer-to-peer designs, where infected devices pass commands to each other, so taking down one server does not stop them.

Money comes from renting the botnet out. Buyers pay for an attack, a spam run or access to the devices' IP addresses, without ever touching the malware.

What are botnets used for?

  • Distributed denial of service (DDoS) attacks flood a site until it slows or fails. Mirai hit the KrebsOnSecurity blog with traffic "exceeding 620 gigabits per second," as the same CISA alert reports.
  • Credential stuffing spreads stolen username and password pairs across thousands of IPs so per-IP limits never trigger. See what credential stuffing is.
  • Click fraud uses infected devices to load and click ads, or to run hidden browsers that fake page views. See what click fraud is.
  • Spam runs send email and fill comment sections and contact forms.
  • Residential proxy services sell the device's home IP address to others as a proxy exit. The US Justice Department dismantled 911 S5, a residential proxy service built on hijacked computers, in May 2024. Google reported in January 2026 that the SDKs of the IPIDEA proxy network helped add devices to the BadBox 2.0, Aisuru and Kimwolf botnets. What residential proxies are explains that market.

What does botnet traffic look like on a website?

Per-IP numbers look normal. The pattern shows up when you group requests by something other than IP:

  • Many IPs, each sending a handful of requests to the same endpoint, often /login, /signup or a search API
  • IPs spread across consumer ISPs and mobile networks in many countries, in place of one cloud provider
  • The same user agent, TLS fingerprint or device fingerprint across hundreds of unrelated IPs
  • Bursts that start and stop at the same second across those IPs
  • High failure rates, such as most login attempts failing on accounts that do exist

This query groups an hour of login requests by user agent and counts distinct IPs. It assumes a table of parsed access logs in PostgreSQL:

sql
SELECT user_agent,
       COUNT(DISTINCT client_ip) AS distinct_ips,
       COUNT(*)                  AS requests,
       ROUND(COUNT(*)::numeric / COUNT(DISTINCT client_ip), 1) AS requests_per_ip
FROM access_logs
WHERE path = '/login'
  AND method = 'POST'
  AND ts >= NOW() - INTERVAL '1 hour'
GROUP BY user_agent
ORDER BY distinct_ips DESC
LIMIT 20;

A user agent with hundreds of distinct IPs and one to three requests per IP is worth a closer look. Replace user_agent with a TLS fingerprint such as JA4 if your logs carry one, since user agents are easy to vary.

How do you defend against botnet traffic?

Blocking botnet IPs one by one rarely works. Home IPs change owners, mobile networks share one IP across many customers, and the next wave arrives from new addresses. Per-IP rate limits fail for the same reason, as covered in what rate limiting stops and misses.

Defend at the level of the session and the device. Rate limit per account, per device fingerprint and per endpoint as well as per IP. Challenge sessions that share a fingerprint with a known attack, even from a clean IP. Alert on failure-rate spikes at login and payment, which show up within minutes even when traffic volume barely moves. Give IP blocks a short expiry so you do not lock out the household that gets the address next.

Common questions

Is it illegal to run a botnet?

Yes, in most countries. Taking control of other people's devices breaks computer misuse laws such as the US Computer Fraud and Abuse Act and the UK Computer Misuse Act, and EU Directive 2013/40/EU requires member states to criminalise attacks on information systems. This is general information, not legal advice.

How do I know if my device is part of a botnet?

The FBI's indicators for BADBOX 2.0 include unexplained or suspicious internet traffic, devices that require Google Play Protect to be disabled, generic streaming boxes sold as unlocked, and devices from brands you do not recognise. Keep firmware updated, and disconnect any device you suspect.

What is the difference between a bot and a botnet?

A bot is any program that acts automatically, and it can run on one rented server. A botnet is many hijacked devices working together. Many bad bots run on rented servers and never touch a botnet, though they may rent proxy IPs that come from one.