# Wi-Fi Security

## Summary


Wi-Fi security has been a concern due to the wireless nature of access. With wired networks such as Ethernet, a hacker needed physical access to the equipment. With Wi-Fi, attacks can be launched in a vicinity where the signal can be picked up. It's therefore important to not only control who is allowed to get into a Wi-Fi network but also protect all data that's being exchanged over the network. With the coming of IoT, Wi-Fi security is likely to be more important than ever before.

Attacks on Wi-Fi can be passive such as sniffing the radio channels to pick up useful information. It can be more active such as a rogue device impersonating as an authentic access point or client. Wi-Fi security needs to address all these aspects.

## Discussion

### What does security mean in the context of Wi-Fi?

Wi-Fi security can be seen in two aspects:

    + Authentication: This controls who is allowed to log into the network. Wi-Fi clients have to provide the right credentials to connect to an access point (AP). This is usually a password but more sophisticated methods are possible using Extensible Authentication Protocol (EAP) and IEEE 802.1x. A Wi-Fi password is also called passphrase or Network Security Key. From the perspective of authentication, a client is also called supplicant.
    + Encryption: Data is encrypted so that others cannot read it.Authentication and encryption are sometimes called "security" and "privacy" respectively. These are implemented at the MAC layer, meaning that protection is only between the client and the access point. What's also important is end-to-end security. Keeping your data and network secure usually involves more than just Wi-Fi. Security protocols can be employed at different layers. IPsec protects data at the IP layer. TLS and SSL protect data at the transport/session/application layers. SSH protects data at the application layer. For browsing webpages in a secure manner, HTTPS relies on SSL/TLS. In addition, firewalls, VPNs and anti-virus software can be used. 


### What steps can I take to secure my Wi-Fi network?

The following are best practices for a secure Wi-Fi network:

    + A Wi-Fi router or access point will come with default SSID and password. Change these to non-default values. Use a strong password.
    + Periodically change the network password.
    + Enable encryption. The use of WPA2-AES is recommended. Use a Wi-Fi CERTIFIED product since it's certified for WPA2 support.
    + Since WPS is a security risk, disable this feature completely.
    + Router manufacturers often release updates including security enhancements or patches. Update your router with the latest firmware releases.
    + Allow administrative web access to your router via HTTPS and block HTTP access. Disable wireless admin access. In addition, disable remote management, so that settings can be changed only by someone with physical access to the router. Change admin credentials to non-default values. Use a strong admin password.
    + Restrict the signal to within your house by using anti-Wi-Fi paint.

### What are some myths about Wi-Fi security?

Here are some things you can do but these are not going to make your network more secure since tools exist to overcome them: 

    + Disable broadcast of SSID to prevent casual folks from trying to connect to your access point.
    + Configure access point to allow connections from a whitelist of known clients. This is usually specified with client MAC address.
    + Disable DHCP and allocate IP addresses to a limited range.
    + Reduce the range of the Wi-Fi signal but a hacker will probably use a higher gain antenna.

### What precautions can I take to secure my Wi-Fi client and its data?

The following are recommended:

    + Don't allow automatic connections to open Wi-Fi access points. These access points may be potentially dangerous. In other words, enable WPA2 security. Or configure client to prompt the user for approval before connecting.
    + Disable clients from sending out probes looking for an available access point.
    + If a client has highly sensitive data, you can allow it to connect only to a whitelist of access points.
    + Disable sharing of your connection to other devices nearby, particularly when using a public AP.
    + Use a VPN so that data is always encrypted before it leaves your device. This way, a rogue AP will be rendered useless even if Wi-Fi connection has been compromised.

### Which security protocol should I choose?

You should use the latest standards, WPA3-Personal or WPA3-Enterprise. On older devices, use Wi-Fi Protected Access II (WPA2) together with Advanced Encryption Standard (AES). For home or personal use, use WPA2-PSK, where PSK implies pre-shared key (usually called password). WPA2-Enterprise is used when the network supports additional methods of authentication. Wi-Fi Alliance has branded IEEE 802.11i as WPA2. WPA may be seen as a partial implementation of IEEE 802.11i. 

Historically, Wi-Fi security protocols include WEP (Wired Equivalent Privacy), WPA, WPA2 and WPS (Wi-Fi Protected Setup). WEP and WPS are no longer secure. WPA was designed to replace WEP on old device hardware. 

