20 - Botnets Flashcards

(36 cards)

1
Q

What is a Botnet?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Launching DDoS attacks through a botnet.

A

Attacker -> Master Machines -> Zombie machines -> Victim

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

DDoS exploits networking protocols

A
  • Smurf: ICMP echo request to broadcast address with spoofed victim’s address as source
  • SYN flood: send lots of “open TCP connection” requests with spoofed source addresses
  • UDP flood: exhaust bandwidth by sending thousands of bogus UDP packets
  • HTTP request flood: flood server with legitimate-looking requests for Web content
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Botnet activities.

A
  • DDoS attacks
  • Data theft
  • Phishing
  • Spam
  • Click fraud
  • Scan vulnerabilities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why are botnets such a powerful tool?

A
  1. Huge scale
  2. Hard to defeat - Zombies are part of the crowd
  3. Easy to manage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How easy is it to build a botnet?

A

Botnet kits readily available online for all wallets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A global botnet market.

A

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
- …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Methods of infecting botnet nodes.

A

Email
Pirated software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Methods of recruiting botnet nodes.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens after bot infection?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Trends in botnet design.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Trail obfuscation techniques.

A

Piggyback on existing protocols and systems
Fast Flux and Domain Generation Algorithms (DGA)
P2P botnet architectures
Encryption
Rootkits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Piggyback on existing protocols & systems: IRC.

A

True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is IRC: Internet Relay Chat?

A

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 “/”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why IRC?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Centralized C&C architecture: IRC channels.

A

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]

17
Q

Controlling a botnet through IRC channels.

A

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

18
Q

Using HTTP.

A

If HTTP is used, bots query dedicated web sites regularly for getting new commands.

19
Q

Web services.

A

Social networks becoming the command points for botnets.
Botnets targeting industrial systems and mobile devices.

20
Q

Fast flux.

A

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

21
Q

Fast flux in action.

A

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.

22
Q

Thwarting fast flux.

A

But: ISPs can blacklist the rendezvous domain.

23
Q

What is the Domain Generation Algorithms (DGA)?

A

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.

24
Q

Random domain generation.

A

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.

