I come from a linux background and recently acquired a mac. In linux I had a lot of scripts written in python that were used to do specific packet sniffing and capturing. Dedicated deauthentication packet capturing or other wireless probes. For that I would set my wireless adapter to monitor mode and either use scapy or the command
sniff = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
Sadly, I have discovered that this style of sniffing is not supported by OS X. I am aware of the airport command and the hidden wireless sniffer provided by apple, but their usage is very limited. I was looking for something I could use with my scripts.
I was wondering if anyone has figured a way around this issue. Is it possible to add this feature to languages like python and ruby?
If not, can a packet sniffer be coded in swift with the same functionalities?
Sadly, I have discovered that this style of sniffing is not supported by OS X.
Yeah, it's a BSD-flavored OS, so, instead of Linux-style PF_PACKET sockets, it has BSD-style BPF devices.
I was wondering if anyone has figured a way around this issue
Yes. It's called "use libpcap, which will use PF_PACKET sockets on Linux and BPF devices on OSes that have BPF devices and other mechanisms on OSes that have other packet capture mechanisms, rather than directly using the native OS mechanism".
Is it possible to add this feature to languages like python
As "this feature" means "using libpcap", yes, it is. You could also use Scapy, which offers higher-level APIs than just "get me the raw bytes of captured packets" APIs.
and ruby?
Yes.