microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.54k stars 823 forks source link

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

Open firewall1337 opened 3 years ago

firewall1337 commented 3 years ago

Windows Build Number

Microsoft Windows [Version 10.0.19043.1165]

WSL Version

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

jalaka commented 3 years ago

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.

ThalusA commented 3 years ago

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

firewall1337 commented 3 years ago

@jalaka then how to use wifi from wsl2?

ThalusA commented 3 years ago

@jalaka then how to use wifi from wsl2?

You just can't

firewall1337 commented 3 years ago

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

SiNaPsEr0x commented 3 years ago

when introduce the feature?

tiborkiss commented 3 years ago

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

Hector6704 commented 3 years ago

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

nyxb commented 2 years ago

Hmh bump

tiborkiss commented 2 years ago

Still I would like to use this feature...

frankfium commented 2 years ago

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

ldlb96 commented 2 years ago

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

mcDandy commented 2 years ago

can confirm not working.

tiborkiss commented 2 years ago

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

aleph23 commented 2 years ago

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

tiborkiss commented 2 years ago

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.

aleph23 commented 2 years ago

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?

FuriousSlothing commented 1 year ago

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

R0K0R commented 1 year ago

I'm in 2023, still not working :/

NSouza23 commented 1 year ago

@jalakaentão como usar o wifi do wsl2?

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

ishaan-kapoor commented 9 months ago

hey, could any of you get it to work?

Harsh181882 commented 9 months ago

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.

so can we use hardware devices with a live OS

TheAjaykrishnanR commented 5 months ago

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

Absolutely worked with my tp link archer ac600 t2u Plus

TheAjaykrishnanR commented 5 months ago

hey, could any of you get it to work?

yep

ooplaza commented 1 month ago

Still not working on 2024?