1

I recently bought an ALFA AWUSO36EAC and I want to use it for packet injection and monitor mode on Mac OS. I was told that this is a better page to ask about Network Card related questions. I have installed the drivers and it connects to wifi just fine. However I cannot get it to go into monitor mode. I have used the pcap library. Here is my c++ code if it is relevant:

    char errbuf[PCAP_ERRBUF_SIZE];
    char dev[] = "en7";
    pcap_t *handler=pcap_create(dev, errbuf);

    if (handler == NULL){
        printf("unable to put in monitor mode\n");
        return -1;
    }
    if(pcap_can_set_rfmon(handler) == 1){
        printf("monitor mode can be set \n");
        if(pcap_set_rfmon(handler, 1) == 0){
            printf("monitor mode enabled\n");
        }
        pcap_set_snaplen(handler, 2048); //sets the max packet size to 2048 bytes
        pcap_set_promisc(handler, 0); //turns off promiscuous mode
        pcap_set_timeout(handler, 10000); //sets the timeout to 10 seconds
        int status = pcap_activate(handler);
        /* start the loop of capture, loop 5 times */
        pcap_loop(handler, 0, (pcap_handler)got_packet, NULL);
        pcap_close(handler);
    }
    else{
        std::cout << "this was the return code: " << pcap_can_set_rfmon(handler) << std::endl;  
        printf( "This could not be opened as %s \n", pcap_geterr(handler));
        printf("This was the errbuf output: %s \n", errbuf);
    }

If I were to use it with the wifi drivers that come with the computer it works fine. However, if I use it with the alfa wifi card, it does not give me the error as to why it isn't able to put it into monitor mode. It just is not able to put it into monitor mode. I want to know if there is a way to over ride any blocks that are keeping a Mac OS from putting the driver into monitor mode. Because, I know that the driver does support monitor mode and packet injection.

Update

The reason in which I bought the third party network system is only because it said that it supported packet injection and Monitor Mode. I have been unable to use packet injection on the new Mac OS Catalina. I have, however, been able to put it into monitor mode. Is there a way to over ride the system on a mac to make it use packet injection? I am assuming this would be using a c language, if there is another library that can do this, please post it.

Sam Moldenha
  • 111
  • 3
  • What makes you think ALFA put monitor mode support into their macOS driver? Monitor mode APIs are different on different OSes. I would assume they just didn't bother to implement it for macOS. BTW macOS has excellent monitor mode and packet injection support in their built-in drivers for their built-in cards, and their hardware is high quality. It doesn't make much sense to use some cheap third party product for this when you've got a Mac. – Spiff Oct 25 '20 at 17:59
  • I wouldn't use another product, but the problem is that Mac OS Catalina doesn't support packet injection. Do you know how to make it work on Catalina the newest version? That is the reason I bought the third party project. – Sam Moldenha Oct 26 '20 at 04:35

0 Answers0