设为首页 收藏本站
查看: 917|回复: 0

[经验分享] Wireshark在Mac OS X 上使用

[复制链接]

尚未签到

发表于 2015-12-30 08:25:29 | 显示全部楼层 |阅读模式
by Schiffahr.Chen
  如果不是由于工作需要在Mac OS X下测试公司的产品,我可能不会去接触 Mac OS X下的消息测试。
  在 Windows平台下有很多消息测试的工具,其中个人觉得比较好用的是 HTTP Analyzer(指对应于OSI中表示层的协议HTTP而言)。刚开始在Mac OS X寻找消息测试的工具,发现有Cocoa Packet Analyzer、Wireshark等。 由于Wireshark在windows下有对应的版本,所以我采用了Wireshark。 到Wireshark下载页面下载对应的版本,我所使用的测试环境是minimac,Mac OS X 10.5.7,Intel处理器。
  安装后使用,发现没有可用的网卡。查找原因: Wireshark Mac no interfaces。解决此问题的途径是赋予需要访问的设备权限,这样才能捕获消息,进行截包。
$ sudo chown {your account name} /dev/bpf*
在每次重新启动机器都要执行以上操作,当然也可以加到自动启动项里面。关于更详细的说明,请看本文后面附的文章二的内容。本文的附件就是文章提到的tarfile.gz。
在使用Wireshark进行截消息,为了更好的捕捉需要的消息,需要进行消息过滤,设置捕捉过滤器。比如我在测试过程中需要捕捉的是服务器(192.168.111.2)发送给我的http消息,我设置了消息过滤器:ip src host 192.168.111.2,这样在Wireshark上显示的是tcp和http的消息,看起来就简单多了。
  查看TCPdump的主页以获得更详细的捕捉过滤器语法说明。在Wiki Wireshark website上可以找到更多捕捉过滤器的例子。
  参考来源:
1.http://muffinresearch.co.uk/archives/2008/06/02/no-interfaces-available-using-wireshark-on-mac-osx/
2.http://www.wireshark.org/lists/wireshark-users/200608/msg00014.html
3.wireshark的安装和使用
4.http://wiki.wireshark.org/CaptureFilters
5.http://www.ethereal.com/docs/man-pages/tcpdump.8.html
6.http://www.mac-forums.com/forums/airport-networking-wireless-technology/151665-wireshark-error-no-interfaces-mac-os-x-10-5-a.html
7.mac os x上装wireshark注意事项
  引用两篇相关问题的文章:
======================================
文章一:
http://muffinresearch.co.uk/archives/2008/06/02/no-interfaces-available-using-wireshark-on-mac-osx/
No Interfaces Available Using Wireshark on Mac OSX
Posted inCode,Linux/Unixon 2nd June 2008, 8:10 am by Stuart
  On my previous Macbook Pro I’d used Ethereal and I don’t remember having many issues with it as I was able to run it as sudo so that I had privileges for sniffing packets. Since then Ethereal has becomeWiresharkand it’s now available with a nice appication wrapper as a launcher for running it under X11
  After opening wireshark for the first time I had an issue that there were no interfaces to choose from due to lack of permissions.This link provides a neat solution to the problem by providing a start-up item to set the relevant permissions correctly.
  The nub of the solution is to make sure you have permission to read/dev/bpf*
============================================
文章二:
http://www.wireshark.org/lists/wireshark-users/200608/msg00014.html
Wireshark-users: Re: [Wireshark-users] [Ethereal-users] No interfaces showing on ethereal 0.99 on Mac OS X
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 04 Aug 2006 12:13:00 -0700

  Warren Hall wrote:
  -------------------
The Ethereal project is being continued at a new site.  Please go to
http://www.wireshark.organd subscribe to wireshark-users@xxxxxxxxxxxxxx
Don't forget to unsubscribe from this list at
http://www.ethereal.com/mailman/listinfo/ethereal-users
  ...so I'm redirecting this to wireshark-users (to which replies will go).

  I have compiled and installed ethereal 0.99 on my intel based Mac underOS X. The GUI launches and everything seems in order but I have no listof interfaces from which to capture from.My hardware is a MacBook Pro with built-in Gigabit ethernet and 802.11gadaptors.I am pretty sure my build went OK. Just wondering if I missed somethingin the ethereal configuration?
  No, you missed something in your BSD configuration. :-)

On BSD-flavored systems, such as OS X, libpcap opens a BPF device to doa capture. You'd need to make the BPF devices on your system readableby you in order to capture (you could also run Wireshark as root, butthat's overkill, and runs a rather large chunk of code as root).
  You could do
sudo chown {your account name} /dev/bpf*

to do that, but that would have to be done after every reboot. To dothat automatically, you could install the ChmodBPF startup item fromrecent versions of libpcap on your system in /Library/StartupItems andedit the commands in the StartService() shell function inChmodBPF/ChmodBPF to do the appropriate chown and possibly chmod commands.
  I've attached a gzipped tarfile with that startup item.
  Attachment:tarfile.gz
Description:GNU Zip compressed data

  • Prev by Date:[Wireshark-users] Dissector for decoding WiMax MAC protocol
  • Next by Date:Re: [Wireshark-users] Dissector for decoding WiMax MAC protocol
  • Previous by thread:Re: [Wireshark-users] Dissector for decoding WiMax MAC protocol
  • Next by thread:Re: [Wireshark-users] SS7 over IP
  • Index(es):

    • Date
    • Thread


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-158159-1-1.html 上篇帖子: Mac OS曝234个高危漏洞 下篇帖子: 在Mac OS X 10.9上安装 Thrift 0.9.1
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表