gnab / rtl8812au

Realtek 802.11n WLAN Adapter Linux driver
1.68k stars 546 forks source link

Monitor Mode - Possible? Related: virtual interfaces #24

Open tz1 opened 9 years ago

tz1 commented 9 years ago

I'm willing to help if I can get a bit of a start, but I'd like to run some of the monitor utilities (aircrack-ng, wash/reaver, etc.) on these, especially with 5GHz support. I'm not sure if the chipset has support.

Also, the "iw" program can - on supported cards - create multiple virtual interfaces per physical interface, and depending on hardware, one can be an AP, another monitor, another client.

http://wireless.kernel.org/en/users/Documentation/iw/vif/

This might let me use one device for both my AP and upstream connection, and/or two APs, one on each band, etc.

colindean commented 9 years ago

:+1:

acidjazz commented 9 years ago

:+1:

acidjazz commented 9 years ago

Hey all, hoping to bring this request back to life, monitor mode support for this driver would make ALOT of people happy, as you can see here in the wireless scanning community there are a lot of good newer cards that require this. Like this Great Netis and this Awesome new Alfa adapter.

I'm positive the chipset of the Alfa supports it and can quickly test as I have a couple with me.

keralo commented 9 years ago

I agree we need monitor mode on this one^^

cjemorton commented 9 years ago

Is there any support for monitor mode with this driver yet?

bits3rpent commented 9 years ago

No

nikicat commented 8 years ago

There is monitor mode support in 4.3.22 version of the driver.

keralo commented 8 years ago

have you tried it? and how do i install it on a kali or ubuntu

hundleyt commented 8 years ago

When I try to install 4.3.22 using the same directions for the 4.0.0 driver here (https://wiki.gentoo.org/wiki/AC1200_Wireless_Adapters) the make command fails. Am I missing something?

donahue95 commented 8 years ago

4.3.22 has introduced new errors or reintroduced old errors when one attempts compilation with gcc-4.9.3 and other current Gentoo build tools. May work fine with other build tool setups. I see: "make make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.3.0-rc7/build M=/root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta modules make[1]: Entering directory '/usr/src/linux-4.3-rc7' CC [M] /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/core/rtw_cmd.o In file included from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/include/drv_types.h:95:0, from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/core/rtw_cmd.c:22: /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/include/hal_com.h:519:13: error: ‘file_path’ redeclared as different kind of symbol extern char file_path[PATH_LENGTH_MAX]; ^ In file included from include/linux/compat.h:15:0, from include/linux/ethtool.h:15, from include/linux/netdevice.h:42, from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/include/osdep_service_linux.h:35, from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/include/osdep_service.h:41, from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/include/drv_types.h:32, from /root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/core/rtw_cmd.c:22: include/linux/fs.h:2552:14: note: previous declaration of ‘file_path’ was here extern char _file_path(struct file , char , int); ^ scripts/Makefile.build:258: recipe for target '/root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/core/rtwcmd.o' failed make[2]: ** [/root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta/core/rtw_cmd.o] Error 1 Makefile:1378: recipe for target 'module/root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta' failed make[1]: * [module/root/rtl8812AU_8821AU_linux_v4.3.22_15054.20150901_beta] Error 2 make[1]: Leaving directory '/usr/src/linux-4.3-rc7' Makefile:1669: recipe for target 'modules' failed make: * [modules] Error 2"

https://github.com/Grawp/rtl8812au_rtl8821au/tree/4.3.22 may correct this and other errors or may be work in progress.

donahue95 commented 8 years ago

https://github.com/Grawp/rtl8812au_rtl8821au/tree/4.3.22 fails with "make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.3.0-rc7/build M=/root/rtl8812au_rtl8821au-4.3.22 modules make[1]: Entering directory '/usr/src/linux-4.3-rc7' CC [M] /root/rtl8812au_rtl8821au-4.3.22/core/rtw_cmd.o cc1: error: -Werror=incompatible-pointer-types: no option -Wincompatible-pointer-types scripts/Makefile.build:258: recipe for target '/root/rtl8812au_rtl8821au-4.3.22/core/rtw_cmd.o' failed make[2]: * [/root/rtl8812au_rtl8821au-4.3.22/core/rtw_cmd.o] Error 1 Makefile:1378: recipe for target 'module/root/rtl8812au_rtl8821au-4.3.22' failed make[1]: * [module/root/rtl8812au_rtl8821au-4.3.22] Error 2 make[1]: Leaving directory '/usr/src/linux-4.3-rc7' Makefile:1682: recipe for target 'modules' failed make: *\ [modules] Error 2

nikicat commented 8 years ago

It compiles fine on Archlinux (but with a lot of warnings), but after loading the driver my system is unstable (may hang after certain commands). After several trial-and-errors I've finally can monitor wireless traffic using it.

litew commented 8 years ago

Hello.

Some good news with this driver: https://github.com/Grawp/rtl8812au_rtl8821au/tree/4.3.22 I have D-Link DWA-171 rev A1 USB-dongle

# lsusb Bus 001 Device 002: ID 2001:3314 D-Link Corp.

Commented out this line in Makefile (otherwise it fails with error which was mentioned by donahue95):

EXTRA_CFLAGS += -Werror=incompatible-pointer-types

and then it builds fine.

It's working in monitor mode but only when i set it up with iwconfig, not airmon-ng / iw:

# uname -a Linux kali 4.0.0-kali1-amd64 #1 SMP Debian 4.0.4-1+kali2 (2015-06-03) x86_64 GNU/Linux # iwconfig wlan0 mode monitor # iwconfig wlan0 wlan0 unassociated Nickname:"WIFI@REALTEK" Mode:Monitor Frequency=2.412 GHz Access Point: Not-Associated [...]

Airodump-ng works (not stable thou, some troubles with channel rotation, but I still can get some wpa handshakes from my network).

zhangbo commented 8 years ago

@Litew My WiFi device is TL-WDN6200 . Follow your way the monitor mode is On but airodump-ng crash in a minute.

lsusb

Bus 002 Device 003: ID 2357:0101 but no manufacture info.

dmesg | grep -i usb

2.156562] usb 1-2: Product: VMware Virtual USB Hub [ 2.160292] usb 2-2: New USB device found, idVendor=2357, idProduct=0101 [ 2.160295] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.160296] usb 2-2: Product: 802.11n NIC [ 2.160297] usb 2-2: Manufacturer: Realtek [ 2.160298] usb 2-2: SerialNumber: 123456

