What is monitor mode?
Putting your network card in monitor mode allows you to capture all the wireless traffic in the surrounding area. Monitor mode can be used to detect nearby devices, where they are connected, capture their MAC addresses (which can be used to identify the device), or even monitor network traffic of unprotected networks. Thus, monitor mode is essential for wireless network hacking.
The TL-WN722N
TL-WN722N is a nice, easy-to-use, and relatively cheap wireless USB adapter that can be used to monitor wireless channels. But there is one problem, for the v2 and v3, the default driver on Debian-based systems (like Ubuntu or Kali Linux) does not work as intended. Let’s fix it!
Fixing TL-WN722N v2 & v3 monitor mode on Debian-based systems
Prepare your system
The first thing to do is make sure our apt is updated and also that the required programs are installed:
sudo apt update
sudo apt install bc
sudo apt install linux-headers-$(uname -r)
sudo apt install build-essential git dkms -y
Get and build the right driver
A working driver for your TL-WN722N v2 or v3 exists on Aircrack-ng’s Github. You can download the driver and compile it.
cd ~/Downloads
git clone https://github.com/aircrack-ng/rtl8188eus
cd rtl8188eus
make
Alternatively, you may also use a driver from lwfinger’s Github.
Blacklist current driver
To disable the current not working driver from loading after reboot, blacklist it.
sudo sh -c "echo 'blacklist r8188eu' >> /etc/modprobe.d/realtek-wn722n-fix.conf"
Permanently install the working driver
Now the only thing left to do is install the driver we compiled:
cd ~/Downloads/rtl8188eus
sudo make install
sudo modprobe 8188eu
Then reboot the system and check if the monitor mode works.
Reverting back to the old driver
If you for any reason want to enable back the old not working driver, just remove the black list file.
sudo rm /etc/modprobe.d/realtek-wn722n-fix.conf