cracking_wpa
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cracking_wpa [2008/07/15 15:19] – Added how to confirm the deauthentication technique darkaudax | cracking_wpa [2010/03/07 16:09] – removed useless comment (it was updated for mac80211 some time ago) mister_x | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tutorial: How to Crack WPA/WPA2 ====== | ====== Tutorial: How to Crack WPA/WPA2 ====== | ||
- | Version: 1.16 July 15, 2008\\ | + | Version: 1.19 February 12, 2010\\ |
By: darkAudax | By: darkAudax | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This tutorial walks you through cracking WPA/WPA2 networks which use pre-shared keys. I recommend you do some background reading to better understand what WPA/WPA2 is. The [[http:// | + | This tutorial walks you through cracking WPA/WPA2 networks which use pre-shared keys. I recommend you do some background reading to better understand what WPA/WPA2 is. The [[http:// |
WPA/WPA2 supports many types of authentication beyond pre-shared keys. [[aircrack-ng]] can ONLY crack pre-shared keys. So make sure [[airodump-ng]] shows the network as having the authentication type of PSK, otherwise, don't bother trying to crack it. | WPA/WPA2 supports many types of authentication beyond pre-shared keys. [[aircrack-ng]] can ONLY crack pre-shared keys. So make sure [[airodump-ng]] shows the network as having the authentication type of PSK, otherwise, don't bother trying to crack it. | ||
Line 15: | Line 15: | ||
The impact of having to use a brute force approach is substantial. | The impact of having to use a brute force approach is substantial. | ||
+ | |||
+ | **IMPORTANT** This means that the passphrase must be contained in the dictionary you are using to break WPA/ | ||
There is no difference between cracking WPA or WPA2 networks. | There is no difference between cracking WPA or WPA2 networks. | ||
Line 35: | Line 37: | ||
===== Equipment used ===== | ===== Equipment used ===== | ||
- | |||
- | To follow this tutorial at home, you must have two wireless cards. | ||
In this tutorial, here is what was used: | In this tutorial, here is what was used: | ||
Line 64: | Line 64: | ||
- Use aireplay-ng to deauthenticate the wireless client | - Use aireplay-ng to deauthenticate the wireless client | ||
- Run aircrack-ng to crack the pre-shared key using the authentication handshake | - Run aircrack-ng to crack the pre-shared key using the authentication handshake | ||
- | |||
==== Step 1 - Start the wireless interface in monitor mode ==== | ==== Step 1 - Start the wireless interface in monitor mode ==== | ||
The purpose of this step is to put your card into what is called monitor mode. Monitor mode is the mode whereby your card can listen to every packet in the air. Normally your card will only " | The purpose of this step is to put your card into what is called monitor mode. Monitor mode is the mode whereby your card can listen to every packet in the air. Normally your card will only " | ||
+ | |||
+ | The exact procedure for enabling monitor mode varies depending on the driver you are using. To determine the driver (and the correct procedure to follow), run the following command: | ||
+ | |||
+ | | ||
+ | |||
+ | On a machine with a Ralink, an Atheros and a Broadcom wireless card installed, the system responds: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | The presence of a [phy0] tag at the end of the driver name is an indicator for mac80211, so the Broadcom card is using a mac80211 driver. **Note that mac80211 is supported only since aircrack-ng v1.0-rc1, and it won't work with v0.9.1.** | ||
+ | Both entries of the Atheros card show " | ||
+ | Finally, the Ralink shows neither of these indicators, so it is using an ieee80211 driver - see the generic instructions for setting it up. | ||
+ | |||
+ | === Step 1a - Setting up madwifi-ng === | ||
Line 132: | Line 150: | ||
http:// | http:// | ||
+ | === Step 1b - Setting up mac80211 drivers === | ||
+ | |||
+ | Unlike madwifi-ng, you do not need to remove the wlan0 interface when setting up mac80211 drivers. Instead, use the following command to set up your card in monitor mode on channel 9: | ||
+ | |||
+ | | ||
+ | |||
+ | The system responds: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | Notice that airmon-ng enabled monitor-mode //on mon0//. So, the correct interface name to use in later parts of the tutorial is mon0. Wlan0 is still in regular (managed) mode, and can be used as usual, provided that the AP that wlan0 is connected to is on the same channel as the AP you are attacking, and you are not performing any channel-hopping. | ||
+ | |||
+ | To confirm successful setup, run " | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | Retry min limit: | ||
+ | | ||
+ | Power Management: | ||
+ | Link Quality: | ||
+ | Rx invalid nwid: | ||
+ | Tx excessive retries: | ||
+ | |||
+ | | ||
+ | Retry min limit: | ||
+ | | ||
+ | Power Management: | ||
+ | Link Quality: | ||
+ | Rx invalid nwid: | ||
+ | Tx excessive retries: | ||
+ | |||
+ | |||
+ | Here, mon0 is seen as being in monitor mode, on channel 9 (2.452GHz). Unlike madwifi-ng, the monitor interface has no Access Point field at all. Also notice that wlan0 is still present, and in managed mode - this is normal. Because both interfaces share a common radio, they must always be tuned to the same channel - changing the channel on one interface also changes channel on the other one. | ||
+ | |||
+ | === Step 1c - Setting up other drivers === | ||
+ | |||
+ | For other (ieee80211-based) drivers, simply run the following command to enable monitor mode (replace rausb0 with your interface name): | ||
+ | |||
+ | | ||
+ | |||
+ | The system responds: | ||
+ | |||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | At this point, the interface should be ready to use. | ||
==== Step 2 - Start airodump-ng to collect authentication handshake ==== | ==== Step 2 - Start airodump-ng to collect authentication handshake ==== | ||
- | The purpose of this step is run airodump-ng to capture the 4-way authentication handshake for the AP we are interested in. | + | The purpose of this step is to run airodump-ng to capture the 4-way authentication handshake for the AP we are interested in. |
Enter: | Enter: | ||
Line 143: | Line 218: | ||
Where: | Where: | ||
*-c 9 is the channel for the wireless network | *-c 9 is the channel for the wireless network | ||
- | *-'''' | + | *-'''' |
*-w psk is the file name prefix for the file which will contain the IVs. | *-w psk is the file name prefix for the file which will contain the IVs. | ||
*ath0 is the interface name. | *ath0 is the interface name. | ||
Line 180: | Line 255: | ||
To see if you captured any handshake packets, there are two ways. Watch the airodump-ng screen for " WPA handshake: 00: | To see if you captured any handshake packets, there are two ways. Watch the airodump-ng screen for " WPA handshake: 00: | ||
- | use Wireshark and apply a filter of " | + | Use Wireshark and apply a filter of " |
==== Step 3 - Use aireplay-ng to deauthenticate the wireless client ==== | ==== Step 3 - Use aireplay-ng to deauthenticate the wireless client ==== | ||
- | This step is optional. | + | This step is optional. If you are patient, you can wait until airodump-ng captures a handshake when one or more clients connect to the AP. You only perform this step if you opted to actively speed up the process. |
- | What this step does is send a message to the wireless client saying that that it is no longer associated with the AP. The wireless client will then hopefully reauthenticate with the AP. The reauthentication is what generates the 4-way authentication handshake we are interested in collecting. | + | This step sends a message to the wireless client saying that that it is no longer associated with the AP. The wireless client will then hopefully reauthenticate with the AP. The reauthentication is what generates the 4-way authentication handshake we are interested in collecting. |
Based on the output of airodump-ng in the previous step, you determine a client which is currently connected. | Based on the output of airodump-ng in the previous step, you determine a client which is currently connected. | ||
Line 289: | Line 364: | ||
* Make sure to use the drivers specified on the wiki. Depending on the driver, some old versions do not capture all packets. | * Make sure to use the drivers specified on the wiki. Depending on the driver, some old versions do not capture all packets. | ||
* Ideally, connect and disconnect a wireless client normally to generate the handshake. | * Ideally, connect and disconnect a wireless client normally to generate the handshake. | ||
- | * If you use the deauth technique, send the absolute minimum of packets to cause the client to reauthenticate. | + | * If you use the deauth technique, send the absolute minimum of packets to cause the client to reauthenticate. |
* Try stopping the radio on the client station then restarting it. | * Try stopping the radio on the client station then restarting it. | ||
* Make sure you are not running any other program/ | * Make sure you are not running any other program/ | ||
* Review your captured data using the [[wpa_capture|WPA Packet Capture Explained tutorial]] to see if you can identify the problem. | * Review your captured data using the [[wpa_capture|WPA Packet Capture Explained tutorial]] to see if you can identify the problem. | ||
- | Unfortunately, | + | Unfortunately, |
Another approach is to use Wireshark to review and analyze your packet capture. | Another approach is to use Wireshark to review and analyze your packet capture. | ||
Line 302: | Line 377: | ||
When using Wireshark, the filter " | When using Wireshark, the filter " | ||
- | To dig deep into the packet analysis, you must start airodump-ng without a BSSID filter and specify the capture of the full packet, not just IVs. Needless to say, it must be locked to the AP channel. | + | To dig deep into the packet analysis, you must start airodump-ng without a BSSID filter and specify the capture of the full packet, not just IVs. Needless to say, it must be locked to the AP channel. |
- | Every packet sent by client or AP must be acknowledged. | + | Every packet sent by client or AP must be acknowledged. |
When it comes to analyzing packet captures, it is impossible to provide detailed instructions. | When it comes to analyzing packet captures, it is impossible to provide detailed instructions. | ||
Line 317: | Line 392: | ||
Check the "I Cannot Capture the Four-way Handshake!" | Check the "I Cannot Capture the Four-way Handshake!" | ||
- |
cracking_wpa.txt · Last modified: 2022/01/02 21:34 by mister_x