aircrack-ng / rtl8812au

RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection
GNU General Public License v2.0
3.39k stars 749 forks source link

Aircrack with Ubuntu in Windows Subsystem for Window #1133

Open Roadracerboy opened 5 months ago

Roadracerboy commented 5 months ago

I been using Aircrack with VMware and Kali Linux with success, the last week I been working to get Aircrack work in Ubuntu and WSL inside Windows (windows subsystem for Linux).

First it appeared impossible to get the wifi-device (rtl8812au) to show up in Ubuntu but then I find this fantastic "USBIPD-win" that connects the usb from windows into linux.

Installed aircrack-ng, the driver and NetworkManager

I get it to work like expected and in Ubuntu the device shows up with lusub

$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac 2T2R DB WLAN Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But with nmcli the device does not show up as wlan0 as it does fine in Kali/vmware

$ nmcli d
DEVICE  TYPE      STATE      CONNECTION
eth0    ethernet  unmanaged  --
lo      loopback  unmanaged  --

Airmon-ng doesnt either show my device (wlan0) as it does fine in Kali/vmware

$ sudo airmon-ng
PHY     Interface       Driver          Chipset

So now Im stucked here and need some advices to wich direction I must go, what am I missing?

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2. https://github.com/dorssel/usbipd-win

WSL support https://github.com/dorssel/usbipd-win/wiki/WSL-support

The installed driver: https://github.com/aircrack-ng/rtl8812au

My aircrack-installation: https://github.com/aircrack-ng/rtl8812au

Linux DESKTOP-NGT 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

RazviAlex commented 4 months ago

same problem here.. when trying to make dkms_install

mkdir: created directory '/usr/src/8812au-5.6.4.2_35491.20191025' cp -r * /usr/src/8812au-5.6.4.2_35491.20191025 dkms add -m 8812au -v 5.6.4.2_35491.20191025 Creating symlink /var/lib/dkms/8812au/5.6.4.2_35491.20191025/source -> /usr/src/8812au-5.6.4.2_35491.20191025 dkms build -m 8812au -v 5.6.4.2_35491.20191025 Error! Your kernel headers for kernel 5.15.133.1-microsoft-standard-WSL2 cannot be found at /lib/modules/5.15.133.1-microsoft-standard-WSL2/build or /lib/modules/5.15.133.1-microsoft-standard-WSL2/source. Please install the linux-headers-5.15.133.1-microsoft-standard-WSL2 package or use the --kernelsourcedir option to tell DKMS where it's located. make: *** [Makefile:1788: dkms_install] Error 1

hwertz commented 3 months ago

Please install the linux-headers-5.15.133.1-microsoft-standard-WSL2 package or use the --kernelsourcedir option to tell DKMS where it's located.

This looks like the relevant part. What happens if from a WSL shell you run sudo apt-get install linux-headers-5.15.133.1-microsoft-standard-WSL2? (I've read comments that with WSL, you may have to run sudo apt update first, I think Ubuntu and Debian ship with a list of available packages "out of the box" (which is updated when you check for package updates) but perhaps WSL doesn't, this gets that list.)

Also, if you look in /usr/src/ and there's a linux-headers-5.15.133.1 in there with a slightly different name, symlink it -- ln -s linux-headers-5.15.133.1-generic linux-headers-5.15.133.1-microsoft-standard-WSL2 for instance. I had that happen at some point, I ran some custom kernel or whatever and for some reason the name of the headers in /usr/src and one the scripts get from uname -a or whatever didn't quite match.

I'll also add that (if WSL doesn't come with it arleady installed), there's a package "build-essential" that makes sure the compiler and stuff are installed (although I wouldn't be surprised if dkms didn't already have that as a depdency.)