How can I capture mobile phone traffic on Wireshark?
问题:
回答1:
Here are some suggestions:
For Android phones, any network: Root your phone, then install tcpdump on it. This app is a tcpdump wrapper that will install tcpdump and enable you to start captures using a GUI. Tip: You will need to make sure you supply the right interface name for the capture and this varies from one device to another, eg -i eth0 or -i tiwlan0 - or use -i any to log all interfaces
For Android 4.0+ phones: Android PCAP from Kismet uses the USB OTG interface to support packet capture without requiring root. I haven\'t tried this app, and there are some restrictions on the type of devices supported (see their page)
For Android phones: tPacketCapture uses the Android VPN service to intercept packets and capture them. I have used this app successfully, but it also seems to affect the performance with large traffic volumes (eg video streaming)
For IOS 5+ devices, any network: iOS 5 added a remote virtual interface (RVI) facility that lets you use Mac OS X packet trace programs to capture traces from an iOS device. See here for more details
For all phones, wi-fi only: Set up your PC as a wireless access point, then run wireshark on the PC
For all phones, wi-fi only: Get a capture device that can sniff wi-fi. This has the advantage of giving you 802.11x headers as well, but you may miss some of the packets
Capture using a VPN server: Its fairly easy to set-up your own VPN server using OpenVPN. You can then route your traffic through your server by setting up the mobile device as a VPN client and capture the traffic on the server end.
回答2:
In addition to rupello\'s excellent answer, a \"dirty\" but very effective trick:
For all phones, any (local) network: Set up your PC to Man-In-The-Middle your mobile device.
Use Ettercap to do ARP spoofing between your mobile device and your router, and all your mobile\'s traffic will appear in Wireshark. See this tutorial for set-up details
回答3:
Another option which has not been suggested here is to run the app you want to monitor in the Android emulator from the Android SDK. You can then easily capture the traffic with wireshark on the same machine.
This was the easiest option for me.
回答4:
Wireshark + OSX + iOS:
Great overview so far, but if you want specifics for Wireshark + OSX + iOS:
- install Wireshark on your computer
- connect iOS device to computer via USB cable
- connect iOS device and computer to the same WiFi network
- run this command in a OSX terminal window:
rvictl -s x
wherex
is the UDID of your iOS device. You can find the UDID of your iOS device via iTunes (make sure you are using the UDID and not the serial number). - goto Wireshark
Capture->Options
, a dialog box appears, click on the linervi0
then press theStart
button.
Now you will see all network traffic on the iOS device. It can be pretty overwhelming. A couple of pointers:
- don\'t use iOS with a VPN, you don\'t be able to make sense of the encrypted traffic
- use simple filters to focus on interesting traffic
ip.addr==204.144.14.134
views traffic with a source or destination address of 204.144.14.134http
views only http traffic
Here\'s a sample window depicting TCP traffic for for pdf download from 204.144.14.134:
回答5:
For Android phone I used tPacketCapture: https://play.google.com/store/apps/details?id=jp.co.taosoftware.android.packetcapture&hl=en
This app was a lifesaver I was debugging a problem with failure of SSL/TLS handshake on my Android app. Tried to setup ad hoc networking so I could use wireshark on my laptop. It did not work for me. This app quickly allowed me to capture network traffic, share it on my Google Drive so I could download on my laptop where I could examine it with Wireshark! Awesome and no root required!
回答6:
Packet Capture Android app implements a VPN that logs all network traffic on the Android device. You don\'t need to setup any VPN/proxy server on your PC. Does not needs root. Supports SSL decryption which tPacketCapture does not. It also includes a good log viewer.
回答7:
Install Fiddler on your PC and use it as a proxy on your Android device.
Source: http://www.cantoni.org/2013/11/06/capture-android-web-traffic-fiddler
回答8:
Similarly to making your PC a wireless access point, but can be much easier, is using reverse tethering. If you happen to have an HTC phone they have a nice reverse-tethering option called \"Internet pass-through\", under the network/mobile network sharing settings. It routes all your traffic through your PC and you can just run Wireshark there.
回答9:
Make your laptop a wifi hotspot for your phone (any) and connect it to internet. Sniff Traffic on your wifi interface using wireshark.
you will get to know a lot of anti privacy stuff!
回答10:
For Android, I previously used tPacketCapture but it didn\'t work well for an app streaming some video. I\'m now using Shark. You need to be root to use it though.
It uses TCPDump (check the arguments you can pass) and creates a pcap file that can be read by Wireshark. The default arguments are usually good enough for me.