WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Kali Linux on windows 10 WSL is not detecting WI-FI. cant able practice wifi hacking.

Open firewall1337 opened this issue 5 years ago • 28 comments

Windows Build Number

Microsoft Windows [Version 10.0.19043.1165]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

Kernel version: 5.4.72

Distro Version

Release: 2021.2

Other Software

No response

Repro Steps

  1. First i run this command "iwconfig" it will show : └─# iwconfig sit0 no wireless extensions.

bond0 no wireless extensions.

lo no wireless extensions.

eth0 no wireless extensions.

dummy0 no wireless extensions.

  1. when I run └─# wifite . .
    .´ · . . · . wifite2 2.5.8 : : : (¯) : : : a wireless auditor by derv82 . · /¯\ ´ · .´ maintained by kimocoder /¯¯¯\ ´ https://github.com/kimocoder/wifite2

[!] Warning: Recommended app pyrit was not found. install @ https://github.com/JPaulMora/Pyrit/wiki [!] Warning: Recommended app hcxdumptool was not found. install @ apt install hcxdumptool [!] Warning: Recommended app hcxpcapngtool was not found. install @ apt install hcxtools

[+] Checking airmon-ng... [!] airmon-ng did not find any wireless interfaces [!] Make sure your wireless device is connected [!] See http://www.aircrack-ng.org/doku.php?id=airmon-ng for more info

[!] Error: airmon-ng did not find any wireless interfaces

[!] Full stack trace below

[!] Traceback (most recent call last): [!] File "/usr/lib/python3/dist-packages/wifite/main.py", line 97, in entry_point [!] wifite.start() [!] File "/usr/lib/python3/dist-packages/wifite/main.py", line 51, in start [!] Configuration.get_monitor_mode_interface() [!] File "/usr/lib/python3/dist-packages/wifite/config.py", line 167, in get_monitor_mode_interface [!] cls.interface = Airmon.ask() [!] File "/usr/lib/python3/dist-packages/wifite/tools/airmon.py", line 313, in ask [!] raise Exception('airmon-ng did not find any wireless interfaces') [!] Exception: airmon-ng did not find any wireless interfaces

[!] Exiting

so I cant able to use wifi of my windows in my wsl so that I can practice wifi hacking.

Expected Behavior

evert wsl must and should have a feature of running the wifi of windows. so that security researcher can perform wifi hacking with authorization

Actual Behavior

cant able to use wifi of windows 10

Diagnostic Logs

No response

firewall1337 avatar Sep 06 '21 13:09 firewall1337

As far as I know, wsl2 runs within a VM. So you can't just use hardware devices like wireless cards directly from within wsl2.

jalaka avatar Sep 07 '21 23:09 jalaka

Being able to do PCIE-Passthrough and USB-Passthrough would be awesome :/

ThalusA avatar Sep 10 '21 17:09 ThalusA

@jalaka then how to use wifi from wsl2?

firewall1337 avatar Sep 16 '21 07:09 firewall1337

@jalaka then how to use wifi from wsl2?

You just can't

ThalusA avatar Sep 16 '21 08:09 ThalusA

@ThalusA that's what I am asking here to do something with this issue so that I can practice wifi pentesting

firewall1337 avatar Sep 17 '21 05:09 firewall1337

when introduce the feature?

SiNaPsEr0x avatar Sep 19 '21 21:09 SiNaPsEr0x

I would like to use for protocol analysis, to not need to reboot into a pendrive.

tiborkiss avatar Oct 15 '21 18:10 tiborkiss

would be great if it was possible. Is there not a solution for this?

Hector6704 avatar Oct 24 '21 22:10 Hector6704

Hmh bump

nyxb avatar May 29 '22 20:05 nyxb

Still I would like to use this feature...

tiborkiss avatar May 29 '22 20:05 tiborkiss

I'm wondering is this would be possible with a bus pass like USBIPD

frankfium avatar Jun 14 '22 19:06 frankfium

i think there is a way. I found this answer on unixstackchange from a guy. He litteraly says "Okay so, I edited the kernel itself to allow you to actually be able to use WiFi adapters as well as loadable modules, etc in WSL2

If anyone's interested here you go https://github.com/EDLLT/WSL2-Linux-Kernel" here is my source https://unix.stackexchange.com/questions/626328/are-usb-wi-fi-adapters-compatible-with-kali-in-wsl2

ldlb96 avatar Aug 31 '22 15:08 ldlb96

can confirm not working.

mcDandy avatar Sep 25 '22 19:09 mcDandy

I also made the kernel configuration. Since I wished to use the latest WSL2 kernel, I did from the scratch. Moreover I have another dongle (Alfa AWUS036ACH) which seems to not compile into the kernel by adding it directly to the source, but it compiles as dkms module. For me it works well, since then I can capture 802.11 packets with the above dongle and I can use WSL2 for hardware debuggers too. Here are my changes over the current officially released WSL2 https://github.com/tiborkiss/WSL2-Linux-Kernel/tree/linux-msft-wsl-5.10.102.1-rtlwifidongle

tiborkiss avatar Sep 26 '22 04:09 tiborkiss

Diff (MSFT 5.10.y <-tiborkiss 5.10-mod) for above: https://github.com/microsoft/WSL2-Linux-Kernel/compare/linux-msft-wsl-5.10.y...tiborkiss:WSL2-Linux-Kernel:linux-msft-wsl-5.10.102.1-rtlwifidongle

Appears to be a copy of changes from https://github.com/EDLLT/WSL2-Linux-Kernel that @ldlb96 highlighted 3 comments up. Notable differences are @EDLLT outlines his custom build instructions (https://github.com/EDLLT/WSL2-Linux-Kernel/blob/linux-msft-wsl-5.10.y/README.md) and shares his build here: https://github.com/EDLLT/WSL2-Linux-Kernel

aleph23 avatar Sep 29 '22 11:09 aleph23

There are more differences. First of all, the base from where it was made by @ldlb96 it was older than the current WSL2 kernel release. I manually configured the kernel config, like from the scratch, I have more things to use, plus my dongle is different. Hence is not a copy. But overall, is just a configuration of the kernel, it's normal that should look similar also the diff. I just posted here, to confirm that the method is working.. since I saw @mcDandy couldn't make it work.

tiborkiss avatar Sep 29 '22 14:09 tiborkiss

His is the latest 5.10.0.102.1 kernel. I bring it up because I am also wanting to upgrade to the 5.15 kernel and the only difference between your config and his is the one module -- so assuming that config works with 5.15 also. Is 5.15 the kernel you compiled?

aleph23 avatar Oct 04 '22 02:10 aleph23

I believe you can make this work by enabling hyper-v in Windows features. From there open wsl command prompt From windows start menu open hyper-v program and enable external adapters from wsl and select your specific adapter. Try reinstalling drivers And hopefully this good to go.

Plan b- bootable USB or vmware

FuriousSlothing avatar Jan 22 '23 18:01 FuriousSlothing

I'm in 2023, still not working :/

R0K0R avatar Aug 31 '23 16:08 R0K0R

@jalakaentão como usar o wifi do wsl2?

You need a ralink usb wifi rt5370 for network conection!!!

NSouza23 avatar Oct 14 '23 19:10 NSouza23