After the last lesson we learned that even on a Raspberry Pi 2 it is possible to crack WPA/WPA 2 passphrases with ease and even more so when we precomputed a PMK file but this requires a lot of storage for the PMK hash file and a long time at least on a RPi 2 so let’s try and speed this up even more using another attack against the Wi-Fi Protected Setup (WPS).
WPS is a different standard created by the Wi-Fi Alliance and introduced back in 2007, the goal of the protocol was to allow home users who do not understand how to use wireless security like Wi-Fi Protected Access (WPA) and may feel intimidated by it’s configuration options easily connect devices to an existing network without the need to enter a long passphrase.
Two independent researchers discovered this attack back in 2011 around the same time, Stefan Viehbock and Craig Heffner who released wash and reaver making it a trivial task to obtain the pin over the air without physical access to the access point. Stefan has a great PDF explaining this attack which is worth the read.
Put simply reaver performs a brute force attack against the access point and attempts every possible combination in order to guess the access points 8 digit pin number.
Even better yet as these are only numeric values there are a total of 10^8 or 100,000,000 possible values for any given pin number. BUT even better than that is the fact that you only actually need know half the pin 10^4 or 10,000 possible values for the first half as the access point will let you know when you have obtained the first four numbers in the pin so the actual amount of possible permutations you need is 11,000 and not 100,000,00, wait though you said 11,000, where did the extra 1,000 come from you ask? Well in the last four values of the second part of the pin you only need to calculate 10^3 or 1,000 as the last numeric value is actually a checksum which as you can imagine makes it even easier to crack than what you had been thinking a second ago 🙂
There was even a newer faster offline method released last year in 2014 by Dominique Bongard called the “Pixie Dust Attack”.
For now though let’s focus on wash and reaver so enable WPS on your access point like I have belowNow to check the access point has WPS enabled before proceeding with reaver run wash first, to see what options are available to you just type “wash” and run it for a list of switches available to youNow that we see what it can do let’s run it with some of those switches, make sure you have monitor mode enabled prior to proceeding as outlined in this previous lesson.
wash -c 6 -i mon0
“wash” runs wash
“-c” is for the channel to listen on in this case 6
“-i” is for the interface in which you want to capture packets onExplaining the output above
BSSID is our target access point MAC address
Channel 6 is the channel of our access point
RSSI is the Received signal strength indication ( A minus is a good thing here 😉
WPS Version which is 1.0
WPS Locked tells you if the access point has been locked due to to many attempts for example
ESSID is the network name of the access point
Now to run reaver against the access pointAs before just run “reaver” from the terminal for a full list of switches available to you
“reaver” runs reaver
“-i” is to select the sniffing interface in this case mon0
“-b” is followed by the target access point MAC address or BSSID
“-vv” is for very verbose output
reaver will just look like this for the next while but just leave it running and come back and check on it in an hour or so to see how it is getting on, no point staring at the screen until you get the pin!After leaving reaver running over night I was greeted with the screen below this morningAs you can see above in 12,340 seconds or 3 hours 40 minutes we obtained the PIN and passphrase for for WPA/WPA2 “AES” network that we had configured, take a minute and let that sink in as we have obtained the passphrase for an “AES” network.
Disable Wi-Fi Protected Setup (WPS) as an attacker can leverage this technology in order to bypass your WPA/WPA2 configuration including “AES” without needing to know the passphrase and also obtain it in the process, all it takes is four numeric values to take you down and that is a lot easier for an attacker to compute compared to a long and complicated password. With the option of turning this into an off-line attack this becomes even more dangerous. Also it is worth trying this against your own router if it has WPS as even if you disable this option on some routers it actually remains active! If you have one of those routers you should really replace it for one that does allow you to disable this technology or better yet one that does not contain this technology to begin with. There may also be a firmware upgrade for your router so check the manufacturers website and upgrade as it may save you having to purchase a new router.