69

如何在我的网络上从我的 iPhone 嗅探数据包?有人可以给我一些指示吗?我试过谷歌搜索,但没有教如何嗅探 iPhone 数据包、</p>

我在窗户上。

4

10 回答 10

69

更新 (2021-04-01): Paros 不再可以在许多操作系统上轻松安装和运行,因为使用的是非常旧的 Java 版本

然而,现在有OWASP ZAP,它是 Paros 的一个分支,可用于实现相同的目的。

基本步骤是:

  1. 在您的 iOS 设备上安装 ZAP 的根 CA 证书。
  2. 配置 iOS 设备的代理设置以指向您正在运行的 ZAP。
  3. 夺走。

Omer Levi Hevroni有一篇关于 OWASP ZAP with iOS 的博文,其中详细介绍了如何执行这些步骤。


您可以使用Paros嗅探 iPhone 的网络流量。有关更多信息,请参阅此出色的分步帖子:http: //blog.jerodsanto.net/2009/06/sniff-your-iphones-network-traffic/。此外,请查看评论以获取有关使用其他代理完成相同工作的一些建议。

需要注意的是,Paras 仅使用上述方法嗅探 HTTP GET/POST 请求,因此要嗅探所有网络流量,请尝试以下操作:

  1. 只需通过 WiFi 打开网络共享并运行像Cocoa Packet Analyzer(在 OSX 中)这样的数据包嗅探器。
  2. 然后通过 WiFi 从 iPhone 连接到新网络。(系统偏好设置->共享->互联网共享)

如果您在 Windows 上嗅探这些数据包,请使用以太网连接到 Internet,共享您的 Internet 连接,并将 Windows 计算机用作您的访问点。然后,只需正常运行 Wireshark 并拦截流过的数据包,按其起点过滤。或者,尝试使用网络集线器,因为 Wireshark 可以跟踪通过网络的所有数据包,如果它们使用相同的路由器端点地址(如在集线器中)。

于 2009-10-21T02:33:16.913 回答
40

这对我有用:

  1. 通过 USB 连接您的 iOS 设备

  2. $ rvictl -s UDID您的设备的 UDID在哪里UDID(位于 XCode 中的 Devices 下,快捷方式为 with⇧</kbd>⌘</kbd>2)

  3. $ sudo launchctl list com.apple.rpmuxd

  4. $ sudo tcpdump -n -t -i rvi0 -q tcp或者$ sudo tcpdump -i rvi0 -n

如果 victl 不起作用,请安装 Xcode 和开发人员工具。

有关更多信息,请参阅远程虚拟接口,原始教程是使用您的面包博客文章

于 2013-01-11T22:24:52.827 回答
20

我已经使用Fiddler2作为代理成功捕获了 HTTP 流量,它可以安装在您网络上的任何 Windows PC 上。

  1. 在 Fiddler 中,工具 -> Fiddler 选项 -> 连接 -> [x] 允许远程计算机连接。
  2. 确保您的 Windows 防火墙已禁用。
  3. 在 iphone/ipod 上,进入您的无线设置,使用手动代理服务器,输入 fiddler 机器的 IP 地址和相同的端口(默认为 8888)。
于 2011-04-15T21:13:36.077 回答
8

以下适用于 iPhone 4S (iOS 5) 和 Macbook Pro (10.8.2)

  1. 在 Mac 上,前往系统偏好设置 > 共享 > 互联网共享 网络分享

  2. 在您的 iPhone 上,前往“设置”>“Wifi”并选择您的 Mac 作为 Wifi 接入点。按旁边的蓝色详细信息披露并记下 IP 地址(在我的情况下为 192.168.2.2)。此时,Mac 的任务栏上的 wifi 图标应更改为以下内容: 无线上网

  3. 打开wireshark。单击开始捕获,然后使用现在应该在选项中可用的新桥接接口。 鲨鱼

  4. ???

  5. 利润!

与所有与网络相关的东西一样,您可能必须重新启动 wifi 等并重复步骤并调用您最喜欢的神来让这个咒语起作用:)

于 2012-12-14T06:52:15.003 回答
5

I had to do something very similar to find out why my iPhone was bleeding cellular network data, eating 80% of my 500Mb allowance in a couple of days.

Unfortunately I had to packet sniff whilst on 3G/4G and couldn't rely on being on wireless. So if you need an "industrial" solution then this is how you sniff all traffic (not just http) on any network.

Basic recipe:

  1. Install VPN server
  2. Run packet sniffer on VPN server
  3. Connect iPhone to VPN server and perform operations
  4. Download .pcap from VPN server and use your favourite .pcap analyser on it.