25
Centralized botnet architecture: Advantages.
Client-server scheme is easy to implement using centralized communication channels - Typical protocols IRC or HTTP Low latency: botnets’ routing information is clear for each bot and each bot is directly connected to server - Latency is critical for highly synchronized tasks, e.g., DDoS
26
Centralized botnet architecture: Disadvantages.
Detection: centralized communication is easier to detect than non-centralized since bots are using similar traffic patters for communication - E.g., C&C commands from the servers to the zombies Disruption: If a bot is detected, disrupting the connection of a centralized botnet is easier - E.g., disrupting the communication of central server will lead to the whole botnet network to crush
27
P2P Botnets.
Botmaster, Master Servers, Structured P2P DHT. O que é um DHT? DHT = Distributed Hash Table (tabela de dispersão distribuída). É um método para guardar pares (chave → valor) de forma distribuída entre muitos nós, sem precisar de um servidor central. Cada nó armazena só uma parte da tabela. Pensa num catálogo enorme partilhado: em vez de haver um servidor, cada participante fica com alguns dos livros — e há um esquema (algoritmo) para decidir qual nó guarda que chave e como encontrá-la rapidamente. Como funciona, muito resumido (conceito) Cada nó tem um ID (um número grande, normalmente aleatório). Cada chave (p.ex. nome de domínio, comando, ficheiro) é transformada por uma função hash num número. O DHT usa uma métrica (por exemplo distância XOR em Kademlia) para determinar quais os nós responsáveis por essa chave — normalmente os nós com ID “mais próximos” da hash da chave. Quando alguém quer um valor para uma chave, faz consultas P2P que encaminham a pedido até os nós responsáveis, que devolvem o valor. Exemplo prático: Kademlia (o DHT mais usado) Cada nó tem um NodeID de 160 bits (como SHA-1). Distância entre NodeID e chave = XOR bit a bit. Cada nó mantém buckets com listas de peers ordenados por distância. Operações básicas: PING (verificar vivo), FIND_NODE, STORE, FIND_VALUE. Kademlia é eficiente: encontra a chave em O(log N) saltos. Porque os botnets P2P usam DHTs? Descentralização: não há servidor central C&C a derrubar. Resiliência: se alguns nodes caem, outros têm a informação. Anonimato/obscuridade: comandos/endereços podem ser dispersos; o botmaster não precisa de dominar um único host. Escalabilidade: suporta milhões de bots com custo relativamente baixo. Exemplo de uso por botnets: Guardar listas de peers (bootstrap). Publicar comandos ou URLs de atualização sob chaves específicas. Encontrar outros bots para propagar mensagens/actualizações. Vantagens e desvantagens para os operadores Vantagens: Muito difícil derrubar via takedown central. Atualizações/ordens podem “propagar” sem servidor centralizado. Desvantagens / desafios: Sybil attacks / poisoning: defensores podem injetar muitos nós e envenenar a DHT (armazenar falsos valores). Eclipse attacks: isolar um nó cercando-o com controlos maliciosos. Churn: nós entram/saem e a DHT tem de recuperar; isto pode atrapalhar bots. Detecção: tráfego P2P anómalo, padrões de store/find e altas taxas de requests podem ser detectadas...
28
Detecting and deterring botnets.
Determining the source of a botnet-based attack is challenging: - Every zombie host is an attacker - Botnets can exist in a benign state for an arbitrary amount of time before they are used for a specific attack Traditional approach: identify C&C server and disable it. A constant cat and mouse game - Attackers evolving to decentralized C&C structures - Peer to peer model, encrypted traffic, fast flux, DGAs
29
How to detect botnet infections?
Classically: End host – Anti Virus Scanner. Requires installation on every machine. Complementary approach: Network based: - Vertical correlation (single end host) - Horizontal correlation (multiple end hosts): Two or more hosts do the same malicious stuff 🌐 Deteção baseada na rede (Network-based detection) A ideia é: Mesmo que não saibas o que há dentro das máquinas, consegues ver o comportamento delas na rede. Se várias máquinas se comportarem de forma suspeita ou parecida, pode ser sinal de botnet. 1. Vertical correlation (correlação vertical) Observa o comportamento de um único host ao longo do tempo. Exemplo: ferramentas como Rishi, BotHunter, Wurzinger et al. O sistema analisa o tráfego de uma máquina: Padrões típicos de bots (ex: comunicação com C&C servers, envio massivo de SPAM, DDOS) Estrutura de HTTP requests, payloads e assinaturas conhecidas 🧩 É como investigar profundamente um só computador, olhando para o tráfego dele. 2. Horizontal correlation (correlação horizontal) Observa o comportamento entre várias máquinas. Exemplo: BotSniffer, BotMiner, TAMD A ideia: se duas ou mais máquinas fazem a mesma coisa suspeita (por exemplo, enviam pacotes idênticos para o mesmo servidor ao mesmo tempo), é provável que sejam bots do mesmo grupo. 🧩 Aqui o foco é o padrão coletivo — os bots agem de forma sincronizada.
30
Vertical detection without packet inspection.
O conceito (em 1 frase) Detetar que um único host está infectado sem ler o conteúdo dos pacotes — ou seja, sem Deep Packet Inspection — usando propriedades estatísticas do tráfego (principalmente padrões temporais e agregados de flows) e modelos aprendidos por machine learning. Por que isto funciona Bots contactam o servidor de C&C com padrões regulares (por ex. sondagens periódicas, heartbeats, pull de comandos). Mesmo que o payload esteja encriptado, o padrão temporal e as características de flow (quando, quanto, por quanto tempo) frequentemente revelam comportamento anómalo/repetitivo. Pipeline geral (training → detection) 1) Fase de Treino Objetivo: criar modelos que representem o tráfego típico de um bot (ou de várias famílias). Passos: Ambiente controlado: correr amostras do malware num sandbox (máquinas controladas). Capturar flows: não capturar payloads; extrair dados de fluxo (NetFlow/IPFIX/sFlow) ou registros de sessão. Construir traces: para cada execução/host, gerar uma sequência temporal de eventos (timestamps de conexões, bytes, durações, portas, IPs). Extrair features estatísticas (ver lista abaixo). Modelagem: treinar modelos (HMM, modelos de séries temporais, Random Forest, SVM, LSTM, One-Class SVM, clustering) que capturem o comportamento típico do C&C (ex.: periodicidade, distribuições inter-arrival). 2) Fase de Deteção Objetivo: monitorizar hosts em produção e comparar o seu tráfego com o(s) modelo(s). Passos: Capturar flows em tempo real (NetFlow/IPFIX, sFlow) — sem inspeção de payload. Extrair as mesmas features usadas no treino, em janelas deslizantes. Classificar/score: aplicar o modelo e obter um score de “similaridade a bot”. Alertar / correlacionar: se o score > limiar, marcar host como suspeito e acionar medidas (investigar, isolar, recolher mais dados). Basic machine learning approach: Learn about bot behavior: - Training phase (a) Use learned behavior: - Detection phase (b) Training: - Observe malware in controlled environment - Extract flows and build traces - Perform statistical analysis to obtain “features” - Create models to describe malware
31
Detection phase.
Detection: - Obtain traffic - Perform analysis analog to training - Compare statistical features of the traffic with models During the whole process: - No deep packet inspection
32
Methodology – Models.
In the training phase.
33
Methodology – Model Matching.
In the dectetion phase. Some more math involved (quality of matching trace, clustering algorithm, minimal trace length, etc.).
34
Distinguishing characteristics.
Botnet traffic tends to be more regular than benign traffic.
35
Honeypots and honey nets.
Honeypot: environment where vulnerabilities have been deliberately introduced to observe attacks and intrusions.
36
Investigating and taking down a botnet.
Team reverse engineered domain generation algorithm Goal of the botnet: theft and phishing - Steals credit card numbers, bank accounts, etc. - Researchers gathered all this data - Accurate estimation of botnet size