TP-Link Archer T4U v3 USB Wifi adapter drivers for Kali 2020 (realtek-rtl88xxbu)


I am running 5.8.0-kali2-amd64 Kali in VirtualBox


I have tried to install the offical TP-Link drivers https://www.tp-link.com/au/support/download/archer-t4u/#Driver and followed the instructions in https://static.tp-link.com/2018/2018...or%20Linux.pdf under Kali 2018.1 (doc shows only tested to be compatible with the Linux kernel 2.6.18 ~ 4.11) and got error messages


Here is what I get when I try to install the official driver:

$ sudo apt-get clean
$ sudo apt-get update
$ sudo apt-get upgrade


$ sudo apt-get install linux-headers-$(uname -r)
kali@kali:~/source-code/T4Uv3_WiFi_linux_v5.3.1_beta$ dpkg-query -s linux-headers-$(uname -r)


Package: linux-headers-5.8.0-kali2-amd64
Status: install ok installed
Priority: optional
Section: kernel
Installed-Size: 5701
Maintainer: Kali Developers devel@kali.org
Architecture: amd64
Source: linux
Version: 5.8.10-1kali1
Depends: linux-headers-5.8.0-kali2-common (= 5.8.10-1kali1), linux-kbuild-5.8 (>= 5.8.10-1kali1), linux-compiler-gcc-10-x86
Description: Header files for Linux 5.8.0-kali2-amd64
This package provides the architecture-specific kernel header files for
Linux kernel 5.8.0-kali2-amd64, generally used for building out-of-tree
kernel modules. These files are going to be installed into
/usr/src/linux-headers-5.8.0-kali2-amd64, and can be used for building
modules that load into the kernel provided by the
linux-image-5.8.0-kali2-amd64 package.
Homepage: kali.org


I am getting the following error:


