In this tutorial we’ll enable monitor mode on a TP-LINK TL-WN722N V2/V3 wireless adapter, on a Kali Linux machine running on VMware or VirtualBox.
Some sources may be confusing, and lead you to believe that you can only enable monitor mode on TP-LINK TL-WN722N v1 because it has one of the required chipsets for monitor mode, Atheros AR9271, and that you can’t enable it on V2/V3. You can, however.
To start off, if you’re using a virtual machine, first you’ll have to connect your wireless adapter to your Kali Linux virtual machine.
Set up the Adapter
Next, we’ll run some commands to set up the adapter.
First update and upgrade your package index.
sudo apt update && sudo apt upgrade
Reboot your machine.
sudo reboot
Install Linux headers for your Kali Linux.
sudo apt install linux-headers-$(uname -r)
Run the following commands to install the bc
package and remote the r8188eu.ko
module.
sudo apt install bc
sudo rmmod r8188eu.ko
Clone the Realtek driver from the aircrack-ng
Github repository.
git clone https://github.com/aircrack-ng/rtl8188eus
Run the following commands.
cd rtl8188eus
sudo -i
echo "blacklist r8188eu" > "/etc/modprobe.d/realtek.conf"
exit
reboot
After the reboot run the following commands (we have to cd
back into the rtl8188eus
directory that we cloned earlier):
cd rtl8188eus
make
sudo make install
sudo modprobe 8188eu
Enable Monitor Mode
To enable monitor mode, run the following commands:
sudo ifconfig wlan0 down
sudo airmon-ng check kill
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up
sudo iwconfig
Here’s the output you should be seeing. You can see that the adapter is set to Mode: Monitor
.
Troubleshooting When Enabling Monitor Mode
In some cases it doesn’t work right away. For example you may get the error Error for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Operation not permitted.
The solution that has worked for me every time is the following (credit to this Github user’s comment).
Run the following commands in this order:
sudo ifconfig wlan0 up
sudo rmmod r8188eu.ko
sudo modprobe 8188eu
sudo iwconfig wlan0 mode auto
sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up
Now when you check iwconfig
you should see the adapter is in monitor mode.
Conclusion
In this tutorial we set up a TP-LINK TL-WN722N V2/V3 adapter to run in monitor mode. If you have any issues or questions then please don’t hesitate to leave a comment. Hope this helped. Thank you.
I have a problem with Tl-wn722n on kali VM. The make comment doesn’t work; an error shows up at the end: make: *** [makefile: 1368 modules] error 2. how should I solve it?
If you can’t install the Driver Monitor mode,download my image iso, the monitor driver is already included in it.You will get (live usb).
https://m.youtube.com/watch?v=av7qke1ueJk
Who can’t install a monitor mod for kali Linux Tp-link TL-WN722N v2/v3 in any way.
https://www.youtube.com/watch?v=CnjyQIw8kt0
On the last Kali version, when i execute “Make” i have errors.
try in ubuntu lts 20.4 its perfectly works
Probably its caused because the “make” command runs a scripts that looks into the build folder on the linux kernel headers.
This error occurred to me on Kali 2022.3. The way that I managed to workaround was installing the linux headers from the Kali repositories on this link: https://http.kali.org/kali/pool/main/l/linux/
You can know which one you should install by using the “uname -a” command and looking which distro you have. The file which you need to install begins with a “linux-headers” prefix and a extension “.deb”.
After downloading it, you could run the command “dpkg -i .deb”. You could run into some dependencies problems, and for those you need to search on the internet to see which packages you need to install.
After you manage to run the above command without errors, you should be fine to run the “make” command again.
Thanks heaps for this!
This works on kali-virtualbox, one of the comments didnt work though $ sudo rmmod r8188eu.ko but carried on with the next comment ($git clone https://github.com/aircrack-ng/rtl8188eus) and it’s all working using TL-WN722N V2.
Nice! Thanks for commenting! Very glad to hear you got it to work!
+1 on using this git to get mine running. Thanks
Thank you very much. Your guide is very detailed. It also works with TL-WN722N V4.
There is only one note that when I run Wireshark from Kali menu the wlan changes to Managed mode. Running wireshark from terminal “sudo wireshark” is the correct way to capture packets.
Cheers!
L E G E N D. Thank you for your help bro!!!!! It works.
Nice! Glad to help! Thank you for the kind words!
Anyone else running into this error? E: Package ‘bc’ has no installation candidate
Does this affects the process?
If you can’t install the Driver Monitor mode,download my image iso, the monitor driver, is already included in it.You will get (live usb).
https://m.youtube.com/watch?v=av7qke1ueJk
Also problem
It shows the following error while I executed
$ sudo iwconfig wlan0 mode monitor
Error for wireless request “Set Mode” (8B06) :
SET failed on device enp0s3 ; Operation not supported.
I think its because I’ve got error on $ sudo rmmod r8188eu.ko
please help me sort out the issue asap
Thank you from the bottom of my hearth
After following the commands, I am unable to connect to internet nor to my router. Host unreachable error is showing up. If i enable network manager and restart dhcpclient, It automatically puts my adapter to Managed mode.
thanks alot …….and luv u
💜🖤💜
Can You Do the new Version of this The TL-WN722N V4 because I can’t enable monitor mode with this step I’m having an error in the make part
Hi. Thanks for commenting. I’ll try, but it’s not available for me to buy right now, so it will take some time.
thanks in advance haha
cc1: note: unrecognized command-line option ‘-Wno-sometimes-uninitialized’ may have been intended to silence earlier diagnostics
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-kali5-common/scripts/Makefile.build:255: /home/viper/Desktop/rtl8188eus/os_dep/osdep_service.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-kali5-common/Makefile:2030: /home/viper/Desktop/rtl8188eus] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-6.1.0-kali5-amd64’
make: *** [Makefile:2065: modules] Error 2
it says me that error someone know how to solve this
Is working with v3.2 OR not
Hi
When i give the
make
command I get the following error:
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.1.0-kali7-amd64/build M=/home/ali/rtl8188eus modules
make[1]: Entering directory ‘/usr/src/linux-headers-6.1.0-kali7-amd64’
CC [M] /home/ali/rtl8188eus/core/rtw_cmd.o
CC [M] /home/ali/rtl8188eus/core/rtw_security.o
CC [M] /home/ali/rtl8188eus/core/rtw_debug.o
CC [M] /home/ali/rtl8188eus/core/rtw_io.o
CC [M] /home/ali/rtl8188eus/core/rtw_ioctl_query.o
CC [M] /home/ali/rtl8188eus/core/rtw_ioctl_set.o
CC [M] /home/ali/rtl8188eus/core/rtw_ieee80211.o
CC [M] /home/ali/rtl8188eus/core/rtw_mlme.o
CC [M] /home/ali/rtl8188eus/core/rtw_mlme_ext.o
CC [M] /home/ali/rtl8188eus/core/rtw_mi.o
CC [M] /home/ali/rtl8188eus/core/rtw_wlan_util.o
CC [M] /home/ali/rtl8188eus/core/rtw_vht.o
CC [M] /home/ali/rtl8188eus/core/rtw_pwrctrl.o
CC [M] /home/ali/rtl8188eus/core/rtw_rf.o
CC [M] /home/ali/rtl8188eus/core/rtw_recv.o
CC [M] /home/ali/rtl8188eus/core/rtw_sta_mgt.o
CC [M] /home/ali/rtl8188eus/core/rtw_ap.o
CC [M] /home/ali/rtl8188eus/core/mesh/rtw_mesh.o
CC [M] /home/ali/rtl8188eus/core/mesh/rtw_mesh_pathtbl.o
CC [M] /home/ali/rtl8188eus/core/mesh/rtw_mesh_hwmp.o
CC [M] /home/ali/rtl8188eus/core/rtw_xmit.o
CC [M] /home/ali/rtl8188eus/core/rtw_p2p.o
CC [M] /home/ali/rtl8188eus/core/rtw_rson.o
CC [M] /home/ali/rtl8188eus/core/rtw_tdls.o
CC [M] /home/ali/rtl8188eus/core/rtw_br_ext.o
CC [M] /home/ali/rtl8188eus/core/rtw_iol.o
CC [M] /home/ali/rtl8188eus/core/rtw_sreset.o
CC [M] /home/ali/rtl8188eus/core/rtw_btcoex_wifionly.o
CC [M] /home/ali/rtl8188eus/core/rtw_btcoex.o
CC [M] /home/ali/rtl8188eus/core/rtw_beamforming.o
CC [M] /home/ali/rtl8188eus/core/rtw_odm.o
CC [M] /home/ali/rtl8188eus/core/rtw_rm.o
CC [M] /home/ali/rtl8188eus/core/rtw_rm_fsm.o
CC [M] /home/ali/rtl8188eus/core/efuse/rtw_efuse.o
CC [M] /home/ali/rtl8188eus/os_dep/osdep_service.o
/home/ali/rtl8188eus/os_dep/osdep_service.c: In function ‘rtw_change_ifname’:
/home/ali/rtl8188eus/os_dep/osdep_service.c:2454:28: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
2454 | _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
| ~~~~~~~^~~~~~~~~~
/home/ali/rtl8188eus/os_dep/osdep_service.c:899:24: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
899 | void _rtw_memcpy(void *dst, const void *src, u32 sz)
| ~~~~~~^~~
/home/ali/rtl8188eus/os_dep/osdep_service.c: In function ‘rtw_random32’:
/home/ali/rtl8188eus/os_dep/osdep_service.c:2578:16: error: implicit declaration of function ‘prandom_u32’; did you mean ‘prandom_u32_max’? [-Werror=implicit-function-declaration]
2578 | return prandom_u32();
| ^~~~~~~~~~~
| prandom_u32_max
At top level:
cc1: note: unrecognized command-line option ‘-Wno-sometimes-uninitialized’ may have been intended to silence earlier diagnostics
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-kali7-common/scripts/Makefile.build:255: /home/ali/rtl8188eus/os_dep/osdep_service.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-kali7-common/Makefile:2037: /home/ali/rtl8188eus] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-6.1.0-kali7-amd64’
make: *** [Makefile:2065: modules] Error 2
This happened when Kali updates this last time. I’ve used this adapter prior and when the new version came out the same method stopped working. I have not found a work around for it yet.
Lo arreglaste?
I have the same problem. Please help us solve this
Good afternoon, I have the same problem that nawi mentions, when I use the make command it starts up fine and then it gives me the same error as nawi, I read that someone said that it is due to the last update of kali,,, They have already found a solution to the problem ? Thank you so much
not scanning for networks
even after these methods
enter the monitor mode fine
my tl-wn722n v2 adapter goes into monitor mode after following this guide but packet injection doesn’t work i’m on kali linux kernel 6.5 any help would be appreciated
My too, no packet injection
Hey . I have a tp link tl-wn823n .
I run every command but it kept saying E: unable to locate the package or the file name realtek-rtl9182eu-dkms.
And to be honest I’m not sure if I’m supposed to download the tp link driver v2/v3 on windows 11 or in kali linux virtual machine , virtualbox ? I’m studying so I’m new into all of this .