iOS APP网络分析之rvictl(可以捕捉除了Wifi以外的网络类型)

OS应用(包括移动应用)的网络分析,一般采用将移动设备上的流量导入到PC机上,利用PC上成熟的数据包分析工具例如wireshark等来进行分析的方法。

总的来说,有以下三种方法:

一、在PC上设置网络共享,生成wifi热点供移动设备使用

二、开启http代理工具服务器(例如burpsuite,charles),然后移动设备通过该HTTP代理上网(只能抓取HTTP/HTTPS)

三、使用管道(tunneling)工具例如nc+ADVsock2pipe将iOS上的流量引入到PC上 (需越狱)

实施方法可参考:

以上方法都存在缺陷,例如只能捕捉wifi网络通信,不能抓取2G/3G网络包的缺陷。

iOS 5后,apple引入了RVI remote virtual interface的特性,它只需要将iOS设备使用USB数据线连接到mac上,然后 使用rvictl工具 以iOS设备的UDID为参数在Mac中建立一个虚拟网络接口rvi,就可以在mac设备上使用tcpdump,wireshark等工具对创建的接口进行抓包分析了。

iOS APP网络分析之rvictl(可以捕捉除了Wifi以外的网络类型) - 碳基体 - 碳基体
 
这种流量分析方法,是直接捕捉的iOS设备上的网络流量,因此无论是wifi还是2G/3G等其他网络类型都可以捕捉到,一根USB数据线就搞定了,不需要苛刻的要求PC与iOS设备处于同一个网段,或必须越狱等局限了。

下面介绍使用方法

第一步:使用USB数据线将iOS设备连接到MAC上

第二步:获得iOS设备的UDID,可以使用iTools查看,也可以使用Xcode的Organizer工具查看

第三步:创建RVI接口
<p style="margin-top: 0px; margin-bottom: 10px; padding-top: 0px; padding-bottom: 0px;"><span class="pln" style="color: rgb(0, 0, 0);">$ rvictl </span><span class="pun" style="color: rgb(102, 102, 0);">-</span><span class="pln" style="color: rgb(0, 0, 0);">s </span><span class="pun" style="color: rgb(102, 102, 0);"><</span><span class="pln" style="color: rgb(0, 0, 0);">UDID</span><span class="pun" style="color: rgb(102, 102, 0);">></span><span class="pln" style="color: rgb(0, 0, 0);"> </span></p>

RVI虚拟接口的命令规则可为rvi0,rvi1,。。。,创建后可以使用以下命令查看是否创建成功
<p style="margin-top: 0px; margin-bottom: 10px; padding-top: 0px; padding-bottom: 0px;"><span class="pln" style="color: rgb(0, 0, 0);">$ ifconfig rvi0</span></p>
第四步:在mac上用抓包工具wireshark或tcpdump等工具抓包分析
<p style="margin-top: 0px; margin-bottom: 10px; padding-top: 0px; padding-bottom: 0px;"><span style="line-height: 22px;"><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">$ sudo tcpdump </span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);">-</span><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">i rvi0 </span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);">-</span><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">n </span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);">-</span><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">vv</span></span></p>
iOS APP网络分析之rvictl(可以捕捉除了Wifi以外的网络类型) - 碳基体 - 碳基体
 
第五步:分析结束后,移除创建的RVI接口
<p style="margin-top: 0px; margin-bottom: 10px; padding-top: 0px; padding-bottom: 0px;"><span style="line-height: 22px;"><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">$ rvictl </span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);">-</span><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">x </span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);"><</span><span class="pln" style="line-height: 28px; color: rgb(0, 0, 0);">UDID</span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0);">></span></span></p>

参考:
http://useyourloaf.com/blog/2012/02/07/remote-packet-capture-for-ios-devices.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值