How can i get on my iMAC read access to BPF devices in /dev/bpf*

Ls.


How can i get/change on my iMAC read access to BPF devices in /dev/bpf*

I want to use Wireshark.


Thanks in advance.


Loekie.

iMac, Mac OS X (10.6.7), I want to use Wireshark

Posted on May 15, 2011 1:27 PM

Reply
15 replies

May 15, 2011 4:29 PM in response to Linc Davis

That only works if they intend to use dumpcap from the command line to dump the packet capture to a file which will be analyzed off-line. It doesn't allow the Wireshark GUI to capture interactively - no capture interfaces will be listed.


In fact, I suspect the only way your method would fully work would be to make similar changes to some of the binary files inside the Wireshark.app bundle.

May 15, 2011 6:01 PM in response to Linc Davis

Aha! I see now, you're using the MacPorts (or is it Fink?) version of Wireshark.


Here's an interesting thing...any app launched from /Applications holds only the permissions of the user launching the app, regardless of the owner (presumably because anyone, including "root" can install applications into /Applications). In fact, you could "chown -R root:wheel /Applications/*" and it would make no difference - every app will launch with your permissions only (it's easy to verify, find an app owned by root, launch it and then check in Activity Monitor).


So, anyone who has installed Wireshark from the "native .dmg" by drag-and-dropping won't be able to use the suid trick because the OS will ignore the suid permissions. They'll have to modify the devfs permissions for the bpf devices. The suid method will only work for Macports and Fink installations (assuming that it works for executables in /sw as well as /opt).


Learned something new today! Thanks.

May 15, 2011 6:23 PM in response to g_wolfman

...any app launched from /Applications holds only the permissions of the user launching the app, regardless of the owner (presumably because anyone, including "root" can install applications into /Applications).


It has nothing to do with where the application is installed. Any executable runs with the permissions of the user who runs it. The only exception is a binary executable with the SUID or SGID bit set, and then only if it's on the root device, and only if it's not an Aqua application. The SG/UID bits are ignored otherwise.


So, anyone who has installed Wireshark from the "native .dmg" by drag-and-dropping won't be able to use the suid trick because the OS will ignore the suid permissions.


Sorry, I don't understand this at all. Wireshark invokes dumpcap as a child process to capture packets. If dumpcap is installed anywhere on the root device as SUID root, then it will run as root regardless of who invokes it.


The suid method will only work for Macports and Fink installations...


That's not correct. There are many SUID or SGID executables in a default installation of the Mac OS, and none of them comes from MacPorts or Fink.

May 15, 2011 6:54 PM in response to Linc Davis

Oh, for $&#^$*%...oh course, I knew all of that. But got so caught up in thinking I figured out "the problem" that I forgot what I knew...


$*%&^


Still, doesn't answer why I've never been able to use suid on dumpcap to make Wireshark work. ANd I did try it again earlier before posting in the first place just to be certain - without playing with the bpf devices in the devfs, Wireshark doesn't "see" any interfaces, regardless of the settings on dumpcap. Now maybe it could still spawn a working dumpcap process...but without being able to select an interface in the GUI, that doesn't do much good.


Have to play around with it some more, I guess...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can i get on my iMAC read access to BPF devices in /dev/bpf*

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.