[Go] Android uses fiddler for network data capture

Source: Internet
Author: User

This approach is mainly about how to use fiddler for network data capture on Android and iphone , for example, if we want to capture a network communication request for an app (Weibo, ink weather).

Under MAC, use Charles instead of Fiddler.

The advantages of the Wireshark clutch with respect to tcpdump are:

(1) No need for Root (2) for Android and iphone (3) easy and convenient operation (the first installation configuration, the second time just set the agent can) (4) The view of the packet is more clear and understandable, the Fiddler UI is more simple and clear (5) can view the HTTPS request . If you insist on using tcpdump also visible: Use Tcpdump and Wireshark to crawl network packets.

PS: Requires 1 PCs to assist, and the PC needs to be in the same LAN as the phone or have a separate public network IP

1 , PC-side installation fiddler

: Fiddler.exe, the following is a brief introduction of Fiddler (not interested can skip directly):
Fiddler is one of the powerful and useful Web debugging tools that can record HTTP and HTTPS requests from clients and servers, allow you to monitor, set breakpoints, and even modify input and output data, Fiddler contains a powerful event-based scripting subsystem, And can be extended using the. NET language, which is often used in conjunction with Firebug in web development and tuning.
The operating mechanism of the Fiddler is actually the HTTP proxy that listens on the 8888 port on this machine. For PC-side fiddler startup, the default IE proxy is set to 127.0.0.1:8888, and other browsers need to be set manually, so if you need to listen to the PC-side Chrome network request, its agent to 127.0.0.1:8888 can listen to the data, The mobile terminal can complete the HTTP proxy of the whole system according to the following settings.

2. Configure PC-side fiddler and mobile phone
(1) Configure Fiddler to allow monitoring of HTTPS
Open the Fiddler menu item tools->options, select Decrypt HTTPS traffic and ignore server certificate errors two items, such as:

For the first time, you will be prompted to trust the fiddler certificate and Security reminder, select Yes, and then manage it in the system's certificate management.

(2) Configure Fiddler allow remote Connection
Click Connections in the menu, select Allow remote computers to connect, the default listening port is 8888, if it is occupied can also be set, configured to restart the fiddler, such as:

(3) Configure the phone side
PC-side command line ipconfig view fiddler machine IP, native IP is 10.0.4.37, as

Open your phone to connect to the same LAN WiFi, and modify the WiFi network details (long press WiFi selection, modify network), display advanced options, select Manual proxy settings, host name fill fiddler machine IP, Port fill fiddler port, default 8888, Such as:

At this point, the network access on the phone can be viewed in fiddler, such as micro-Hirokazu network requests:

You can double-click a line of network requests, and the right side will display the specific request contents (requests header) and the returned content (Response header and content), such as:

You can find that fiddler can view the data returned by the network request in various formats, including header, TextView (text), ImageView (picture), Hexview (hex), WebView (Web Form), Auth ( Proxy-authenticate header), Caching (header cache), Cookies, Raw (original data format), JSON (JSON format), XML (XML format) is very convenient.

Stop network Monitoring, remove the proxy settings of WiFi, or fiddler exit after the phone is not on the net.

If you need to restore the phone without password status, the Android side can be set by the system-security-trusted credentials-users, click on the certificate to delete or clear the credentials to remove all user certificates, and then set the password to none.

If you only need to monitor one software, you can turn off other application network access by combining system traffic monitoring.

Reference:

http://www.trinea.cn/android/android-network-sniffer/

https://kb.cnblogs.com/page/130367/

[Go] Android uses fiddler for network data capture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.