kali@kali:~/source-code/T4Uv3_WiFi_linux_v5.3.1_beta$ make

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.8.0-kali2-amd64/build M=/home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta modules
make[1]: Entering directory '/usr/src/linux-headers-5.8.0-kali2-amd64'
CC [M] /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.o
In file included from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/drv_types.h:30,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.c:17:
/home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/wifi.h:1031: warning: "IEEE80211_MAX_AMPDU_BUF" redefined
1031 | #define IEEE80211_MAX_AMPDU_BUF 0x40
|
In file included from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/osdep_service_linux.h:83,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/osdep_service.h:50,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/drv_types.h:27,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.c:17:
/usr/src/linux-headers-5.8.0-kali2-common/include/linux/ieee80211.h:1600: note: this is the location of the previous definition
1600 | #define IEEE80211_MAX_AMPDU_BUF 0x100
|
In file included from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/drv_types.h:78,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.c:17:
/home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/rtw_security.h:252:8: error: redefinition of ?struct sha256_state?
252 | struct sha256_state {
| ^~~~~~~~~~~~
In file included from /usr/src/linux-headers-5.8.0-kali2-common/include/linux/filter.h:23,
from /usr/src/linux-headers-5.8.0-kali2-common/include/net/sock.h:59,
from /usr/src/linux-headers-5.8.0-kali2-common/include/linux/tcp.h:19,
from /usr/src/linux-headers-5.8.0-kali2-common/include/linux/ipv6.h:88,
from /usr/src/linux-headers-5.8.0-kali2-common/include/net/addrconf.h:50,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/osdep_service_linux.h:48,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/osdep_service.h:50,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/include/drv_types.h:27,
from /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.c:17:
/usr/src/linux-headers-5.8.0-kali2-common/include/crypto/sha.h:84:8: note: originally defined here
84 | struct sha256_state {realtek-rtl88xxbu
| ^~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-5.8.0-kali2-common/scripts/Makefile.build:286: /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_cmd.o] Error 1
make[2]: *** [/usr/src/linux-headers-5.8.0-kali2-common/Makefile:1764: /home/kali/source-code/T4Uv3_WiFi_linux_v5.3.1_beta] Error 2
make[1]: *** [/usr/src/linux-headers-5.8.0-kali2-common/Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.8.0-kali2-amd64'
make: *** [Makefile:1999: modules] Error 2


The USB device does show up in Kali even without loaded drivers!


kali@kali:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 2357:0115 TP-Link Archer T4U ver.3
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


This appears to be a Realtek 802.11ac chipset?


However, it is not loaded (cannot find a loaded driver)


kali@kali:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:26:49:72 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.4/24 brd 10.0.2.255 scope global dynamic noprefixroute eth0
valid_lft 413sec preferred_lft 413sec
inet6 fe80::a00:27ff:fe26:4972/64 scope link noprefixroute
valid_lft forever preferred_lft forever


kali@kali:~$ lsmod
Module Size Used by
fuse 143360 1
btrfs 1523712 0
blake2b_generic 20480 0
xor 24576 1 btrfs
zstd_compress 188416 1 btrfs
raid6_pq 122880 1 btrfs
zstd_decompress 86016 1 btrfs
ufs 94208 0
qnx4 16384 0
hfsplus 126976 0
hfs 73728 0
minix 45056 0
vfat 20480 0
msdos 20480 0
fat 86016 2 msdos,vfat
jfs 212992 0
xfs 1544192 0
libcrc32c 16384 2 btrfs,xfs
dm_mod 163840 0
rfkill 28672 1
vboxsf 94208 1
intel_rapl_msr 20480 0
joydev 28672 0
intel_rapl_common 32768 1 intel_rapl_msr
rapl 16384 0
pcspkr 16384 0
sg 36864 0
vboxguest 385024 6 vboxsf
serio_raw 20480 0
ac 16384 0
evdev 28672 10
binfmt_misc 24576 1
sunrpc 569344 1
ip_tables 32768 0
x_tables 53248 1 ip_tables
autofs4 53248 2
ext4 786432 1
crc16 16384 1 ext4
mbcache 16384 1 ext4
jbd2 139264 1 ext4
crc32c_generic 16384 0
hid_generic 16384 0
usbhid 65536 0
hid 147456 2 usbhid,hid_generic
sd_mod 61440 3
t10_pi 16384 1 sd_mod
crc_t10dif 20480 1 t10_pi
sr_mod 28672 0
cdrom 73728 3 hfsplus,hfs,sr_mod
crct10dif_generic 16384 0
ata_generic 16384 0
crct10dif_pclmul 16384 1
crct10dif_common 16384 3 crct10dif_generic,crc_t10dif,crct10dif_pclmul
crc32_pclmul 16384 0
crc32c_intel 24576 3
ghash_clmulni_intel 16384 0
vmwgfx 380928 2
ahci 40960 2
ttm 122880 1 vmwgfx
libahci 45056 1 ahci
ata_piix 36864 0
xhci_pci 20480 0
xhci_hcd 286720 1 xhci_pci
drm_kms_helper 262144 1 vmwgfx
cec 49152 1 drm_kms_helper
aesni_intel 372736 0
libaes 16384 1 aesni_intel
crypto_simd 16384 1 aesni_intel
cryptd 24576 2 crypto_simd,ghash_clmulni_intel
glue_helper 16384 1 aesni_intel
psmouse 180224 0
libata 290816 4 ata_piix,libahci,ahci,ata_generic
e1000 159744 0
usbcore 323584 3 xhci_hcd,usbhid,xhci_pci
drm 618496 5 vmwgfx,drm_kms_helper,ttm
usb_common 16384 2 xhci_hcd,usbcore
i2c_piix4 28672 0
scsi_mod 258048 4 sd_mod,libata,sg,sr_mod
battery 20480 0
video 53248 0
button 24576 0


The official driver is a "88x2bu". I checked under kernel wireless drivers but cannot find a suitable driver to load

Can anyone help point me to a driver I could use please? TP-Link will not update their official driver to be compatible with Kali 2020 I ran into a dead end with their support


kali@kali:~$ ls /lib/modules/5.8.0-kali2-amd64/kernel/drivers/net/wireless/realtek/rtlwifi/


btcoexist rtl8192c rtl8192cu rtl8192ee rtl8723ae rtl8723com rtl_pci.ko rtlwifi.ko
rtl8188ee rtl8192ce rtl8192de rtl8192se rtl8723be rtl8821ae rtl_usb.ko




kali@kali:~$ ls /lib/modules/5.8.0-kali2-amd64/kernel/drivers/net/wireless/realtek/rtw88


rtw88_8723de.ko rtw88_8822be.ko rtw88_8822ce.ko rtw88_core.ko
rtw88_8723d.ko rtw88_8822b.ko rtw88_8822c.ko rtw88_pci.ko