whitehatstoicAll articles

Tank City Reboot

Botnet: What It Is and How Malware Builds One

A botnet is a set of hijacked devices taking orders from one operator. How malware recruits them, the Mirai case in numbers, and why takedowns fade.

By Miguel de Guzman · · 8 min read

Tank City Reboot

The Family Computer tank classic, rebuilt inside a computer: defend the CPU core from malware tanks, in a browser on a computer or a phone.

Website

A botnet is a group of internet-connected devices that each run a hidden program, called a bot, and all take orders from one remote operator. Malware builds a botnet in three moves: it gets onto a device through an unpatched hole or a weak password, it makes the device call a control point for instructions, and it repeats this on every device it can reach.

The owners of those devices are not the attackers. They are the supply. Tank City Reboot, a browser game in which an antivirus tank guards a CPU core from malware tanks, gives its basic enemy, the Worm, this real idea: "A worm copies itself from computer to computer over a network, without anyone opening a file." A botnet is what that copying builds when an operator wants the copies to act together.

What a botnet is made of

The plainest definitions are in RFC 6561, a document of March 2012 by J. Livingood, N. Mody and M. O'Reirdan of Comcast on removing bots from the networks of internet service providers. A bot is "a program that is installed on a system in order to enable that system to automatically (or semi-automatically) perform a task or set of tasks typically under the command and control of a remote administrator, or 'bot master'". A botnet is "a concerted network of bots capable of acting on instructions generated remotely".

So there are three parts: the bots, the person who commands them, and the channel between the two. The NIST glossary adds where the word comes from: it is formed from "robot" and "network". The RFC also records an older name for a bot, a "zombie".

How malware builds a botnet, step by step

Each step here is taken from the terms section of RFC 6561.

  1. It finds a way in. The RFC lists the pathways: un-patched operating systems, software vulnerabilities (zero-day ones included, "where no patch yet exists"), "weak/non-existent passwords", malicious web sites and social engineering.
  2. It installs the bot quietly. The bot may arrive "surreptitiously", inside another installation, or "under false pretenses".
  3. The bot reports to its control point. From now on the device listens for instructions that are "generated remotely".
  4. It waits. A bot "may initially appear neutral" while it is "waiting for remote instructions".
  5. It recruits. Hosts are also infected from outside, by "the exploitation of vulnerabilities or the brute force guessing of access credentials", and an infected device can do that work against the next one.
  6. It acts on an order. The RFC's list includes spam, identity theft, key-logging, click fraud, proxy services and distributed denial-of-service (DDoS) attacks.

Steps 1 and 2 are ordinary malware. Step 3 is what makes a bot: the device now obeys someone else. Step 5 is what makes a net.

Mirai, worked through in numbers

The encyclopedia entry on Mirai) gives a case that can be followed with real quantities. Mirai was first found in August 2016 by the research group MalwareMustDie. It turns networked devices that run Linux into bots, and it went mainly after consumer devices such as IP cameras and home routers.

Its way in was not a clever flaw. An infected device scans the internet for others that answer on telnet, TCP ports 23 and 2323. When one answers, Mirai tries a table of more than 60 factory default usernames and passwords. If a pair works, the device is infected and starts scanning too. That is the pattern in the game's line about worms: device to device, over a network, with nobody opening a file.

On 20 September 2016 a Mirai botnet, used alongside another called BASHLITE, hit the website Krebs on Security with a DDoS attack that reached 620 gigabits a second. Now do the division. Suppose each camera or router could send 2 megabits a second upstream. That number is a supposition, not from the entry. Then 620 gigabits is 620,000 megabits, and 620,000 divided by 2 is 310,000 devices.

Follow that to its consequence. No single device sent much. A defence that watches for one address sending too much sees nothing to block, and the entry gives this as a reason for using so many devices. A defender who did block 1,000 of the addresses would remove 2 gigabits of 620, about 0.3 percent. The power of a botnet is a sum, and the sum is spread across more senders than a filter keyed on one address can handle.

Where botnets came from, and how operators hide the controls

RFC 6561 points to chat and gaming, where harmless bots keep "a continual, interactive presence", and says that early malicious bots used the same chat system: "some bots used IRC to communicate but were easy to shut down if the command and control server was identified and deactivated".

