Wi-Fi Brute Force Attacks

By Michael Spalter
June 2021

About the author

Michael Spalter

Michael Spalter


Michael Spalter has been a networking technician for over 30 years and has been the CEO of DrayTek in the UK since the company’s formation in 1997. He has written and lectured extensively on networking topics. If you’ve an idea for a blog or a topic you’d like explored, please get in touch with us.


How does a Wi-Fi brute force attack work?

If a hacker wants to access your network wirelessly, he/she will need its password. They might just be able to get it by seeing it written on a whiteboard, post-it note or by using another social engineering method. If they can't get the Wi-Fi password, just as if a burglar doesn't have a key to your apartment, he/she has to use brute force to get in.  

When authenticating with a password protected network, the client doesn't send the actual password across the link as that would be easy to intercept before the encryption is active and make the encryption pointless (like saying a password out loud). Instead, the AP router and client device each generate a code called the  Preshared Master Key (PMK) using a process called Password-Based Key Derivation (PBKD).  The PBKD function itself is computationally costly (it requires non-trivial processing power), deliberately, to increase the computational cost of brute-force attacks (i.e. you need a powerful computer to run attacks quickly enough).

The PMK is not sent across the link either.  A 4-way handshake is performed in which both ends confirm that they know the same PMK without actually disclosing what it is across the link. The 4-way handshake sends a Message Integrity Code (MIC) value between the two ends.   This type of key establishment is known as a Zero Knowledge Proof (ZKP). Both ends then generate a Pairwise Transient Key (PTK) which they use to actually encrypt your data. 

A hacker wishing to attack your WLAN will firstly capture data from the live target wireless LAN.  He/she can do that from anywhere that they can get a signal, so typically outside of your building. That capture includes the elements within the 4-way handshake which forms the ZKP routine.  The 4-way handshake only occurs when a legitimate client authenticates so the capture must include a period when that occurs. Alternatively, one can run a de-authentication attack, forcing clients to reconnect and instigate the 4-way handshake again, for you to capture.

A dictionary is a large file of commonly used passwords (11111, password, qwerty, abc123 etc). A widely used (popular) such file contains 15 million used passwords and those 15 million, and combinations thereof can be run through very quickly. It's for that reason that you should use complex passwords - mixtures of words, numbers and symbols, e.g. "dr@yt3k%_routER5" - if you made that up, it would be unique and never in any dictionary.

In the case of a dictionary attack, a password from the dictionary is read and the PMK and the PTK values are calculated for that password. The PTK is then used to calculate a MIC value. If the MIC value calculated is equal to that within the 4-way handshake, then you've got a match - you now know the wireless password, and remember that this cracking is performed on the attackers device - he/she doesn't need to submit any passwords to the wireless network for checking until the correct password is known.

Cracking a password using brute force is very complicated requiring a detailed understanding of many different protocols and the underlying maths however there are off-the-shelf tools, downloadable free of charge which automate the whole process. That make it easy for someone with little technical knowledge to crack a network.  It does, however, still require a lot of computing power. This blog suggests it takes many years even on a cloud GPU, which is beyond the casual hacker's means.

To protect against brute force attacks, use complex passwords - long, with mixed alphanumeric, upper/lower case and special characters and control who you give those passwords to or where they are written.  In a corporate environment, you may also consider 802.1x/WPA-Enterprise methods of authentication.

Although this article is about brute force attacks, the methods describe still rely on weaknesses in the underlying protocols.  It's not a bug in the product or vendor's code - it's a flaw in the design of the protocol which the vendor must follow in order to comply with the standard. 

There may also be flaws in the individual chipset or device implementation of a protocol. WPA2 was vulnerable to flawed code dubbed the Krack attack  and more recently, an attack known as Kr00K (CVE 2019-15126) was discovered by researchers looking at chipsets from Cypress and Broadcom. Kr00k is well explained in this article (external link) and whilst it seems like a really simple flaw it still wasn't discovered for many years.  A variant of Kr00k (CVE 2020-3702) was later found to also affect MediaTek and Qualcomm chipsets.  You, most likely, won't know which chipset your wireless device uses but the four vendors mentioned here provide nearly all of the world's wireless chipsets - so that means most of your wireless devices, including your mobile phones.

The new WPA3 protocol, a replacement for the current wireless security method, WPA2, mitigates against brute force attacks by using a different cryptographic method whereby authentication has to happen on a live network; you cannot test keys offline.  This means that the wireless access point (or router) can limit tries and block clients who make too many failed attempts.  Whilst WPA3 has many improvements and its design learnt heavily from the experience and flaws of WPA2, it's inevitable that flaws would be found eventually and indeed, in 2019, flaws were already found in the WPA3 specification, which the WiFi Alliance fixed, but the fix then introduced new flaws itself (external link).

In all cases, check that your clients and/or wireless bases/routers have been patched with the latest firmware/software to fix these issues (where relevant) and keep your devices up to date to address any new, as yet undiscovered, vulnerabilities. 

Whilst O/S and mainstream product vendors may issue patches firmware updates regularly, IoT (Internet of Things) devices or any other products which one 'installs and forgets about' in particular, are updated by users far less frequently - perhaps never.  This includes home automation, alarm systems, cars (automobiles), games consoles, home audio/video, connected ovens/fridges/microwaves, industrial monitoring sensors, CCTV, wireless access points, phones (cellular and IP phones), PBXs, NVR, NAS etc. - if you have any of those devices, keep them up to date.  A particular problem category is 'low cost home automation products' such as light switches or plug-top power controllers which come from unknown vendors and you have no idea where to get or check firmware even if it is available. It's not just wireless issues -  many embedded devices are built around very old versions of operating systems and code libraries. An attitude of "no-one's going to bother hacking this" by the vendor or the end user is simply not good enough.

Thanks for reading and, as always, send us your suggestions for topics and please do share the links to these blogs!


Tags

Encryption
WPA2
WPA3
WPA3-Personal
WPA3-Enterprise
SAE
PSK
WAP
Brute Force