Encryption methods and integrity checks are also important. WEP uses RC4 stream cipher for encryption and CRC32 for integrity check. WPA uses RC4 (or AES if supported by device) but enhances it with Temporal Key Integrity Protocol (TKIP); and it uses a 64-bit Message Integrity Check (MIC) named MICHAEL. WPA2 uses AES, which is secure. More accurately, an AES-standard named CCMP is used. 

The use of WPA and TKIP can limit the performance of your router. There are known attacks against TKIP. 


### Are there any known vulnerabilities with WPA2?

In October 2017, "key reinstallation attacks (KRACKs)" were used successfully to read sensitive information previously assumed to be encrypted. This was not merely an implementation bug but a flaw in the WPA protocol itself. When a client wants to join a Wi-Fi network, it does a handshake that includes initialization of cryptographic keys. In this attack, the client can be tricked to reuse existing keys as well as reset counters to their initial values. 

KRACK may include arbitrary packet decryption and injection, TCP connection hijacking, HTTP content injection, or the replay of unicast and group-addressed frames. Vendors are known to provide updated firmware that fixes the KRACK vulnerability. 

WPA3 replaces WPA2 as the latest Wi-Fi security standard. Cisco has stated that they will offer WPA3 on older devices via a firmware upgrade. 


### What is WPS and should I use it?

Wi-Fi Protected Setup (WPS) was introduced into the Wi-Fi standard to simplify the setup process. Rather than enter long passwords, an 8-digit pin is used to connect a client to the access point. WPS has a few different ways that require either physical or admin access to the devices. The 8-digit pin is usually mentioned on the device hardware, be it client or router or both. 

The use of WPS is not recommended. Vulnerabilities in WPS were discovered in 2011 and a brute force attack is enough. A simple explanation of how this attack works is given by Paul Ducklin. In one case, the attack succeeded in just six hours. 


### Can you name some well-known attacks on or using Wi-Fi networks?

In 2003, an open Wi-Fi network of Lowe's became the entry point for two hackers. They accessed servers across seven US states and crashed a PoS system. In 2004, BJ's was hacked and credit card numbers were stolen. This was due to unencrypted networks and use of default credentials. BJ's incurred legal costs of about $10 million. In 2005, GE Money in Finland lost 200,000 Euros due to an unprotected Wi-Fi. In 2007, hackers exploited WEP's weaknesses and stole credit card numbers from Marshalls department store in St. Paul, Minnesota. 


### What tools or products exist to snoop a Wi-Fi network or audit its security?

For scanning the airwaves for 802.11x traffic we have Wireshark, inSSIDer, Kismet, Pwnie Express Pwn Pro, and Netstumbler. Airsnarf is one tool to impersonate an access point. Airpwn can be used to inject packets at the access point and fool the client. Airsnort and Aircrack are for attacking WEP. To simply jam the radio spectrum, Wave Bubble is one device. Aircrack and coWPAtty can be used to attack WPA. To spoof a MAC address, Nmap and MAC Shift are handy. To know if there's an unauthorized access in your network, AirSnare is useful. Default passwords for well-known products are listed publicly. 

## Milestones

1999

WEP is standardized as the security protocol for Wi-Fi. 

2001

Berkeley researchers discover vulnerabilities in WEP. 

2003

WPA is ratified by Wi-Fi Alliance as a replacement to the vulnerable WEP. 

2004

Due to WPA's weak integrity check using MICHAEL, WPA2 comes out. It's a complete implementation of IEEE 802.11i standard. 

Mar  
2006

Wi-Fi Alliance requires that all devices must be WPA2 certified in order to use the Wi-Fi trademark. 

Jan  
2007

WPS is officially launched by Wi-Fi Alliance. 

Dec  
2011

WPS is found to be vulnerable to brute force attacks. There are design flaws in WPS and also implementation flaws in many popular Wi-Fi routers. 

Jun  
2018

Wi-Fi Alliance releases WPA3 that aims to "simplify Wi-Fi security, enable more robust authentication, and deliver increased cryptographic strength for highly sensitive data markets". This is a welcome news given that WPA2 was compromised in October 2017. 

Apr  
2019

Researchers discover vulnerabilities in WPA3's Dragonfly key exchange. These vulnerabilities are collectively termed **Dragonblood**. Wi-Fi Alliance announces an update to the WPA3 to fix these vulnerabilities. Vendors can push this to existing devices via a software update.