它不像 Wireshark 那样灵活,但 OS X 有一个内置的命令行工具,用于捕获和显示数据包:(
sudo tcpdump -A -s0 -ien0 port 80
-A 标志使其将数据包的内容显示为文本,- s0 使其捕获整个数据包,而不仅仅是标头,-ien0 使其捕获第一个以太网接口(通常,无线接口为 en1),以及端口 80 > 使其仅捕获流量往返端口 80(有关捕获模式的更多选项,请参阅手册页。)
It's not as slick as Wireshark, but OS X has a built-in command line tool for capturing and displaying packets:
sudo tcpdump -A -s0 -ien0 port 80
(the -A flag makes it display the packets' contents as text, -s0 makes it capture entire packets not just the headers, -ien0 makes it capture on the first ethernet interface (generally, the wireless is en1), and port 80 makes it only capture traffic to/from port 80 (see the man page for more options for capture patterns.)
发布评论
评论(3)
Wireshark 或 Lion 内置了一个。可在 /System/Library/CoreServices/Wi-Fi Diagnostics 中找到它。我更喜欢 Wireshark。
Wireshark, or, Lion comes with one built in. Find it at /System/Library/CoreServices/Wi-Fi Diagnostics. I prefer Wireshark.
它不像 Wireshark 那样灵活,但 OS X 有一个内置的命令行工具,用于捕获和显示数据包:(
-A
标志使其将数据包的内容显示为文本,- s0
使其捕获整个数据包,而不仅仅是标头,-ien0
使其捕获第一个以太网接口(通常,无线接口为 en1),以及端口 80
> 使其仅捕获流量往返端口 80(有关捕获模式的更多选项,请参阅手册页。)It's not as slick as Wireshark, but OS X has a built-in command line tool for capturing and displaying packets:
(the
-A
flag makes it display the packets' contents as text,-s0
makes it capture entire packets not just the headers,-ien0
makes it capture on the first ethernet interface (generally, the wireless is en1), andport 80
makes it only capture traffic to/from port 80 (see the man page for more options for capture patterns.)别忘了 Packet Peeper,WireShark 在 Mac 上不太好用。
http://packetpeeper.org/
Don't forget Packet Peeper, WireShark is not so nice on Mac.
http://packetpeeper.org/