Introduction<br /><br />In order to obtain the key of a network with WPA/WPA2 encryption, we must capture the Handshake of some client and then decrypt it.<br />For those who don't know what the Handshake is, it is generated at the moment a device connects to a network. The pre-shared key can have a size of 8 to 63 characters, so it seems impossible to crack the key. <br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As shown in the image, the device sends a connection request to the router, the router responds asking for the access key, the device sends the access key. The router responds to that authentication, if it is correct the association to the network takes place and the router responds with an OK, that is, it associates it to the network.<br /><br />This negotiation that takes place is the Handshake and what we will do in this workshop will be to capture it and decrypt it, since the password comes encrypted inside it.<br /><br />There is no difference between cracking WPA or WPA2 networks. The authentication method is basically the same. So the techniques to use are identical.<br /><br />Placing our interface in monitor mode<br /><br />What we will do now is to see the name of our interface, for which we type the following:<br /><br />airmon-ng
<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />In my case two interfaces appear:<br /><br />Wlan2: The network card that my notebook has<br />Wlan1: My external USB Wifi<br /><br />Because my notebook's card isn't good to use with aircrack, I will use my external USB Wifi, that is, Wlan1<br />Now we will put it in monitor mode with the following command:<br /><br />airmon-ng start wlan1
<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As the image shows, it places it in monitor mode <br />(Monitor mode enablen on mon0)<br /><br />Scanning nearby networks<br /><br />To see the networks we have nearby, we will launch the following command:<br /><br />airodump-ng mon0
<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we said at the beginning of this workshop, the Handshake is generated when a client connects to the network. That is why our objective now will be to drop a connected client, and when it tries to connect again, we will capture that Handshake.<br /><br />What we must remember from this console are the following data:<br /><br />BSSID (Router's MAC)<br />STATION (Connected client's MAC)<br />CH (Channel)<br /><br />We stop the scan with the following key combination CTRL + C<br /><br />Following this, we enter the following command:<br /><br />airodump-ng mon0 --channel 1 --bssid D8:5D:4C:C7:DC:EE -w /underc0de
<br /><br />I will briefly explain the parameters of this command:<br /><br />mon0 (Our interface in monitor mode)<br />--channel (Channel)<br />--bssid (MAC of the router we will attack)<br />-w (Name of the file where the handshake will be saved)<br /><br />We will see the same screen as the previous one again, but this time we will only observe the movement being generated by the router we will catch. <br /><br />Capturing the Handshake<br /><br />In a new console, we will proceed to connect one of the connected clients to capture its Handshake, for which we will type the following command:<br /><br />aireplay-ng -0 1 -a D8:5D:4C:C7:DC:EE -c 00:25:D3:4C:1B:84 mon0
<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />In case when typing the command, an error appears like the one in the image, to the same command we add --ignore-negative-one<br /><br />aireplay-ng -0 1 -a D8:5D:4C:C7:DC:EE -c 00:25:D3:4C:1B:84 mon0 --ignore-negative-one
<br /><br />This happens because we have to apply a patch to our kernel, but the fastest way is adding the extension to the command as we did.<br /><br />When executing the command, we will see how it disconnects the connected client, and in the other console we will be able to see the following at the top:<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we can observe, the [WPA handshake D8:5D:4C:C7:DC:EE] appears<br /><br />That means we have already captured the network's Handshake. Now we can close all active consoles and start the cracking process.<br /><br />Cracking the Handshake by Brute force<br /><br />To crack the handshake by brute force, we will use John The Ripper, which is excellent for this type of tasks.<br /><br />In a console we type the following<br /><br />john –stdout:XX --incremental:YY | aircrack-ng -b D8:5D:4C:C7:DC:EE -w - /underc0de*.cap
<br /><br />In the command, the XX can be replaced by:<br /><br />alpha (only letters)<br />digits (only numbers)<br />alnum (numbers and letters)<br />all (All characters including ",.-#%&)<br /><br />The YY are the number of characters the password can have, if we place 8, John the ripper will combine from 1 to 8 characters.<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />The bad thing about this is that it can take from minutes to years to get a key. And it depends a lot on the hardware we have in our pc.<br /><br />Cracking the Handshake by Dictionary<br /><br />In order to break the key by dictionary, we will place the following command in the console:<br /><br />aircrack-ng -w diccionario.txt -b D8:5D:4C:C7:DC:EE /underc0de*.cap<br /><br />I will quickly explain the command parameters<br /><br />-w (Dictionary name)<br />-b (Router's MAC)<br /><br />And finally the name of the Handshake<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />