Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Whether monitor mode implemented on this driver? #2

Open
athensy opened this issue May 3, 2018 · 6 comments
Open

Whether monitor mode implemented on this driver? #2

athensy opened this issue May 3, 2018 · 6 comments

Comments

@athensy
Copy link

athensy commented May 3, 2018

As title, I would like to know whether this driver support monitor mode? I try to put Wsky 1200 into monitor mode by airmon-ng (from aircrack), but it hangs up the terminal shell.

@cilynx
Copy link
Owner

cilynx commented May 3, 2018

I can confirm the bug. Running airmon-ng with the Wsky interface hangs (unkillable) airmon-ng and screws up the entire network stack making the OS unstable and making it impossible to even reboot cleanly.

Interface 15mon is too long for linux so it will be renamed to the old style (wlan#) name.


 ERROR adding monitor mode interface: command failed: Operation not supported (-95)

As a rule, most vendor drivers do not support monitor mode, but there are mentions of it in the original source here. I'll have to do some digging.

@cilynx
Copy link
Owner

cilynx commented May 3, 2018

Confirmed monitor mode is not supported by this driver. Need to dig more into why and how hard it would be to get it working. It's probably also worth looking into the level of effort required to bake rtl88x2bu support into the mainline rtl8xxxu effort.

rcw@burner:~$ sudo iw wl[xxxxxxxxxxxxx] set type monitor
command failed: Operation not supported (-95)
rcw@burner:~$ 

@cilynx
Copy link
Owner

cilynx commented May 3, 2018

If you enable CONFIG_WIFI_MONITOR and rebuild the driver, things look promising:

rcw@burner:~/Projects/rtl88x2bu$ sudo iw wl[xxxxxxxxxxxxx] set type monitor
rcw@burner:~/Projects/rtl88x2bu$ sudo iw dev
phy#3
	Interface wl[xxxxxxxxxxxxx]
		ifindex 6
		wdev 0x300000001
		addr xx:xx:xx:xx:xx:xx
		type monitor
		txpower 12.00 dBm
rcw@burner:~/Projects/rtl88x2bu$

However, while airmon-ng initially looks like it's working, it still hangs, destabilizes DNS, and forces a hard reboot to get back to a fully-functional state:

rcw@burner:~$ sudo airmon-ng start wl[xxxxxxxxxxxxx] 

PHY	Interface	Driver		Chipset

phy1	wl[xxxxxxxxxxxxx]	rtl88x2bu	Realtek Semiconductor Corp. 
Interface 15mon is too long for linux so it will be renamed to the old style (wlan#) name.

		(mac80211 monitor mode vif enabled on [phy1]wlan0mon

@cilynx
Copy link
Owner

cilynx commented May 3, 2018

Playing around with kismet, it fails to create a mon VIF, but successfully falls back to putting the real interface into Monitor Mode without hanging or jacking up the network stack. Unfortunately, it doesn't ever receive any packets / see any networks or clients.

I'm out of time to dig into this today. If you feel like poking around with things further, I'd be interested to hear what you find.

@athensy
Copy link
Author

athensy commented May 4, 2018

Hi cilynx, thanks for your effort to study this issue.

I recompile the driver with CONFIG_WIFI_MONITOR flag set on, and with similar result you posted.

Then one question go through my mind: Is switching a WiFi adapter to monitor mode a generic process, or it is vendor related? i.e. It depends on hardware design. If it is vendor related, then it may be harder to implement monitor mode by outsider without detail hardware information. However, if it is not hardware dependence (or fully dependence), a "stupid" way to tackle this issue is to study source code of another WiFi dongle driver with monitor mode implemented.

I know C programming, but knowledge of Linux driver is very very thin, so I don't even have a starting point to learn a WiFi driver like this one. Could you point me a direction, or give me some hints?

@athensy
Copy link
Author

athensy commented May 4, 2018

CONFIG_WIFI_MONITOR control the compiling option for program "os_dep/linux/ioctl_cfg80211.c", and affect the value "software_iftypes" of object "wiphy". Definition of "nl80211_iftype" is on lines 1719 - 1733 of this program file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants