Wednesday, August 29, 2012

Wireless Hacking: Hacking WPS enabled AccessPoints

Just when you think you are safe with WPA2 and a PSK over 20 characters long something like this comes along.
It seems that most vendors have WPS enabled as a default setting, so was my Belkin home AP.
In this tutorial i will go through the steps of how i hacked my WPS enabled AccessPoint.
For more information about WPS (Wifi protected Setup) see:


Prerequisites:
- A wireless card supporting monitor mode
- Backtrack distribution: (I used Backtrack 5 R2) or
  Reaver WPS from http://code.google.com/p/reaver-wps/

First you need to set your wireless card in monitor mode:


To find WPS enabled accesspoints we can use the command "wash" included in Backtrack 5
This command also shows if the WPS is locked, the channel the AP is running on and the BSSID and ESSID of the AP as well as RSSI which is the receive signal strength.



Above we see an AP on Channel 6 with ESSID: SSID-1 that has WPS version 1.0 enabled and RSSI of -30 which means we are close to the AP.


Brute forcing WPS PIN:

open 2 command windows.
In window 1 run:



Explainations to reaver command-line : -c channel, -A no association, -E Send EAP terminate, -N no acks, -vv very verbose (if you want to see all login attempts)



In window 2 run:

You might need to test the appropriate timing values depending on how close you are to the AP.

After a long while you should see this in window 1
For some reason i do not always get the WPA PSK echoed out like above.
What you can do then is to test the PIN with:
reaver -i mon0 -b XX:XX:XX:XX:XX:XX -c 6 -p <PIN>

After the PIN is discovered and verified. Get WPA-PSK with the below method.
Create a wpa_supplicant.conf including the lines below

Run wpa_supplicant

Run wpa_cli

wpa_cli wps_reg <BSSID> <PIN>   # wait for CONNECTED

save_config

Check your saved wpa_supplicant.conf with

cat wpa_supplicant.conf

It should now show you the PSK in clear text.


Hope you find the above useful.

Note:
I wrote this tutorial for reference and in good intentions.
Before you go ahead and hack your neighbours AP ask for permission!
I am not responsible what you do with the above information!
Cheers.

/M

3 comments:

  1. Is there any way to reset reaver so it will start over trying all pins for an access point?
    I tried it with a 4 digit pin which was apparently wrong and now I want to start over but reaver keeps trying the last one over and over.

    ReplyDelete
  2. I think you can edit the session file or just delete the file to restart.
    My files are in /usr/local/etc/reaver
    /M

    ReplyDelete