diederikdehaas / rtl8812AU

Realtek 8812AU USB WiFi driver
Other
475 stars 177 forks source link

Allow to set channel when in monitor mode #8

Closed edupsousa closed 8 years ago

edupsousa commented 8 years ago

The original driver (4.3.22-beta) has monitor mode, but won't allow to change the channel currently being monitored. When using channel hoping mode on airodump-ng and Kismet the netlink returns "operation not supported error". The changes i`m submitting allow the driver to change channels when in monitor mode (when kernel version is >= 3.8), allowing channel hoping to function correctly. Tested modifications with Kismet and airodump-ng and channels are now changed correctly.

https://www.kernel.org/doc/htmldocs/80211/API-struct-cfg80211-ops.html

diederikdehaas commented 8 years ago

Thanks for this :+1:

Can you give me a (step by step) description how I can test this myself? I have never used/tried this myself, but it sounds interesting.

edupsousa commented 8 years ago

Sure, i followed the steps described on this page ( http://blog.silic.io/blog/2013/09/17/installing-kismet-and-airckrack-ng-on-a-raspberry-pi/) to install on RPi2 (jump directly to "Installing [Aircrack-ng | Kismet]" section).

Using the rtl8812AU driver i could start the monitor mode directly on the original Linux device (wlan0), so on the section "Configuring the interface" you don't need to create a new "mon0" device to start monitor mode, you can set the monitor mode on wlan0 instead by:

iw dev wlan0 set type monitor

Set a initial channel by:

iw dev wlan0 set channel 6

After this you can start Kismet ou Airodump-ng on the interface.

Note: looks like Kismet have some trouble capturing on the first time you start it (something about get the current channel). If you close it and start again everything works fine. I will address this issue as soon as possible.

Hope it helps.

Em qua, 13 de jan de 2016 às 07:25, Diederik de Haas < notifications@github.com> escreveu:

Thanks for this [image: :+1:]

Can you give me a (step by step) description how I can test this myself? I have never used/tried this myself, but it sounds interesting.

— Reply to this email directly or view it on GitHub https://github.com/diederikdehaas/rtl8812AU/pull/8#issuecomment-171228685 .

diederikdehaas commented 8 years ago

Thanks :+1:

edupsousa commented 8 years ago

Changed spaces to tabs, sorry for this i though my IDE was on "auto" mode.

diederikdehaas commented 8 years ago

No need to be sorry, I actually felt bad about nagging about such a small thing :wink:

So far all my (compile) tests went fine, just a couple of more on my Pi, but it's looking good :smile:

diederikdehaas commented 8 years ago

Thank you very much @edupsousa :+1:

edupsousa commented 8 years ago

I`m glad to help, will test the changes on AP creation with hostapd (i saw forum messages of people struggling to set channels in AP mode), maybe this change could have solved the problem.

diederikdehaas commented 8 years ago

Cheers for that :+1:

If there are more changes needed, I'm happy to accommodate that.