Deauthentication
Deauthentication
Deauthentication
Description
This attack sends disassocate packets to one or more clients which are currently associated with a
particular access point. Disassociating clients can be done for a number of reasons:
Recovering a hidden ESSID. This is an ESSID which is not being broadcast. Another
term for this is “cloaked”.
Capturing WPA/WPA2 handshakes by forcing clients to reauthenticate
Generate ARP requests (Windows clients sometimes flush their ARP cache when
disconnected)
Of course, this attack is totally useless if there are no associated wireless client or on fake
authentications.
Usage
aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:34:30:30 ath0
Where:
-0 means deauthentication
1 is the number of deauths to send (you can send multiple if you wish); 0 means send
them continuously
-a 00:14:6C:7E:40:80 is the MAC address of the access point
-c 00:0F:B5:34:30:30 is the MAC address of the client to deauthenticate; if this is omitted
then all clients are deauthenticated
ath0 is the interface name
Usage Examples
Typical Deauthentication
First, you determine a client which is currently connected. You need the MAC address for the
following command:
Where:
-0 means deauthentication
1 is the number of deauths to send (you can send multiple if you wish)
-a 00:14:6C:7E:40:80 is the MAC address of the access point
-c 000:0F:B5:AE:CE:9D is the MAC address of the client you are deauthing
ath0 is the interface name
For directed deauthentications, aireplay-ng sends out a total of 128 packets for each deauth you
specify. 64 packets are sent to the AP itself and 64 packets are sent to the client.
After sending the ten batches of deauthentication packets, we start listening for ARP requests
with attack 3. The -h option is mandatory and has to be the MAC address of an associated client.
If the driver is wlan-ng, you should run the airmon-ng script (unless you know what to type)
otherwise the card won't be correctly setup for injection.
Usage Tips
It is usually more effective to target a specific station using the -c parameter.
The deauthentication packets are sent directly from your PC to the clients. So you must be
physically close enough to the clients for your wireless card transmissions to reach them.
Usage Troubleshooting
Why does deauthentication not work?
There can be several reasons and one or more can affect you:
You are physically too far away from the client(s). You need enough transmit power for
the packets to reach and be heard by the clients. If you do a full packet capture, each
packet sent to the client should result in an “ack” packet back. This means the client
heard the packet. If there is no “ack” then likely it did not receive the packet.
Wireless cards work in particular modes such b, g, n and so on. If your card is in a
different mode then the client card there is good chance that the client will not be able to
correctly receive your transmission. See the previous item for confirming the client
received the packet.
Some clients ignore broadcast deauthentications. If this is the case, you will need to send
a deauthentication directed at the particular client.
Clients may reconnect too fast for you to see that they had been disconnected. If you do a
full packet capture, you will be able to look for the reassociation packets in the capture to
confirm deauthentication worked.
General
See the general aireplay-ng troubleshooting ideas: aireplay-ng usage troubleshooting.
Hello! In this post I will explain to you how to deauthenticate any device from a WiFi network
without beeing connected to the network itself!
Beware, this is illegal without permission, and it can be detected.
To use airodump-ng we can run the following command, and the given interface [wlan1] will
start collecting data.
$ airodump-ng wlan1
When you see the networks listed. You can use this information as a filter to collect data of a
specific network.
Now you can specify the bssid and channel of the network.
$ airodump-ng --bssid [NETWORK_BSSID] --channel [NETWORK_CHANNEL] wlan1
Optionally you can use --write [filename] in the command. This way you save the collected
packets in a file, which you could analyze further with wireshark.
Now we can see the devices connected to the network. (Listed under STATION)
Once you have the MAC Address of the target device, and the BSSID of the router. You have
enough information to start the deauthentication attack.
To start the deauthentication attack you can use the following command:
$ aireplay-ng --deauth 0 -a [ROUTER_BSSID] -c [TARGET_MAC_ADDRESS] wlan1
--deauth 0 means that you will send infinite deauthentication packets. It stops sending packets
whenever you stop the program from executing. (CTRL + C)
(NOTE: airodump-ng should be running with the bssid & channel specified simultaneously
with aireplay-ng! )
👋 Before you go
In our previous blog post (Part 1) of the Wi-Fi Hacking series, we went through setting up our
Alfa card, decloaking hidden SSID’s, passively capturing handshakes and cracking the
passphrase using aircrack-ng. Here, we are going to perform an active deauth attack on a WPA-2
PSK Wi-Fi Network, capture the handshake and then try to crack the passphrase using hashcat.
We’ll start off by running airodump-ng on 2.4Ghz by using the ‘–band b’ option.
We’ll use airodump-ng again, this time with the -d, -c and -w flags to specify our AP MAC
address, the respective channel number and the output filename.
A client/STA is required to be connected to the target AP in order to perform active deauth
attacks. We can see that an STA is connected to our AP from the frames being captured by our
alfa card.
We’ll go through how a deauthentication attack works before actually performing it.
We can use aireplay-ng tool on a new terminal to send deauth frames as shown below.
The STA disconnects from the AP and reconnects after some time. Airodump captures the 4-way
handshake during reconnection.
We have successfully captured the 4-way handshake between the STA and AP. Now, we can
proceed to crack the passphrase. We’ll need hcxpcapngtool from hcxtools package to convert the
airodump-ng’s output .CAP file to that of hashcat’s 22000 mode. We can install hcxtools
package from Kali Linux’s default repo using the commands show below.
After installing the package, we can use hcxpcapng tool to convert our ‘wifi_deauth-01.cap’ file
to hashcat’s 22000 format.
We need to transfer the file to the host OS to utilize the GPU & download hashcat on the host
OS. For the word-list we will be reusing the one our previous blog.
We successfully demonstrated a WPA-2 Deauthentication attack and managed to crack the
passphrase too. We’ll get into other wireless attacks in upcoming blogs.
By partnering with Redfox Security, you’ll get the best security and technical skills required to
execute an effective and thorough penetration test. Our offensive security experts have years of
experience assisting organizations in protecting their digital assets through penetration testing
services. To schedule a call with one of our technical specialists, call 1-800-917-0850 now.
Redfox Security is a diverse network of expert security consultants with a global mindset and a
collaborative culture. If you are looking to improve your organization’s security posture, contact
us today to discuss your security testing needs. Our team of security professionals can help you
identify vulnerabilities and weaknesses in your systems and provide recommendations to
remediate them.
Wi-Fi stands for wireless network technology. It establishes wireless network connections using
radio waves. Malicious hackers frequently opt to penetrate firms by compromising their Wi-Fi
networks, mainly due to the nature of Wi-Fi and its methods for enabling network access.
Households are also at risk, owing to the proliferation of IoT-connected devices and appliances.
In Part 1 of the Wi-Fi Hacking series, we are going to delve into Wi-Fi hacking, specifically
on Wi-Fi network decloaking, capturing WPA handshakes and obtaining cleartext passphrase
using passive techniques (i.e., not performing de-authentication attacks). We will be using Kali
Linux in VirtualBox and a USB wireless adapter (Alfa AWUS036ACH which uses Realtek
RTL8812AU chipset) which can support monitor mode and packet injection.
Next, we boot up our Kali VM and install the respective wireless device driver. In our case we
install the realtek-rtl88xxau-dkms from the default kali repository using apt install command.
To check whether kali detects our wireless adapter, we can use the ‘iwconfig’ command.
We can see that the ‘wlan0’ interface is now active and that it’s in ‘managed’ mode.
To set our wireless adapter in ‘monitor’ mode, we can use the ‘airmon-ng’ tool. But before we
do that, we need to check whether there are any running processes which could cause problems
and kill them. This can be done by using ‘airmon-ng check kill’ command.
We have now successfully setup our wireless adapter. Next, we can move on to the attack phase.