What is a Botnet?
Botnet: a collection of software “robots” that run on host
computers autonomously and automatically, controlled
remotely by an attacker or attackers.
Primary means for malicious activity:
- E.g., launching denial-of-service attacks (DDoS)
Launching DDoS attacks through a botnet.
Attacker -> Master Machines -> Zombie machines -> Victim
DDoS exploits networking protocols
Botnet activities.
Why are botnets such a powerful tool?
How easy is it to build a botnet?
Botnet kits readily available online for all wallets.
A global botnet market.
Botmasters are not necessarily (only) botnet’s end-beneficiaries.
Who pays:
- Internet Advertising companies for downloading madware onto vulnerable PCs
- Companies who send spam, viruses and other malware
- …
Methods of infecting botnet nodes.
Email
Pirated software
Methods of recruiting botnet nodes.
Drive-by download: Visiting a malicious site with a PC that hasn’t been kept current with security patches and antivirus can download and execute malware on the user’s PC, thus adding to that botnet’s ranks
What happens after bot infection?
During a bot’s installation, the malware typically installs what is known as a backdoor, or a program that allows the bot master to communicate, control and install software onto the infected computer
- Once installed, it’s very difficult to shut the backdoor
After a bot has installed itself, it usually makes an attempt to communicate with its owner to check in
- An infected computer can send a wealth of information to
the bot master, e.g., IP address, login name, OS name,
what patches have been implemented and much more
Trends in botnet design.
Botnets tend to be as specific as possible to the task they are assigned to do.
Large botnets will be aggressive in capturing more computers for their kingdom: alguns malwares de botnets tentam eliminar concorrentes para “monopolizar” a máquina infectada
Trail obfuscation techniques.
Piggyback on existing protocols and systems
Fast Flux and Domain Generation Algorithms (DGA)
P2P botnet architectures
Encryption
Rootkits
Piggyback on existing protocols & systems: IRC.
True.
What is IRC: Internet Relay Chat?
Internet Relay Chat (IRC) is an application layer protocol
that facilitates communication in the form of text.
Communicating to a group of users in an established IRC
session is through a channel.
The chat process works on client/server networking model
- IRC clients are programs that a user can install on their system
- Clients communicate with chat servers to transfer messages to other clients
- Can send commands by prefixing messages with “/”
Why IRC?
IRC servers are:
- freely available
- easy to manage
- easy to subvert
Attackers have experience with IRC
IRC bots usually have a way to remotely upgrade victims with new payloads to stay ahead of security efforts.
Centralized C&C architecture: IRC channels.
C&C (ou C2) significa Command and Control - em português, Comando e Controlo.
É o mecanismo pelo qual o atacante envia ordens aos computadores infetados (bots) e recebe informação de volta.
🧠 O que é o Command & Control (C&C)
Quando um computador é infetado por malware e passa a fazer parte de um botnet, ele precisa de um modo de:
Receber instruções do operador (por exemplo: “envia spam”, “faz DDoS a este IP”, “faz update ao payload”), e
Enviar resultados ou dados roubados de volta ao atacante.
Esse “canal” ou “servidor” que coordena tudo é chamado de C&C (Command and Control).
[Atacante]
│
▼
[Servidor IRC C&C]
│
├──> [Bot 1]
├──> [Bot 2]
└──> [Bot 3]
Controlling a botnet through IRC channels.
Attacker opens private IRC channel on ordinary IRC server
- Waits bots to subscribe his own private IRC channel
Then the attacker gives commands and controls the botnet infrastructures for his malicious purposes
Using HTTP.
If HTTP is used, bots query dedicated web sites regularly for getting new commands.
Web services.
Social networks becoming the command points for botnets.
Botnets targeting industrial systems and mobile devices.
Fast flux.
Misconception: since bots connect with C&C server, existing
tools are able to block the connection.
To evade existing methods of blocking access the server,
some botnets maintain a list of IPs with which to connect.
More advanced botnets use fast flux: IP addresses are
rotated against the same domain
- Bot master points many IP addresses to the domain names the bot
attempts to contact
- By changing those records regularly, the bot master ensures they
can stay a step ahead of potential actions to shut down the server
Fast flux in action.
Change DNS —> IP mapping every 10 seconds.
Example of IP addresses that are rotated in seconds
against the same domain:
[QUESTION] Website name:
www.lijg.ru
[ANSWER] IP Addresses:
www.lijg.ru à 68.124.161.76
www.lijg.ru à 69.14.27.151
www.lijg.ru à 70.251.45.186
www.lijg.ru à 71.12.89.105
www.lijg.ru à 71.235.251.99
www.lijg.ru à 75.11.10.101
www.lijg.ru à 75.75.104.133
www.lijg.ru à 97.104.40.246
www.lijg.ru à 173.16.99.131
…………………
Portanto against the same domain!!! O domain não muda, os IPs é que sim.
Thwarting fast flux.
But: ISPs can blacklist the rendezvous domain.
What is the Domain Generation Algorithms (DGA)?
DGA: a method in which the malware generates the C&C server address.
The malware can determine when to connect to what appears to be a random address online
- Bot master ensures random domain name was registered ahead of connection time and created appropriate DNS records to point that
address to their C&C server.
Random domain generation.
Bots generate many possible domains each day.
…But the Botmaster only needs to register a few.
Can be combined with fast flux.
Ideia-chave (resumida)
O bot e o botmaster executam o mesmo algoritmo (DGA — Domain Generation Algorithm).
Os bots geram centenas ou milhares de nomes de domínio “possíveis” por dia localmente (sem pedir nada a ninguém).
O botmaster só precisa de registar (comprar) um ou alguns desses domínios que sabe que os bots vão tentar — assim consegue contacto com os bots.
Se esse domínio for takedown/blocked, o botmaster regista outro entre os domínios gerados (o bot já vai tentar automaticamente os próximos).
Isto evita que um único servidor ou domínio seja um ponto único de falha.
Como funciona na prática (passo a passo)
Algoritmo partilhado (DGA): o malware embute um algoritmo determinístico (por exemplo, usa a data de hoje + semente + hash) que gera uma lista de nomes de domínio para cada dia, p.ex.:
q4j9k3-2025-11-02.com
xy12ab-2025-11-02.net
shop-2025-11-02.org
… centenas ou milhares por dia.
Nos bots: o bot executa o DGA e tenta contactar (resolver e ligar a) cada domínio gerado até encontrar um que exista e responda.
No lado do botmaster: ele também sabe o algoritmo e a semente. Só regista alguns dos domínios dessa lista (por ex. 2–5 domínios) e aponta esses domínios para os seus servidores C2.
Como os bots tentam muitos domínios, eventualmente vão “acertar” num dos que o botmaster registou.
Se as autoridades tirarem um domínio do ar, o botmaster apenas regista outros domínios do mesmo dia ou passa para o dia seguinte.
Porquê gerar muitos domínios?
Para aumentar o custo e complexidade para quem faz o takedown (têm de registar/derrubar muitos domínios).
Para evitar bloqueios: se um domínio for bloqueado, há dezenas/centenas de alternativas já previstas.
Para dinamismo: o C2 pode mover-se rapidamente entre domínios sem precisar reprogramar os bots.