{"id":395,"date":"2011-03-23T20:02:49","date_gmt":"2011-03-24T02:02:49","guid":{"rendered":"http:\/\/www.cavanaugh.pro\/sean\/?p=395"},"modified":"2011-03-23T20:09:27","modified_gmt":"2011-03-24T02:09:27","slug":"setting-up-wireshark-on-mac-osx","status":"publish","type":"post","link":"https:\/\/www.cavanaugh.pro\/sean\/setting-up-wireshark-on-mac-osx\/","title":{"rendered":"Setting up Wireshark on Mac OSX"},"content":{"rendered":"<p>Here is the complete guide, because so many &#8216;complete guides&#8217; were missing a step or two that I needed.<\/p>\n<p>1)\u00a0Download the DMG from\u00a0<a href=\"http:\/\/www.wireshark.org\/download.html\">http:\/\/www.wireshark.org\/download.html<\/a>. Unpack it.<\/p>\n<p>2)\u00a0Drag the Wireshark icon onto to the\u00a0<em>Applications<\/em> alias.<\/p>\n<p>3)\u00a0Open the\u00a0<em>Utilities<\/em> folder.<\/p>\n<p>4)\u00a0Drag the contents of the <em>Command Line<\/em> folder to <em>\/usr\/local\/bin<\/em><\/p>\n<p>5) \u00a0Drag the <em>ChmodBPF<\/em> folder onto the <em>StartupItems<\/em> alias.<\/p>\n<p>Path is\u00a0\/Library\/StartupItems\/ChmodBPF if the alias does not work<br \/>\n(you can use finder, click go, click &#8220;Go To Folder&#8221;)<\/p>\n<p>(this files changes\u00a0the permissions of \/dev\/bpf* in order to capture from interfaces, by dragging it here it does this every time\u00a0you reboot)<\/p>\n<p>6) If you&#8217;re running as an admin user you will see a list of network interfaces in Wireshark in the &#8220;Interface List&#8221;. That&#8217;s good and you&#8217;re ready to start capturing packets.<br \/>\nHowever, if you don&#8217;t see any available interfaces, you&#8217;re probably running as a non-admin. If you plan on running as a non-admin when you use Wireshark in the future, you need to make one more change. The problem here is that the<code>ChmodBPF<\/code> start-up item we installed earlier (that changes permissions on<code>\/dev\/bpf*<\/code>) only works for users in the\u00a0<code>admin<\/code> group. So, we need a way of allowing the user you&#8217;re running as to at least read stuff in\u00a0<code>\/dev\/bpf*<\/code>.A simple solution, and you can do this to check and see if you can capture with this change is to simply do\u00a0<code>sudo chmod o+r \/dev\/bpf*<\/code>. That works, but it allows<em>any user<\/em> on your machine to sniff packets. A better solution is to just add a line to the\u00a0<code>ChmodBPF<\/code> script to\u00a0<code>chown<\/code> (change the owner of) those things to the user you want to run as:<\/p>\n<ol>\n<li>Open the\u00a0<code>ChmodBPF<\/code> script, which is located in<code>\/Library\/StartupItems\/ChmodBPF\/ChmodBPF<\/code>, in a text editor.<\/li>\n<li>Add a\u00a0<code>chown<\/code> line so that the file looks like this:<\/li>\n<pre><code> ...\r\n         chgrp admin \/dev\/bpf*\r\n         chmod g+rw \/dev\/bpf*\r\n         chown foobar:admin \/dev\/bpf*\r\n }\r\n ...\r\n<\/code><\/pre>\n<li>But replace\u00a0<code>foobar<\/code> here with the user you want to run Wireshark under.<\/li>\n<li>Save the file.<\/li>\n<\/li>\n<\/ol>\n<p>7) If you&#8217;re doing a fresh Wireshark install on Snow Leopard (Mac OS X 10.6), it appears that the ownership of the\u00a0<code>ChmodBPF<\/code> files needs to be changed. So, fire up the terminal and do the following:<\/p>\n<pre><code>cd \/Library\/StartupItems\r\nsudo chown -R root:wheel ChmodBPF<\/code><\/pre>\n<p>8.) Now double check the security settings in your startup error, you may have get an error like this if you forgot to do so<br \/>\n<code><br \/>\n\"Insecure Startup Items folder detected.<br \/>\nItems in the Startup Items folder (\"\/Library\/<br \/>\nStartupItems\/\") have not been started because the<br \/>\nfolder does not have the proper security settings.\"<br \/>\n<\/code><\/p>\n<p>so open up a terminal, go to <code>\/Library\/StartupItems\/<\/code><br \/>\ndo a <code>ls -l<\/code> and make sure then everything is set to the same permission 755 which will look like<\/p>\n<p><code>drwxr-xr-x<\/code><\/p>\n<p>you can always change the permissions of everything in the folder by doing this<br \/>\n<code><br \/>\nsudo chown -R root:wheel \/Library\/StartupItems<br \/>\nsudo chmod -R 0755 \/Library\/StartupItems<br \/>\n<\/code><\/p>\n<p>if you see an @ symbol you need to do a <code>ls -l@<\/code> and look for <code>com.apple.quarantine<\/code>, this means that OS X has quarantined this file because it has not given permission to run it yet (untrusted).  Just like when you download a new app from the internet for the first time OS X will ask you with a prompt &#8220;blah is an application downloaded from ther Internet.  Are you sure you want to open it?&#8221; you will need to do this here, only via the command line.<br \/>\nRemote the quarantine with this command<br \/>\n<code>xattr -r -d com.apple.quarantine file-path<\/code><br \/>\nso in our case<br \/>\n<code>xattr -r -d com.apple.quarantine \/Library\/StartupItems\/ChmodBPF<\/code><\/p>\n<p>9) Restart your computer, make sure there are no errors, run Wireshark and make sure you can see interfaces to capture from.  Email me or comment below to fix any problems with this how to.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is the complete guide, because so many &#8216;complete guides&#8217; were missing a step or two that I needed. 1)\u00a0Download the DMG from\u00a0http:\/\/www.wireshark.org\/download.html. Unpack it. 2)\u00a0Drag the Wireshark icon onto to the\u00a0Applications alias. 3)\u00a0Open the\u00a0Utilities folder. 4)\u00a0Drag the contents of the Command Line folder to \/usr\/local\/bin 5) \u00a0Drag the ChmodBPF folder onto the StartupItems alias. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.cavanaugh.pro\/sean\/setting-up-wireshark-on-mac-osx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Setting up Wireshark on Mac OSX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-395","post","type-post","status-publish","format-standard","hentry","category-geek"],"_links":{"self":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/comments?post=395"}],"version-history":[{"count":8,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/395\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/395\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/media?parent=395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/categories?post=395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/tags?post=395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}