Saltar al contenido
Underc0de /foro

Wireless Security Workshop #4

🌐 This is an automatic translation of a topic from Underc0de, the largest Spanish-speaking hacking and IT community. Read the original (Spanish) and reply →
ANTRAX ·
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />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 be from 8 to 63 characters long, 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, and if it's correct the association to the network occurs 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 is capture it and decrypt it, since the password comes encrypted within 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 see the name of our interface, for that 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 there are two interfaces:<br /><br />Wlan2: The network card my notebook has<br />Wlan1: My external Wifi USB<br /><br />Because my notebook's card is not suitable to use with aircrack, I will use my external Wifi USB, 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 at the time a client connects to the network. That's 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 that, 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 like the one in the image appears, we add --ignore-negative-one to the same command<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 in the upper part:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we can observe, [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 task.<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 with:<br /><br />alpha  (only letters)<br />digits  (only numbers)<br />alnum   (numbers and letters)<br />all  (All characters including ",.-#%&)<br /><br />The YY is the number of characters the password can have, if we put 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 />To be able to break the key by dictionary, we will enter 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 /><br /><br />
Gabriela ·
<br />Excellent contribution! Thanks.<br /><br />G.<br /><br />PS: Be good.  ;D
Ruleman ·
Downloading and saving.<br /><br />Thanks.
herculano ·
Good morning, a question, where can dictionaries be obtained from?
blackdrake ·
Cita de: herculano en Septiembre 30, 2014, 06:36:37 AM<br />good morning a question where can dictionaries be obtained?<br />
<br /><br />I leave you some links and some websites where you can download them:<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Depending on what for, you will need to download one or another.<br /><br />Regards.
herculano ·
Cita de: blackdrake en Septiembre 30, 2014, 06:44:55 AM<br />
Cita de: herculano en Septiembre 30, 2014, 06:36:37 AM<br />good morning a question where can dictionaries be obtained?<br />
<br /><br />I leave you some links and some websites where you can download them:<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Depending on what for, you will need to download one or another.<br /><br />Regards.<br />
<br /><br />thank you very much blackdrake  :) :) :) :)
herculano ·
I have a problem, I enter this command to perform brute force with my router<br /> john -stdout: all --incremental:10 | aircrack-ng -b  MAC -w - mia-01.cap<br /><br />and this comes up:<br /><br />
Código: text
Password files specified, but no option would use them<br />Opening mia-01.cap<br />Reading packets, please wait...<br /><br />                                 Aircrack-ng 1.2 beta3<br />Passphrase not in dictionary                            <br /><br />Quitting aircrack-ng...
<br />but the problem is it doesn't even take 1 second and that comes up<br /><br /><br />can anyone help me?
ANTRAX ·
Try it like this:<br /><br />john –stdout –incremental:all | aircrack-ng -b MAC -w – fichero.cap<br /><br />Remember to be standing in the directory where the .cap is located<br /><br />Regards!<br />ANTRAX
herculano ·
That's how it works Antrax thanks! and does it test all types of passwords of all character lengths? because "all" means all letters, symbols, numbers but where do you put the password character length?
ANTRAX ·
You can modify that as the paper shows.<br /><br />john –stdout –incremental:10 | aircrack-ng -b MAC -w – fichero.cap
herculano ·
Hello good afternoon I have a question when I<br />write this code:<br /><br />
Código: text
aireplay-ng -0 7676 -a MAC BSSID -c MY MAC mon0
<br /><br />And it responds this to me:<br />
Código: text
<br />13:07:38  Waiting for beacon frame (BSSID: MAC BSSID) on channel 1<br />13:07:40  Sending 64 directed DeAuth. STMAC: [MY MAC][ 0|36 ACKs]<br />13:07:40  Sending 64 directed DeAuth. STMAC: [MY MAC][ 0|44 ACKs]
<br /><br /><br />And it doesn't come up like in your tutorial where for example [ 47|36 ACKs] comes up<br />and I don't understand the reason the network card is the same
Grupo de WhatsApp