Problem Statement
Calling pcap_activate() results in a PCAP_ERR_RFMON_NOTSUP error, i.e. the RF monitor mode is not supported.
Context
I am writing a small C program whose task is to listen to my laptopβs Wi-Fi card in monitor mode. The laptop runs Ubuntu 12.04 LTS. I ran the command airmon-ng start wlan0 , after which the mon0 interface appeared. After outputting the iwconfig command after running the airmon command:
$ iwconfig mon0 IEEE 802.11bgn Mode:Monitor Tx-Power=16 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off eth0 no wireless extensions. lo no wireless extensions. wlan0 IEEE 802.11bgn ESSID:"SKY88F48" Mode:Managed Frequency:2.412 GHz Access Point: 7C:4C:A5:3B:33:59 Bit Rate=52 Mb/s Tx-Power=16 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality=43/70 Signal level=-67 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:4 Invalid misc:415 Missed beacon:0
Question
In my program, I create a network descriptor on a mon0 device using pcap_create() . Then I set the snapshot length and promiscuous mode.
When I check if rfmon can be set using the pcap_can_set_rfmon() method, it returns a positive result. Then I install rfmon using the pcap_set_rfmon() method, which succeeds. I also set a timeout. Finally, when I call pcap_activate() , it returns the PCAP_ERR_RFMON_NOTSUP error, that is, the RF monitoring mode is not supported. I run my program as root.
It should be noted that I installed wirehark and started listening to mon0, which successfully captured all the traffic.
source share