Deauthentication Attack Using Kali Linux
Deauthentication Attack Using Kali Linux
Hacking
— 15 min read
#deauthentication
#wireless hacking
#networking
#kali linux
Hello and welcome, hacker-curious soon-to-be 1337 hacker legends, and welcome to my first serious article/tutorial on the realm! My
name is d3ad R1nger and today you will learn the theory and also a practical example of a wireless network attack called
deauthentication In my humble opinion, when a hacker learns about a new attack, he or she must also learn how to prevent it. So, this
is not going to be a simple how-to, this article will be divided into 4 parts:
Treasures
🤓 If you know what you are doing and only looking for a simple command list, I got you fam 💜
TL;DR Deauthentication Attack Gist for the Knowledgable
A cool attack that uses this method: Hacking nearby wifis with Evil Twin Attack
The use of encryption in 802.11 is limited to data payloads only. Encryption does not apply to the 802.11 frame headers, and
cannot do so as key elements of 802.11 headers are necessary for normal operations of 802.11 traffic.
Since 802.11 management frames largely work by setting information in the headers, management frames are not encrypted
and as such are easily spoofed.
To prevent deauthentication/disassociation attacks, the IEEE implemented the 802.11w amendment to 802.11. This provides a
mechanism to help prevent the spoofing of management frames, but both client and infrastructure need to support it (and have
it enabled) for it to function. (source)
I will be writing articles and tutorials demonstrating every single one of the aforementioned attacks so stay tuned.
You can also deauth users in your network for way simpler reasons, like:
Kick a sibling or a friend off the network just because they are slowing your connection down
Frustrate people and laugh
o example, let's say your best friend is a waiter, and he takes his orders from customers with a PDA connected to the
Cafe's Wi-Fi connection, deauth his PDA, and drive him mad. (You didn't read that from me).
Deauth a drone from its access point mid-air and see what happens. (I haven't done that yet. but I will asap)
Ok! one last thing, since we are talking about sending packets we will need a wireless adapter both able to work in monitor mode and
be a packet injector!
My favorite wireless adapter, and the one I'll be using for this tutorial, is Alfa AWUSO36NH High Gain USB Wireless G / N Long-
Rang WiFi Network Adapter, it has never failed me thus far and the thing I love the most about it is that it works perfectly with a
Raspberry Pi 4
In Kali, almost all the action happens inside the terminal so you should really get the hang of it.
Now that's a trippy gif.
By typing ifconfig and the enter key on your terminal you get the following output :
At the eth0 section in my ifconfig output, you see that I have inet 10.0.2.15, this is because I am running Kali Linux on a Virtual
Machine and it is connected on a nat network. Don't worry about it, you do not even have to care at the moment.
All you have to care about is the wlan0 section that is your wireless adapter and as you can see mine is not even connected to a
network. If it was it would be displaying an IP in the range of 192.168.x.x (Just for answering future questions).
The next command is iwconfig. Type it and execute it on your terminal and boom:
lo no wireless extensions.
From this output, we understand that our wireless card is in Managed Mode and we want it to be in Monitor Mode. So let's do that.
By running the airmon-ng start wlan0 (or whatever your adapter is called, it could be wlan1 or wlan2) you are setting your adapter to
monitor mode! Check out the output :
PID Name
448 NetworkManager
525 dhclient
654 wpa_supplicant
root@kali:~# iwconfig
lo no wireless extensions.
See the above iwconfig result. Mode:Monitor and the name is wlan0mon! You are ready to go.
Execute the command airodump-ng wlan0mon on your terminal and start choosing targets.
Command output:
The combination of BSSID and ESSID can help hackers find locations. 😁 Yeap, that's a thing.
The command will keep running and monitoring near Access Point behavior but as soon as we find our target on the list we can just
hit ctrl+c to stop the monitoring process.
You will get a bunch of different access points with a lot of info you don't understand! Let's break them down.
BSSID | MAC address of the access point. In the Client section, a BSSID of “(not associated)” means that the client is not
associated with any AP. In this unassociated state, it is searching for an AP to connect with.
PWR | Signal level reported by the card. Its signification depends on the driver, but as the signal gets higher you get closer to
the AP or the station. If the BSSID PWR is -1, then the driver doesn't support signal level reporting. If the PWR is -1 for a
limited number of stations then this is for a packet which came from the AP to the client but the client transmissions are out of
range for your card. Meaning you are hearing only 1/2 of the communication. If all clients have PWR as -1 then the driver
doesn't support signal level reporting.
Beacons | Number of announcements packets sent by the AP. Each access point sends about ten beacons per second at the
lowest rate (1M), so they can usually be picked up from very far.
# Data | Number of captured data packets (if WEP, unique IV count), including data broadcast packets.
#/s | Number of data packets per second measure over the last 10 seconds.
CH | Channel number (taken from beacon packets).
Note: sometimes packets from other channels are captured even if airodump-ng is not hopping, because of radio interference.
MB | Maximum speed supported by the AP. If MB = 11, it's 802.11b, if MB = 22 it's 802.11b+ and higher rates are 802.11g.
The dot (after 54 above) indicates short preamble is supported. Displays “e” following the MB speed value if the network has
QoS enabled.
ENC | Encryption algorithm in use. OPN = no encryption,“WEP?” = WEP or higher (not enough data to choose between WEP
and WPA/WPA2), WEP (without the question mark) indicates static or dynamic WEP, and WPA or WPA2 if TKIP or CCMP
is present.
CIPHER | The cipher detected. One of CCMP, WRAP, TKIP, WEP, WEP40, or WEP104. Not mandatory, but TKIP is
typically used with WPA and CCMP is typically used with WPA2. WEP40 is displayed when the key index is greater then 0.
The standard states that the index can be 0-3 for 40bit and should be 0 for 104 bit.
AUTH | The authentication protocol used. One of MGT (WPA/WPA2 using a separate authentication server), SKA (shared
key for WEP), PSK (pre-shared key for WPA/WPA2), or OPN (open for WEP).
ESSID | Shows the wireless network name. The so-called “SSID”, which can be empty if SSID hiding is activated. In this
case, airodump-ng will try to recover the SSID from probe responses and association requests.
I will be targeting my own AP TP-LINK_AP_4CE8! You should understand that doing this to other APs is illegal. Unless you
have the permission of course.
Now that we know all that we need to know about our target we have to find any devices connected to the network, to do that we run
the following command.
The commands structure is airodump-ng -d "target's BSSID" -c "target's channel number" "wireless adapter monitor mode
name"
In our case the full command is:
Now we are monitoring SPECIFICALLY our target and not all nearby access points. Also, we can see that there are two devices
currently inside the network, one of which is my phone!
BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
Command instructions:
-0 means deauthentication.
0 is the number of deauths to send, 0 means send them continuously, you can send 10 if you want the target to disconnect and
reconnect.
-a 50:C7:BF:DC:4C:E8 is the MAC address of the access point we are targeting.
-c E0:B5:2D:EA:18:A7 is the MAC address of the client to deauthenticate; if this is omitted then all clients are
deauthenticated.
wlan0mon is the interface name.
You are now well familiar with the attack and know all the theories a beginner may need! But how could one prepare himself to
defend against a deauthentication attack?
You can not stop a bad guy from sending deauth packets... Instead, you should make sure your network is configured in a way that the
deauth attack doesn't enable an attacker to compromise your network.
Conclusion
Hacking is not easy, let's start with that. It needs patience and curiosity. You will always have days that everything is just not working
how it should be and you may feel like a loser for not making it work! But that's the trick! Someone has made it work and this must
drive you! Be that someone! And then be more!
Thank you very much for your time and I really hope that you got something from this article/tutorial! Sudorealm is here to stay and
we promise to give you as much as we can!