Advanced Network Security
WiFi security
Harald Vranken
1
WiFi security Harald Vranken 1 Agenda WiFi security WEP WPA(2) - - PowerPoint PPT Presentation
Advanced Network Security WiFi security Harald Vranken 1 Agenda WiFi security WEP WPA(2) WPA3 2 WiFi IEEE 802.11 standard Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications original
1
2
– Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications – original version 1997; latest version 2016 – ~3500 pages!
– Station (STA) is a device with WiFi capability – Access Point (AP) is a station that other stations can connect to to get access to a network, also referred to as authenticator – Supplicant, used to indicate the client when authenticating – SSID (Service Set Identifier) is the name of the network – MIC: Message Integrity Check (is in fact Message Authentication Code (MAC), but prevents confusion with MAC addresses)
3
– Wireless Equivalent Privacy (WEP, 1999) – WiFi Protected Access (WPA, 2003)
– Does not provide real security
4
across the world (2016)
Source: https://securelist.com/research-on-unsecured-wi-fi-networks-across-the-world/76733/
5
– Also used for public hotspots with captive portal – Attacker can eavesdrop on all network traffic
– Possible to filter based on MAC address, but can easily be spoofed
6
– Malicious access point pretends to be a preferred network of user – When user connects, attacker can sniff all traffic and act as man-in-the-middle
– Vulnerable client devices broadcast ‘preferred network list’ (PNL), containing SSIDs of access points to which client has previously connected – Malicious access point receives PNL and takes an SSID from PNL
Dai Zovi, D. A., & Macaulay, S. A. (2005). Attacking Automatic Wireless Network Selection Proceedings from the 6th Annual IEEE SMC Information Assurance Workshop, p. 365–372
7
Authentication
between client and access point
8
Data encryption – Rivest Cipher 4 (RC4) stream cipher – preshared WEP key
A key recovery attack on the 802.11b wired equivalent privacy protocol (WEP) by A. Stubbleleld, J. Ioannidis, and A. D. Rubin ACM Trans. Inf. Syst. Security, vol. 7, no. 2, pp. 319–332, May 2004 Breaking 104 bit WEP in less than 60 seconds by E. Tews, R.-P. Weinmann, and A. Pyshkin Information Security Applications, Lecture Notes in Computer Science, vol. 4867, pp. 188–202, 2007
9
– Personal network – Pre-shared key (PSK)
– Enterprise network – Authentication server – IEEE 802.1x authentication using Extensible Authentication Protocol (EAP)
10
Authentication WPA Personal PSK WPA Enterprise 802.1x WPA2 Personal PSK WPA2 Enterprise 802.1x
– As WEP, based on RC4 stream cipher – Also included in WPA2 for backwards compatibility – Deprecated in IEEE 802.11 standard – Known to have biases that can be exploited to break it – Possible to inject and decrypt packets – Attack only takes about an hour, relies on generation of identical packets
All Your Biases Belong To Us: Breaking RC4 in WPA-TKIP and TLS by Mathy Vanhoef and Frank Piessens, Usenix Security 2015
– Most widely-used – Based on AES
– Being rolled out (WiGig)
11
Confidentiality WPA Personal TKIP WPA Enterprise TKIP WPA2 Personal CCMP WPA2 Enterprise CCMP
CCMP/ GCMP encryption Construct CCMP/GCMP header
12
Authentication Confidentiality WPA Personal PSK TKIP WPA Enterprise 802.1x TKIP WPA2 Personal PSK CCMP WPA2 Enterprise 802.1x CCMP
– Find nearby networks – Networks announce capabilities
– Typically ‘Open’ (designed for WEP)
– Cipher suites – Agreement on security algorithms
– Mutual authentication
13
Authentication request Authentication response Association request(security parameters) Association response 802.1x authentication 4-way handshake Data Probe request Probe response (security parameters)
– KCK (Key Confirmation Key): used for message authentication in 4-way handshake – KEK (Key Encryption Key): used for encryption of keys – TK (Temporal Key): key used for confidentiality and integrity of the data
used for broadcast and multicast traffic
14
using a key derivation function (KDF) – PSK = KDF(password, SSID)
15 KDF Password SSID PRF ANonce, MAC address A, SNonce, MAC address S KCK KEK TK 4-way handshake PTK PSK/PMK Authentication request Authentication response Association request(security parameters) Association response 802.1x authentication 4-way handshake Data Probe request Probe response (security parameters)
1.
2. perform offline brute-force attack on password (eg. dictionary attack or rainbow table attack) 3.
– Connect to the network – Eavesdrop on other users, if 4-way handshake is observed (can be enforced by sending a deauthentication message to the client and access point)
16 KDF Password SSID PRF ANonce, MAC address A, SNonce, MAC address S KCK KEK TK 4-way handshake PTK PSK/PMK
– Usernames and passwords – Certificates
– Eg. used in eduroam
17
– Typically a RADIUS server (Remote Authentication Dial-In User Service)
– TLS (Transport Layer Security) – PEAP (Protected Extensible Authentication Protocol) – TTLS (Tunnelled TLS)
18
EAPOL/RADIUS EAP TLS EAP inner authentication method EAPOL RADIUS Supplicant (client) Authenticator (AP) Authentication server (Identity provider)
– All users need a public key pair and corresponding certificate
19
EAPOL RADIUS Supplicant (client) Authenticator (AP) Authentication server (Identity provider)
20
4-way handshake EAP request: Identity EAP response: Identity EAP Start: EAP-PEAP RADIUS Access request: identity Authentication and key exchange inside TLS tunnel RADIUS Access accepted: key material RADIUS Start: EAP-PEAP EAP Success Anonymous identity (if configured) 802.11 Association
– Typically only server authentication
– In particular MS-CHAPv2 (Microsoft Challenge-Handshake Authentication Protocol v2) (mutual authentication using username/password combination)
21
– provide a TLS tunnel to use legacy authentication methods (inner authentication method)
– Not only ones that have EAP support – Eg. PAP (Password Authentication Protocol) and MS-CHAPv2
22
– RFC 7593 ‘The eduroam Architecture for Network Roaming’
– 801.2x authentication – Users authenticate with the login data of their home institutes – Federated authentication: authentication delegated to home institute – Routing based on domain (eg. ru.nl in anonymous@ru.nl)
23
Outer authentication 1. User requests network access (eg. anonymous@ru.nl) 2. AP forwards user identity to home AS
user's identity, until user's home AS (RU) is found) – Top-level RADIUS Server (eg. Europe or Asia and Pacific region) – Federation-Level RADIUS servers (eg. SURF for .nl) 3. Check identity, tunnel establishment, servers sends certificate, user validates server certificate
24
Inner authentication 4. Authentication inside tunnel between client and user’s home AS, using user’s credentials of home institution 5. User's home AS validates login data and passes result to the AP, which grants or refuses access
25
A Practical Investigation of Identity Theft Vulnerabilities in Eduroam
Proceedings of the 8th ACM Conference on Security & Privacy in Wireless and Mobile Networks, 2015
26
– With TLS in HTTPS, certificate should be bound to domain (CN-common name); with WPA(2) Enterprise, CN should contain hostname of RADIUS server – Client may accept certificates signed by intermediate CAs (and such certificate can easily be obtained) – Client that trusts certificate on first use, stores it (has to be removed)
27
– None → anyone can impersonate your network (evil twin attack) – Public CA → anyone can impersonate your network, as long as you do not configure the RADIUS hostnames – Dedicated/private CA → impersonation is not possible (assuming no keys are compromised)
– Client using PAP → username/password are sent in plaintext – Client using MSCHAPv2 → may still be cracked (depends on password strength) – Potentially worse than no encryption!
28
29
Authentication WPA Personal PSK WPA Enterprise 802.1x WPA2 Personal PSK WPA2 Enterprise 802.1x
Authentication request Authentication response Association request(security parameters) Association response 802.1x authentication 4-way handshake Data Probe request Probe response (security parameters)
SNonce, MIC ANonce, MIC, EncKEK(GTK) MIC Derive PTK Derive PTK Encrypted data frames Install PTK and GTK Install PTK ANonce
– Based on a shared secret (PMK-Pairwise Master Key) – Can be pre-shared key (in personal network)
– Verify whether both know PMK
– Derived from PMK, nonces of user (supplicant) and access point (authenticator), and their MAC addresses – Split into KCK, KEK, and TK
30
Authentication request Authentication response Association request(security parameters) Association response 802.1x authentication 4-way handshake Data Probe request Probe response (security parameters)
31
2: SNonce, MIC 3: ANonce, MIC, EncKEK(GTK) 4: MIC Derive PTK Derive PTK Encrypted data frames Install PTK and GTK Install PTK 1: ANonce
specifications and implementations
– WiFi designed to cope with packet loss (replay counters) – Forces nonce reuse (of encrypted data frames) – All WPA(2) methods use stream ciphers for encryption
Key Reinstallation Attacks: Forcing Nonce Reuse in WPA2 by M. Vanhoef and F. Piessens Proceedings of the 24th ACM Conference on Computer and Communication Security (CCS 2017)
32
SNonce, MIC ANonce, MIC, EncKEK(GTK) MIC Derive PTK Derive PTK Encrypted data frames Install PTK and GTK Install PTK ANonce
33
Replay counter
Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg4(r+1, MIC) Derive PTK Derive PTK Encrypted data frames Install PTK and GTK Install PTK Msg1(r, ANonce)
34
Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg4(r+1, MIC) Derive PTK Derive PTK Encrypted data frames Install PTK and GTK Install PTK Msg1(r, ANonce) Reset nonce and replay counter
35
Establish MITM between supplicant and authenticator (AP clone with same MAC address on different channel) block Retransmit Msg3
Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg4(r+1, MIC) Install PTK and GTK Msg1(r, ANonce) Msg1(r, ANonce) Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) EncPTK(1, Msg4(r+2, MIC)) Install PTK and GTK
Key reinstalled and nonce reset
36
Establish MITM between supplicant and authenticator (AP clone with same MAC address on different channel) block
Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg4(r+1, MIC) Install PTK and GTK Msg1(r, ANonce) Msg1(r, ANonce) Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) EncPTK(1, Msg4(r+2, MIC)) Install PTK and GTK EncPTK(1, Data(…)) EncPTK(1, Data(…))
Same nonce is used!
37
Keystream Plaintext data Encrypted data Mix PTK (session key) Nonce (packet number) Packet key Keystream Encrypted data
38
Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg4(r+1, MIC) Install PTK and GTK Msg1(r, ANonce) Msg1(r, ANonce) Msg2(r, SNonce, MIC) Msg3(r+1, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) Msg3(r+2, ANonce, MIC, EncKEK(GTK)) EncPTK(1, Msg4(r+2, MIC)) Install PTK and GTK EncPTK(1, Data(…)) EncPTK(1, Data(…))
Keystream Decrypted data!
– Replay towards victim – Decrypted from victim
– Used for fast roaming within corporate networks
– TKIP: recover MIC key from plaintext → forge/inject frames from victim – CCMP: no practical forging attacks – GCMP: recover authentication key → forge/inject frames from and to victim
39
– Do not allow resending Msg3
40
– MAC address – Broadcasted SSIDs by client – 802.1x identity
– Wrong configuration can lead to compromise of network access and credentials
41
42
– Opportunistic Wireless Encryption (OWE)
– Simultaneous Authentication of Equals (SAE)
43
(open or with publicly known pre-shared key)
– Client adds public Diffie-Hellman value to association request – Access point adds public Diffie-Hellman value to association response
44
– Based on zero-knowledge proof – Prevents dictionary attacks – One guess per session – Forward secrecy
45
– Commitment exchange – Confirmation exchange
– group element derived from password and MAC addresses of both parties involved
– Subsequently used in the 4-way handshake to establish session keys
46
47 47 commitScalarS, commitElementS Generate random scalars randA and maskA Derive PWE commitScalarA = (randA + maskA) mod r commitElementA = PWE-maskA commitScalarA, commitElementA HMACKCK(commitScalarS, commitElementS, commitScalarA, commitElementA) Generate random scalars randS and maskS Derive PWE commitScalarS = (randS + maskS) mod r commitElementS = PWE-maskS HMACKCK(commitScalarA, commitElementA, commitScalarS, commitElementS) Compute shared secret K = (PWEcommitScalarA * commitElementA)randS Derive KCK and PMK Compute shared secret K = (PWEcommitScalarS * commitElementS)randA Derive KCK and PMK Authentication accepted
Read the following paper (mandatory):
Proceedings 8th ACM Conference on Security & Privacy in Wireless and Mobile Networks, 2015
Proceedings 24th ACM Conference on Computer and Communication Security, 2017 (Note: you may skip sections 4, 5, and 7)
48