KRACK Attack
Key Reinstallation Attack (KRACK)
Overview
The Key Reinstallation Attack (KRACK) is a critical vulnerability discovered in 2017 that exploits flaws in the implementation of the four-way handshake process in the WPA2 authentication protocol. This attack affects all secure Wi-Fi networks that use the four-way handshake to establish connections and generate encryption keys for network traffic protection.
Attack Methodology
Core Vulnerability
KRACK exploits the fact that WPA2 clients can be tricked into reinstalling an already-in-use encryption key, which resets the key's associated parameters like the packet counter (nonce).
Four-Way Handshake Exploitation
The attacker exploits the four-way handshake of the WPA2 protocol by forcing Nonce reuse:
- Attack Setup: Attacker captures the victim's ANonce key that is already in use
- Manipulation: Attacker manipulates and replays cryptographic handshake messages
- Key Reinstallation: Forces the client to reinstall the same encryption key
- Nonce Reset: This resets the packet counter to zero, creating nonce reuse
Technical Attack Flow
Message 1: AP → Client (ANonce)
Message 2: Client → AP (SNonce, MIC)
Message 3: AP → Client (GTK, MIC) ← Attacker blocks/delays this message
Message 4: Client → AP (Acknowledgment) ← Gets blocked by attacker
Message 3: AP → Client (Retransmission) ← Triggers key reinstallation
Impact and Capabilities
Affected Networks and Protocols
This attack works against:
- All modern protected Wi-Fi networks (both WPA and WPA2)
- Personal and enterprise networks
- All encryption ciphers: WPA-TKIP, AES-CCMP, and GCMP
Data Theft Capabilities
KRACK allows attackers to steal sensitive information including:
- Credit card numbers
- Passwords and authentication credentials
- Chat messages and emails
- Photos and other sensitive files
- Any unencrypted or weakly encrypted data in transit
Traffic Manipulation
- Decryption: Attacker can decrypt packets by exploiting keystream reuse
- Injection: Malicious packets can be injected into the network
- Forgery: Data can be forged to appear as if it comes from legitimate clients
- Manipulation: Packets in transit can be modified
Vulnerable Systems
Affected Operating Systems
All devices running the following operating systems are vulnerable to some variant of KRACK:
- Android: Most severely affected due to implementation flaws
- Linux: Significant impact on various Linux distributions
- Windows: Vulnerable to certain attack variants
- Apple (macOS/iOS): Affected by specific implementations
- OpenBSD: Vulnerable to KRACK attack variants
- MediaTek: Devices using MediaTek chipsets affected
Implementation-Specific Impact
| Operating System | Vulnerability Level | Impact Description |
|---|---|---|
| Linux/Android | Severe | Installs all-zero key, enables complete traffic decryption |
| Windows/macOS | Moderate | Reinstalls same key, allows some packet decryption |
| iOS | Limited | Reduced impact due to different implementation |
Attack Execution
Prerequisites
- Physical Proximity: Attacker must be within range of target network
- Signal Interference: Ability to interfere with Wi-Fi signals
- Connection Timing: Client must be connecting/reconnecting to network
- No User Interaction: Attack works automatically without user involvement
Step-by-Step Attack Process
-
Setup Phase
- Attacker creates fake AP with same SSID as target network
- Positions attack device within range of both victim and legitimate AP
-
Positioning Phase
- Establishes man-in-the-middle position between client and legitimate AP
-
Handshake Manipulation
- Forces client to connect through attacker's equipment
- Manipulates 4-way handshake to cause key reinstallation
-
Exploitation Phase
- Captures and decrypts victim's network traffic
- Can inject malicious content or steal sensitive data
Network Traffic Examples
HTTP Traffic Exploitation
- Passwords transmitted over unencrypted HTTP
- Email content and attachments
- Web browsing history and cookies
- API keys and authentication tokens
HTTPS Limitations
- KRACK doesn't directly break HTTPS/TLS encryption
- Enables other attacks like SSL stripping
- Metadata exposure: Which sites visited, timing patterns
- Can be combined with certificate spoofing attacks
Mitigation Strategies
Immediate Actions
- Apply OS Updates: Install patches that prevent key reinstallation
- VPN Usage: Use VPN for all network traffic
- Avoid Public Wi-Fi: Especially networks with unknown security
- Prefer Wired Connections: When physical access is available
Client-Side Fixes
- Modified Handshake Implementation: Ignore duplicate Message 3
- Key Installation Prevention: Block reinstallation of already-in-use keys
- Operating System Updates: Most vendors have released patches
Network-Level Protections
- Upgrade to WPA3: Immune to KRACK attacks
- Implement 802.11w: Management Frame Protection
- Network Monitoring: Watch for suspicious connection patterns
- Intrusion Detection: Deploy wireless intrusion prevention systems
Long-Term Solutions
- WPA3 Migration: Transition to WPA3 protocol
- Enhanced Security Protocols: Implement newer Wi-Fi security standards
- Regular Updates: Maintain current firmware and software versions
Industry Impact
Protocol Evolution
- WPA3 Development: KRACK accelerated adoption of WPA3
- SAE Protocol: WPA3's Simultaneous Authentication of Equals is immune to KRACK
- Formal Verification: Highlighted need for better cryptographic protocol design
Security Response
- Coordinated Disclosure: Responsible vulnerability disclosure process
- Widespread Patching: Major vendors released fixes within months
- Research Focus: Increased attention on Wi-Fi security research
Lessons Learned
- Protocol Flaws: Even well-established protocols can have fundamental vulnerabilities
- Client Importance: Client-side patches are essential (not just infrastructure updates)
- Implementation Variations: Different OS implementations lead to varying vulnerability levels
Conclusion
KRACK demonstrated that even mature, widely-deployed security protocols like WPA2 can contain fundamental flaws that affect billions of devices worldwide. The attack highlighted the critical importance of:
- Moving to more secure protocols like WPA3
- Maintaining up-to-date software on all network devices
- Understanding that client-side vulnerabilities require client-side fixes
- The need for continued security research and protocol evolution
The discovery of KRACK served as a wake-up call for the wireless security industry and accelerated the adoption of more robust Wi-Fi security standards.
