how to enable monitor mode in kali linux using the IP and iw commands Almost Any attack on WiFi begins with the transfer of the WiFi card to monitor mode (tracking mode). and here comes the question of How to put wireless adapter in monitor mode, the answer is simple.
To enable WiFi monitor mode you can use the Airmon-ng tool , A Better way is using the ip and iw commands
with “manual” way of transferring to monitor mode the interface will keep its own name so if it was wlan0 it will stay the same wlan0 that’s because Airmon-ng create a virtual interface when it start monitor mode, so to begin let’s look at the name of the wireless interface:
And translate it into monitor mode:
sudo ifconfig wlan0 down sudo iwconfig wlan0 mode monitor sudo ifconfig wlan0 up
Good method – never let me down. But, it turns out, both the ifconfig command and the iwconfig command are now considered obsolete. ifconfig is no longer installed on the system by default, and once the same will happen with iwconfig – it is only a matter of time.
In order not to sit “on the old stuff”, of course, alternatives were found.
Now we look at the interface name like this:
sudo iw dev
And put it into monitor mode like this (replace wlan0 with the name of your wireless interface):
sudo ip link set wlan0 down sudo iw wlan0 set monitor control sudo ip link set wlan0 up
We check success with:
sudo iw dev
now we will look at the interface name itself with a wireless extension and put it into monitor mode (if you have only one wireless interface):
t=`iw dev | grep 'Interface' | sed 's/Interface //'`;sudo ip link set $t down && sudo iw $t set monitor control && sudo ip link set $t up
If instead of changing the real interface you want to create a virtual monitor in monitor mode, then to create a wireless interface in monitor mode called mon0, you need to do this:
sudo iw phy phy0 interface add mon0 type monitor
My commands creates a virtual interface, but it does not translate into monitor mode. If you have a similar situation, then do this:
sudo ip link set mon0 down sudo iw mon0 set monitor control sudo ip link set mon0 up
We also check:
sudo iw dev
To remove a virtual interface:
sudo iw dev mon0 del
Under certain conditions, NetworkManager may not allow the WiFi adapter to transfer to monitor mode. Moreover, the wireless card already transferred to the monitor mode can be returned to the controlled mode. Therefore, it is recommended to disable NetworkManager when testing for the penetration of wireless networks.
In Kali Linux and BlackArch, this is done like this:
sudo systemctl stop NetworkManager
Note, after disabling NetworkManager, the Internet will stop!
Additionally, it is recommended to perform:
sudo airmon-ng check kill
Keep in mind not all adapter support WiFi monitor mode for that we created a list of WiFi adapters that support monitor mode it can be found here : wifi adapter for monitor mode
Leave a Reply