kpcyrd / sniffglue

Secure multithreaded packet sniffer
https://crates.io/crates/sniffglue
GNU General Public License v3.0
1.08k stars 94 forks source link

[MacOS] Failed to activate interface #122

Open yatzbim opened 1 year ago

yatzbim commented 1 year ago

Description

Out of the box, running sniffglue with or without arguments on MacOS Monterey 12.6 returns the following error:

Error: Failed to activate interface: (cannot open BPF device) /dev/bpf0: Permission denied

Info

yatzbim commented 1 year ago

The man page for pcap_activate() (link) describes the following failure mode:

PCAP_ERROR_PERM_DENIED if the process doesn't have permission to open the capture source

Which makes sense as sniffglue works when run as root.

Question is--how do we check those permissions either during or immediately following install?