Detailed'ish instructions:

  1. Get yourself a linux server, I used Fedora 20 64bit from Digirtal Ocean on a $5/month box
  2. Configure OpenVPN on it. OpenVPN has comprehensive instructions
  3. Ensure you configure the Routing all traffic through the VPN section
  4. Be aware the instructions for (3) are all iptables which has been superseded, at time of writing, by firewall-cmd. This website explains the firewall-cmd to use
  5. Check that you can connect your iPhone to the VPN. I did this by downloading the free OpenVPN software. I then set up a OpenVPN certificate. You can embed your ca, crt & key files by opening up and embedding the --- BEGIN CERTIFACTE --- ---- END CERTIFICATE --- in < ca > < /ca > < crt >< /crt>< key > < /key > blocks. Note that I had to do this in Mac with text editor, when I used notepad.exe on Win it didn't work. I then emailed this to my iphone and picked installed it.
  6. Check the iPhone connects to VPN and routes it's traffic through (google what's my IP should return the VPN server IP when you run it on iPhone)
  7. Now that you can connect go to your linux server & install wireshark (yum install wireshark)
  8. This installs tshark, which is a command line packet sniffer. Run this in the background with screen tshark -i tun0 -x -w capture.pcap -F pcap (assuming vpn device is tun0)
  9. Now when you want to capture traffic simply start the VPN on your machine
  10. When complete switch off the VPN
  11. Download the .pcap file from your server, and run analysis as you normally would. It's been decrypted on the server when it arrives so the traffic is viewable in plain text (obviously https still encrypted)

Note that the above implementation is not security focussed it's simply about getting a detailed packet capture of all of your iPhone's traffic on 3G/4G/Wireless networks

于 2014-10-27T11:11:39.877 回答
4

tcpdump工具在 gnu 下可用。

您可以使用它来代替wireshark.

于 2011-08-19T07:33:20.440 回答
3

我推荐Charles Web 代理

Charles 是一个 HTTP 代理 / HTTP 监视器 / 反向代理,它使开发人员能够查看他们的机器和 Internet 之间的所有 HTTP 和 SSL / HTTPS 流量。这包括请求、响应和 HTTP 标头(其中包含 cookie 和缓存信息)。

  • SSL 代理 – 以纯文本形式查看 SSL 请求和响应
  • 带宽限制以模拟较慢的 Internet 连接,包括延迟
  • AJAX 调试 – 以树或文本的形式查看 XML 和 JSON 请求和响应
  • AMF – 以树的形式查看 Flash Remoting / Flex Remoting 消息的内容
  • 重复请求以测试后端更改,编辑请求以测试不同的输入
  • 拦截和编辑请求或响应的断点
  • 使用 W3C 验证器验证记录的 HTML、CSS 和 RSS/atom 响应

它是跨平台的,用 JAVA 编写的,非常好。不像 Wireshark 那样不堪重负,并且为你做了很多烦人的事情,比如设置代理等。唯一不好的是它要花钱,50美元。不便宜,但有用的工具。

阅读有关 Charles 功能的更多信息。

于 2011-08-11T06:14:17.153 回答
2

我喜欢使用 Pirni(可以在 Cydia 越狱设备上免费使用),或者现在也有 Pirni Pro,只需几美元(http://en.wikipedia.org/wiki/Pirni)。我一直在使用与 Pirni 混合的 Google Code ( http://code.google.com/p/pirni-derv/ ) 上免费提供的 pirni-derv 脚本,它运行良好。我推荐它。

于 2012-05-30T18:54:02.823 回答
2

最简单的方法当然是使用 wifi。您需要确定您的 wifi 底座是充当集线器还是交换机。如果它充当集线器,那么只需将您的 windows pc 连接到它,wireshark 应该能够看到来自 iPhone 的所有流量。如果它是一个交换机,那么您最简单的选择是购买一个便宜的集线器并将您的 wifi 底座的 wan 端连接到集线器,然后将运行wireshark 的 Windows pc 也连接到集线器。届时,wireshark 将能够看到通过集线器的所有流量。

于 2009-10-21T02:50:11.967 回答
0

您可以按照以下步骤进行:

  1. 安装Charles Web 代理
  2. 禁用 SSL 代理(取消选中 Proxy->Proxy Settings...->SSL 中的标志
  3. 将您的 iDevice 连接到 Charles 代理,如此处所述
  4. 通过 Wireshark 或 Charles 嗅探数据包
于 2014-04-08T17:36:48.937 回答