如何配置Wireshark以查看HTTPS流量? [英] How can I configure Wireshark to see HTTPS traffic?
问题描述
我正在测试iOS应用程序,我只想查看何时发送HTTPS流量。我对流量的内容不感兴趣。 如何配置 Wireshark 来执行此操作?
I'm testing an iOS application and I just want to see when HTTPS traffic is sent. I'm not interested in the contents of the traffic. How can I configure Wireshark to do this?
这只是为了验证分析包是否正常工作。我对我的应用正在与之交谈的服务器没有任何控制权。
This is just to verify that an analytics package is working. I don't have any control over the servers that my app is talking to.
谢谢!
编辑#1 :我当前的Wireshark配置可以看到 http://www.duckduckgo.com 但不是 https://www.duckduckgo.com
Edit #1: My current Wireshark configuration can see traffic to http://www.duckduckgo.com but not https://www.duckduckgo.com
推荐答案
另一种方法是使用Mac作为Wi-Fi接入点,并使用TCPDump嗅探流量。以下是步骤:
An alternative is using your Mac as a Wi-Fi access point and sniffing the traffic with TCPDump. Here are the steps:
- 使用以太网电缆将Mac连接到路由器(Wi-Fi卡将作为接入点忙碌工作) )。如果您只想将应用程序中的流量嗅到自己的计算机,请跳过此步骤。
- 在工具栏的Wi-Fi图标中,单击
创建网络
。给它一个随机名称,选择安全性并设置密码。 - 在
系统偏好设置>共享
设置使用以下设备:Wi-Fi
。在Wi-Fi选项...
中选择之前创建的网络。在分享您的连接:
,选择您从中获取Internet的接口,通常是以太网。 - 启用
互联网共享
,然后从iPhone连接到这个新的Wi-Fi网络。 - 断开iPhone上的3G与
设置>一般>网络
并使用Safari检查您的互联网。有时需要几秒钟。 - 在您的Mac类型中
sudo tcpdump -s 0 -A -i en1 port 443> log.txt的
。如果您的网络接口不是en1,请使用ifconfig
。生成的日志也可以由WireShark(这是tcpdump的GUI版本)导入。 - 现在将记录来自iPhone的所有互联网流量。
- Connect your Mac to your router using an Ethernet cable (the Wi-Fi card will be busy working as access point). Or skip this step if you only want to sniff traffic from the app to your own computer.
- In the Wi-Fi icon of your toolbar, click
Create Network
. Give it a random name, select security, and set a password. - In
System Preferences > Sharing
setTo computers using: Wi-Fi
. InWi-Fi Options...
choose the network you created before. InShare your connection from:
, choose the interface you are getting Internet from, usually Ethernet. - Enable
Internet Sharing
, and connect to this new Wi-Fi network from your iPhone. - Disconnect 3G on your iPhone from
Settings > General > Network
and check your Internet with Safari. Sometimes it takes a few seconds. - In your Mac type
sudo tcpdump -s 0 -A -i en1 port 443 > log.txt
. Useifconfig
if you have a network interface other than en1. The log generated can also be imported by WireShark (which is a GUI version of tcpdump). - Now all Internet traffic from your iPhone will be recorded.
TCPDump包含在所有版本的OS X中。有关其他选项,请参阅技术Q& A QA1176获取数据包跟踪。
TCPDump is included with all versions of OS X. For other options, see Technical Q&A QA1176 Getting a Packet Trace.
这篇关于如何配置Wireshark以查看HTTPS流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!