Saltar al contenido
Underc0de /foro

Wireless Security Workshop #5

🌐 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 />It is widely known that WEP encryption is highly vulnerable. Over time, this security improved, becoming WPA and later WPA2; the latter is much more secure than the first two mentioned.<br /><br />As we move further along the timeline, routers and the ways of connecting to them have evolved to such an extent that WPS appeared. WPS, although not an encryption method itself, is a more practical and convenient connection mechanism that spares us from having to remember passwords that we (perhaps) might forget.<br /><br />Although a large majority of users have WPA or WPA2 on their routers, many have WPS enabled. <br />WPS provides 4 different credential exchange methods, but only 2 are certified, namely:<br /><br />-PBC (Push Button Connect). This method consists of pressing the button on both the wireless device and the router. The link will remain active until the connection is established or for 2 minutes. This button can be physical or virtual.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />-PIN. In this case, the user must enter the PIN located on the bottom of the router into the PC, and the connection is then made.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we mentioned before, these are easier ways to connect a device to a router and -in most cases- it is done by exchanging an 8-digit numeric PIN, where the device sends this PIN to the router and, if it is correct, the router lets it through.<br /><br />This PIN is written on the bottom of the router, but there are several ways to find it out. The objective of this workshop is -precisely- to show how we can obtain it. We will also see that it is much easier to obtain this PIN than to break the WPA/WPA2 Handshake. <br /><br />One point that is worth highlighting is that WPS is only available on networks with WPA/WPA2; and that it is not a security encryption but an installation/configuration convenience for users.<br /><br />
<br /> <br />
LAB PREPARATION
<br /><br />For the purposes of this workshop, we have prepared a router with WPA2 and WPS enabled.<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 />
<br /><br />
LOOKING FOR A TARGET...
<br /><br />It is worth recalling that this workshop can be followed from any Linux distro. In our case, we will use Ubuntu.<br />To scan networks -looking for one with WPS- we will open a console and type the following:<br /><br />sudo iw wlan0 scan | egrep 'WPS|BSS|SSID' -w<br /><br />Let's -briefly- explain the command:<br /><br />sudo: Root permission (only needed if we are on Ubuntu; if using Kali, it is not necessary).<br />iw: A tool included in Linux for network scanning.<br />wlan0: Network interface. If you do not know the name of your interface, you must install Aircrack as follows: sudo apt-get install aircrack-ng if you are on Kali, this is not necessary. Once installed, type airmon-ng in the console, which will give you the name of your interface.<br />scan: An iw parameter for scanning.<br />egrep 'WPS|BSS|SSID' -w : Used so that it only shows the information that is valuable to us; otherwise it would show a lot of unnecessary data. <br /><br />This way we will obtain the network name, the MAC of the router or access point, and whether or not it has WPS enabled.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we can see, 2 networks appear; both with WPS enabled. We will focus on the second one, Underc0de Labs.<br /><br />The data we need to remember is the MAC, in this case 00:0a:52:23:a6:f8<br /><br />
<br /><br />
INSTALLING REAVER
<br /><br />Reaver is a tool that carries out brute-force attacks against the PIN of networks protected with WPA and with WPS enabled. This PIN has 8 digits and the eighth digit is a checksum.<br /><br />This tool brute-forces the first half of the PIN and then the second half, meaning that all possible values of the WPS PIN number can be exhausted in 11,000 attempts.<br /><br />The speed of the attack is limited by the speed at which the AP can process WPS requests. Some fast APs may test 1 PIN per second, while others may test 1 every 10 seconds.<br /><br />To install it, we open a console and follow these steps:<br /><br />
Código: bash
wget http://reaver-wps.googlecode.com/files/reaver-1.4.tar.gz
<br /><br />This will download Reaver 1.4, which is currently the latest version available. Once downloaded, we enter the folder and install it with the following commands:<br /><br />
Código: bash
cd reaver-1.4/src<br />./configure<br />make<br />make install
<br /><br />Once these actions are done, Reaver will be installed and ready to use. We can view Reaver's parameters by typing its name in the console.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />
<br /><br />
OBTAINING THE PIN
<br /><br />Once our PC is prepared with the tool, we will proceed to attack. To do so, we will put our network interface into monitor mode.<br /><br />
Código: bash
airmon-ng start wlan0
<br /><br />Now, the console will have put our interface into monitor mode. In our case, it is called mon0 and -possibly- yours is too.<br /><br />Next, we will start the attack with the following command:<br /><br />
Código: bash
sudo reaver -i mon0 –b 00:0A:52:23:A6:F8 –vv
<br /><br />Let's -briefly- review each part of the command:<br /><br />sudo: Root permission; if using Kali, this is not necessary.<br />reaver: Starts the Reaver tool.<br />-i: Interface, in this case mon0, which is the one in monitor mode.<br />-b: The MAC of the router or AP we are attacking (obtained from the network scan).<br />-vv: Verbose parameter to see which PINs are being tested.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />Now, it is a matter of time and patience for Reaver to do its job of testing PINs. As we mentioned before, the speed depends on the router or AP we are attacking.<br /><br />Once it finishes, we will see a detail like in the following screenshot:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />As we can see, we have the PIN: 23365049, which coincidentally is the same as the one printed on the bottom of the router:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />The only thing left now is to connect to the network.<br /><br />
<br /><br />
CONNECTING TO THE NETWORK
<br /><br />Once we have obtained the PIN, we download the JumpStart program, which is used to connect to a network using the WPS PIN we have captured.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />We leave the first option as shown in the image and click next:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />We check the last option that allows entering a PIN to access the AP and enter the captured PIN.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />It will begin testing the PIN on nearby networks and, finally, it will connect.<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />
<br /><br />
OBTAINING THE WPA/WPA2 KEY
<br /><br />Once connected, right-click on the name of the network we accessed and select properties:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />Now we go to the security tab and check the option to show characters:<br /><br />
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />In conclusion: As you can see, we have obtained the WPA2 key without needing to use dictionaries or brute force to break the handshake, through a simple but no less useful process. <br /><br /><br /><br />
MYokai ·
Very good Ántrax. But we shouldn't underestimate dynamic WEP: Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />Regards.
Linax ·
Thanks for the contribution, it is very well explained.<br /><br />Could you advise us on what measures to take to protect ourselves against these attacks?<br /><br />Thanks!
rollth ·
Cita de: Linax en Abril 30, 2017, 01:23:23 PM<br />Thanks for the contribution, it is very well explained.<br /><br />Could you advise us on what measures to take to protect ourselves against these attacks?<br /><br />Thanks!<br />
<br /><br />The best thing is to configure your network as WPA2 with a password of more than 20 digits is fine, plus disable PSK and you can do MAC filtering, so you control who is inside or outside the network.<br /><br />Finally, you have to be a bit smart and try to avoid falling for attacks such as the evil twin.<br /><br />Regards.
Linax ·
Cita de: rollth en Abril 30, 2017, 01:38:57 PM<br />
Cita de: Linax en Abril 30, 2017, 01:23:23 PM<br />Thanks for the contribution, it is very well explained.<br /><br />Could you advise us on what measures to take to protect ourselves against these attacks?<br /><br />Thanks!<br />
<br /><br />The best thing is to configure your network as WPA2 with a password of more than 20 digits is fine, plus disable PSK and you can do MAC filtering, so you control who is inside or outside the network.<br /><br />Finally, you have to be a bit smart and try to avoid falling for attacks such as the evil twin.<br /><br />Regards.<br />
<br />Hello,<br />thanks for your message, could you explain how to disable the PSK?<br /><br />Thanks, regards
SPeedY ·
Thanks for the contribution. It would be interesting to know if there is a way to do an offline brute-force attack, so we could bypass the new security that blocks WPS access after a few failed attempts.
dellarts ·
Thanks a lot for the contribution, it is very well explained. I have been practicing network pentesting, especially Wi-Fi, for a while and with this method I have run into a problem that newer routers have, which is blocking when a number X of PINs fail.<br /><br />What method do you use to get around them?<br /><br />Regards,
puntoCL ·
Hi @dellarts<br /><br />From what I have researched and from experience, for the blocking I have this solution for you:<br /><br />1° The classic "cut the power"<br />2° Reaver has a "-d" option, which is the delay between PINs in seconds, so that it does not block; one PIN per hour, so one hour in seconds is 3600 seconds. Sure, it is slow, but what can we do.<br />3° There is the famous and less loved ReVdK3, an Unlockedwps tool to try to unlock those routers with WPS locked or that lock after several attempts.
dellarts ·
Thanks @puntoCL, I will look into the points you mentioned to see if I can get good results from any of them :)
dellarts ·
Hello!<br /><br />I have been tinkering with all the solutions you gave me but have not achieved positive results. I have tried both linset fluxion and ReVdK3. The solution you proposed for reaver does not seem efficient to me, since you have to set a delay that is too high, and I am looking for something more efficient.<br /><br />I have been trying the DDoS FLOOD AP ATTACK and EAPOL START FLOOD techniques, but the problem I have is that in all the tutorials I have found they use multiple "interfaces" in monitor mode to carry out the attack, and I am using Kali 2.0 and have not managed to do it. I have read somewhere that adding wlan0mon removed that possibility; can you confirm whether that is so?<br /><br />I have also tried connecting 2 Wi-Fi antennas to the Kali 2.0 device but have not managed to bring up 2 interfaces either.<br /><br />Has anyone had these problems or knows how to solve them? Any hint or direction to follow would be a great help :)<br /><br />Regards,
Stiuvert ·
Cita de: dellarts en Junio 28, 2017, 12:35:09 PM<br />Hello!<br /><br />I have been tinkering with all the solutions you gave me but have not achieved positive results. I have tried both linset fluxion and ReVdK3. The solution you proposed for reaver does not seem efficient to me, since you have to set a delay that is too high, and I am looking for something more efficient.<br /><br />I have been trying the DDoS FLOOD AP ATTACK and EAPOL START FLOOD techniques, but the problem I have is that in all the tutorials I have found they use multiple "interfaces" in monitor mode to carry out the attack, and I am using Kali 2.0 and have not managed to do it. I have read somewhere that adding wlan0mon removed that possibility; can you confirm whether that is so?<br /><br />I have also tried connecting 2 Wi-Fi antennas to the Kali 2.0 device but have not managed to bring up 2 interfaces either.<br /><br />Has anyone had these problems or knows how to solve them? Any hint or direction to follow would be a great help :) <br /><br />Regards,<br />
<br /><br />To ask any kind of question we have the Subforum "General Questions and Requests"; I warn you that you should open a post there so they can help you.<br /><br />At first glance I can tell you that what you are trying to do is deauthenticate the victim and create a fake AP. There is a thread open here where it is done with the Fluxion tool.<br /><br />On the other hand, if you use 2 WiFi cards to carry out your audits, you must first know that each one of them must be valid for performing audits (you can look for information).<br /><br />Regards
Grupo de WhatsApp