mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 375 forks source link

SIOCGIWPRIV: Argument list too long #356

Open aalexson617 opened 5 years ago

aalexson617 commented 5 years ago

Running the latest version of libtins from master. with version 1.9.0 of libpcap.

The beacon example runs fine with a 2.4ghz wifi card, but throws the following exception when used with an rtl8812AU based card.

Terminate called after throwing an instance of 'Tins::pcap_error'
   what(): wlan0: SIOCGIWPRIV: Argument list too long

I can use the card for monitoring on wireshark. I have compiled and rebuilt several drivers for the rtl8812AU card and several version of libiw but all seem to produce the same result. Seems to trace back to iwlib.c but I have run out of ideas.

stepen commented 4 years ago

I get exactly the same issue (on a RaspberryP 4B)

"wlan1: SIOCGIWPRIV: Argument list too long"

but in a sniffer-loop running with either stable(v5.3.4) or latest(v5.6.4.2) aricrack-ng 8812au driver (https://github.com/aircrack-ng/rtl8812au).

Seems to relate to libpcap and something not implemented in the driver. (https://github.com/aircrack-ng/rtl8812au/issues/441).

I know, 'dosen't help much' :-)

/STPE

Joe-DN commented 4 years ago

This looks like an issue with the pcap filter being set. In the becon example, change the filter from

config.set_filter("type` mgt subtype beacon");

to

config.set_filter("type mgt && subtype beacon");

I think this is an issue with the implementation of the pcap filter (in libpcap)?

ok-developer commented 4 years ago

Removing set_rfmon(true) from SnifferConfiguration object helps to solve this issue. You need to set monitoring mode by yourself. For example:iw dev wlan1 set type monitor. Also will help with raw pcap handler by removing pcap_set_rfmon() function.