iwconfig wlan0

wlan0 unassociated Nickname:"WIFI@REALTEK" Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0

I thought the driver for TL-WDN6200 is not so stable.

I wonder that bully and reaver is good to use?

zhangbo commented 8 years ago

@Litew airmon-ng start wlan0 is not working. Setting channels also failed.

cat: /sys/class/ieee80211/phy0/device/net/wlan0mon/type: No such file or directory

If any drivers could fix this, please let me know :)

QUOTE:

airmon-ng start wlan0

PHY Interface Driver Chipset

phy0 wlan0 ??????

Error setting channel: command failed: Operation not supported (-95)

    (mac80211 monitor mode already enabled for [phy0]wlan0 on [phy0]10)
wangjiyang commented 8 years ago

Finally find a workaround way to put this device into monitor mode and set desired channel. It's enough to sniff wireless packets by wireshark.

  1. Compile driver from https://github.com/Grawp/rtl8812au_rtl8821au and install it.
  2. run rmmod 8812au
  3. modprobe 8812au rtw_channel=CHANNEL_YOU_WANT_TO_SET
  4. ifconfig wlan0 up
  5. iwconfig wlan0 mode monitor
  6. run iwconfig and check if it's set to monitor mode and desired channel.
bigfeng12 commented 8 years ago

@wangjiyang

Does this driver support 80211 sniffer capture?

https://github.com/Grawp/rtl8812au_rtl8821au

raphaell commented 8 years ago

@bigfeng12 Working but difficult to change channel. There is a command to change wifi frequency so called "iw" ex) iw dev $interface set freq 2417 but it doesn't support. and also iwconfig. ex) iwconfig $interface channel 6 Set it, if trying to modprobe ... rtw_channel=CHANNEL_YOU_WANT_TO_SET

bigfeng12 commented 4 years ago

@raphaell,

  1. yes, that 8812au wlan driver sniffer mode works on linux platform, but only HT20 bandwidth OK, and how to make it work on HT40 work? even VHT40 VHT80?