The encyclopedia entry on botnets dates the first one to be publicly acknowledged to 2001, when EarthLink exposed it in a lawsuit against the spammer Khan C. Smith. It was built for bulk spam and, the entry says, accounted for nearly 25% of all spam at the time.

One server giving orders is one thing to seize. The botnet entry lists what defenders do: seize the servers or get them cut off, deny the domains the bots were due to contact, and sometimes break into the control network itself. In Operation Endgame, from 27 to 29 May 2024, an international police action led by France, Germany and the Netherlands made four arrests, seized more than 100 servers and took over 2,000 domains.

Operators answered by removing the single point. In a peer-to-peer botnet every bot both passes commands on and receives them, and some sign their commands with a digital signature so that only the holder of a private key can give orders. Others hide the server. RFC 6561 describes fast flux, in which one domain is bound to many IP addresses, each with "a very short Time-to-Live". The addresses are usually proxies on compromised hosts, which makes the real host much harder to find. The RFC calls the struggle between defenders and bot developers "a constant battle".

The strongest objection: a takedown does not clean a single device

Seizing a server removes the operator's hold. It does not remove the bot from one camera, and it does not change one default password. The Mirai entry) shows both halves. A Mirai device stays infected only until it is restarted, yet unless its login password is changed at once it "will be reinfected within minutes". And arresting Mirai's authors did not end it: the source code had been published, and others turned it into new variants.

Cleaning falls to owners, and RFC 6561 is frank about how hard that is. It speaks of "the risks and difficulties inherent in attempting to remove a bot". A household behind one home gateway shares one public address, so it may not be apparent which device is infected. The device may be "a video console, multimedia system, appliance" with no typical desktop interface. The objection stands: as long as the weak devices remain, a new operator can rebuild what the last one lost.

Worm, trojan or bot: the distinction people miss

"Worm" and "trojan" say how malware arrives. "Bot" says what it does afterwards: it takes orders. The two labels answer different questions, so one program can carry both. Mirai spreads as a worm does and every copy is a bot. The NIST glossary describes the other route, in which criminals "use special Trojan viruses" to take control of each computer and organise the machines into a network. RFC 6561 puts it in one line: malicious bots are "a subset of malware".

What is still unsettled

Three questions have no agreed answer in the sources read here. The first is who must clean up. RFC 6561 is an Informational document: it advises providers to detect, notify and help, and generally leaves the removal to the user. The second is how sure a provider should be before it warns anyone. Detection "is also time sensitive", the RFC says, yet it must keep "a relatively low false positive rate in order to maintain the trust of users". The third is legal: the botnet entry notes that takedowns "raise separate legal and constitutional issues".

Meanwhile the scale keeps moving. The RFC said in 2012 that most bot infections were on personal computers. Mirai was built from cameras and routers four years later, and its entry describes a Mirai-based botnet called Aisuru, first seen in August 2024, that is believed to hold over 300,000 devices.

Frequently asked questions

How can you tell if a device is part of a botnet?

Often you cannot. The sample warning in RFC 6561 says bots "can be very difficult to spot" and names two possible signs: a computer running much more slowly than usual, and regular disk activity when nothing is being done. The Mirai entry says an infected device keeps working normally apart from occasional sluggishness and more bandwidth use.

Does restarting a device remove a bot?

For Mirai it did, briefly: the entry says the infection lasted until a reboot and came back within minutes unless the login password was changed. That holds for Mirai, not for bots in general, and RFC 6561 warns that removing a bot carries risks and difficulties.

Is running a botnet illegal?

The botnet entry says that operating, building or using one to control devices without their owners' authorisation is illegal in most jurisdictions. RFC 6561 says installing a malicious bot without the user's knowledge and consent "is considered in most regions to be unlawful".

A botnet is only as large as the devices nobody fixed

Three things can end a botnet: the control channel is cut, the operator is caught, or the devices are fixed. The record shows the first two wearing off. Servers are replaced, domains move, and published code outlives its authors. Only the third removes the supply, and it is the slowest, because it depends on owners who may see no sign of a problem. Mirai needed no secret flaw. It needed a short table of passwords that had never been changed.

Tank City Reboot

The Family Computer tank classic, rebuilt inside a computer. Visit tankcityreboot.vlvd.net

Tank City Reboot on desktop
Tank City Reboot on tablet
Tank City Reboot on phone