Pre Connection Attack
Pre Connection Attack
Pre-connection attack is the first part of the network penetration testing. To perform this attack,
we will look at the fundamentals like how to show all the networks around us, how to find the
details of all the connected devices to a particular network. Once we know about the network
and connected devices to it, we can disconnect any device without knowing the password of
that device.
Following are the basic steps we will be going through to perform Pre-connection attack:
Wireless Interface in Monitor mode: In this step, we will change the mode of wireless device as
Monitor mode.
1. About airodump-ng: In this step, we will use airodump-ng to list all the network around
us and display useful information about them.
2. Run airodump-ng: In this step, we will see all the devices that are connected to a
particular network and collect more information about it.
3. Deauthenticate the Wireless client: In this step, we can disconnect any device which is
shown in the previous step using the aireplay-ng.
This step is used to put your wireless card into Monitor mode. In Monitor mode, your
card can listen to every packets that's around us. By default, the mode of wireless
devices is set to "Managed" that means our wireless device will only capture packets
that have our device's MAC address as the destination MAC. It will only capture packets
that are actually directly to my Kali machine.
But we want to capture all the packets that are within our range even if the destination
MAC is not our MAC or even without knowing the password of the target device. To do
this, we need to set the mode as Monitor mode.
ifconfig wlan0 down command is used for disabling the Managed mode
airmon-ng check kill command is used to kill any process that could interfere with
using my interface in monitor mode. After this command, your internet connection
will be lost.
In the above figure, you can see that the mode is changed as Monitor mode.
Now we are able to capture all the Wi-Fi packets that are within our range even if the
packets are not directed to our computer or even without knowing the password of
the target network.
To do this, we need a program that can capture the packets for us. The program we
are going to use is airodump-ng.
About airodump-ng
airdump-ng is used to list all the network around us and display useful information
about them. It is a packet sniffer, so it is basically designed to capture all the packets
around us while we are in Monitor mode. We can run it against all of the networks
around us and collect useful information like the mac address, channel name,
encryption type, number of clients connected to the network and then start targeting
to the target network. We can also run it against certain AP(access point) so that we
only capture packets from a certain Wi-Fi network.
First, let's look at how to run the program. In this case, we need our Wi-Fi card in
Monitor mode. The name of the our Wi-Fi card is wlan0.
PWR shows the signal strength of the network. Higher the number has better signal
Beacons are the frames send by the network in order to broadcast its existence
#Data, shows the number of data packets or the number of data frames
#/s shows the number of data packets that we collect in the past 10 seconds
ENC shows the encryption used by the network. It can be WEP, OPN, WPA, WPA2
In the above image, you can show all the wireless networks like Oppo, perfe, Fligh,
Ashu, LIFCA, Xiaom, BS1A-YW5 etc and the detailed information about all the
network.
Run airodump-ng
In this step, we will run airodump-ng to see all the devices that are
connected to a particular network and collect more information
about it. Once we have a network to the target, it's useful to run
airodump-ng on that network only, instead of running it on all the
networks around us.
--write test is used to store all the data in a file named as test. It is
not mandatory, you can skip this part.