macos 如何在 Mac OS 10.7 Lion 上嗅探数据包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9321853/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:53:54  来源:igfitidea点击:

How to sniff packets on Mac OS 10.7 Lion?

macossslhttpspacket-sniffers

提问by Michael Eilers Smith

I'm developing a website that uses SSL (connction to https) and I want to confirm that all the data sent is encrypted. Could anyone give me a good free packet sniffer on Mac OS that I could use?

我正在开发一个使用 SSL(连接到 https)的网站,我想确认发送的所有数据都已加密。任何人都可以在 Mac OS 上给我一个很好的免费数据包嗅探器,我可以使用它吗?

Thanks!

谢谢!

回答by Gordon Davisson

It's not as slick as Wireshark, but OS X has a built-in command line tool for capturing and displaying packets:

它不像 Wireshark 那样圆滑,但 OS X 有一个用于捕获和显示数据包的内置命令行工具:

sudo tcpdump -A -s0 -ien0 port 80

(the -Aflag makes it display the packets' contents as text, -s0makes it capture entire packets not just the headers, -ien0makes it capture on the first ethernet interface (generally, the wireless is en1), and port 80makes it only capture traffic to/from port 80 (see the man page for more options for capture patterns.)

(该-A标志使其将数据包的内容显示为文本,-s0使其捕获整个数据包而不仅仅是标头,-ien0使其在第一个以太网接口(通常,无线是 en1)上port 80捕获,并使其仅捕获进出端口的流量80(有关捕获模式的更多选项,请参见手册页。)

回答by AbiusX

Don't forget Packet Peeper, WireShark is not so nice on Mac.

不要忘记 Packet Peeper,WireShark 在 Mac 上不是很好。

http://packetpeeper.org/

http://packetpeeper.org/

回答by Marty

Wireshark, or, Lion comes with one built in. Find it at /System/Library/CoreServices/Wi-Fi Diagnostics. I prefer Wireshark.

Wireshark 或 Lion 内置了一个。在 /System/Library/CoreServices/Wi-Fi Diagnostics 中找到它。我更喜欢 Wireshark。