Use Fiddler to grab a bag for Android apps

Source: Internet
Author: User
Tags file transfer protocol

Working principle

First, last picture.

At a glance, we can see where the Fiddler is in the request, and we can determine what it is capable of.

The WinInet ("Windows Internet") API helps programmers use three common Internet protocols,
These three protocols are Hypertext Transfer Protocol (Http:hypertext Transfer Protocol) for the World Wide Web, File Transfer Protocol (Ftp:file Transfer Protocol) and another file transfer protocol called Gopher.
The syntax of the WinInet function is similar to the syntax of commonly used WIN32 API functions, which makes using these protocols as easy as using a file on a local hard disk.

It actually works on the native 8888 port HTTP proxy, and when we start fiddler , it automatically changes the proxy settings: (You can enter inetcpl.cpl in cmd to turn on IE option)


In Chrome:


From then on we can see, as long as the request is HTTP, before the request to leave the machine will go through fiddler, when response back, did not reach the actual requestor, will also go through fiddler: so we can easily implement the content of the modification request and response, So that we can easily debug the current network of the program.

Http://www.cnblogs.com/forcertain/archive/2012/11/29/2795139.html

Open IE option in fiddler:


The difference from other tools

Firebug, IE and Chrome's own developer tools: This is the front-end development of the tool, they listen to browser-initiated requests and responses to the browser, display the request data and response data, the Fiddler basic function is consistent, but it is only listening, only the request and response data records, And fiddler completely took over the request and the response.

Foreword: For mobile application, often need to grasp packet analysis data parameters, Android grab packet conventional thinking solution is through the ADB, Tcpdump generated capture package file, upload to the PC side, and then through the Wirshark to view the data capture packet, but, For Android applications, the client-server interaction is more in the form of rest interface services, based on the HTTP/HTTPS protocol, the disadvantage of using tcpdump method is more obvious:

1, the phone needs root authority

2, the operation process is troublesome, and wirshark to view the large amount of data need to filter

3, the analysis is the dump file, not the operation of the client in real-time interactive data

Therefore, this article introduces the use of Fiddler to carry out the Android capture package, in order to quickly and easily realize the application of mobile phone capture packet analysis

Fiddler Introduction: Fiddler is an HTTP protocol debugging Agent tool that can record and check all HTTP traffic between your computer and the Internet.

Through the Fiddler capture package process: Mobile phone connection Wi-Fi network--Set HTTP proxy--all HTTP access to the phone through fiddler this intermediary--access to the outside Web network

First, the tool download:

Fiddler:http://www.telerik.com/download/fiddler

Second, fiddler set
Open Fiddler, tools-> Fiddler Options.

Switch to the HTTPS panel
Check "decrpt HTTPS traffic" to set fiddler to intercept HTTPS requests

Select the checkbox and the following dialog box appears, click "YES"

Click "Yes" in the pop-up dialog to capture the native HTTPS request.

Switch to Connections panel
Select Allowremote computers to connect. Allows other machines to send HTTP/HTTPS requests to fiddler.

After configuration, you need to restart Fiddler when prompted.

Third, mobile phone set HTTP proxy
1. Enter the phone settings--Wireless network--wlan Select interface
2. Tap and hold a WLAN access point and click "Modify Network"
3. Proxy settings, select Manual, for example, enter the proxy server hostname (fiddler installed machine IP): 192.168.1.10, Port: 8888

Iv. capturing HTTPS requests:
This step is intended to allow Fiddler to capture HTTPS requests. If you only need to intercept an HTTP request, you can ignore this step
1. First know the IP address of the machine where the Fiddler is located: for example, the IP address of the machine with Fiddler installed is: 192.168.1.10
2. Open the browser, Access http://192.168.1.10:8888, click "fiddlerroot Certificate" and install the certificate

V. Normal use of the client or open the Web page with a browser, if there is a HTTP/HTTPS request, you will be able to see the captured data in fiddler

Fiddler use tutorial See: Http://www.cnblogs.com/TankXiao/archive/2012/02/06/2337728.html#qita
Fiddler Mobile Clutch Reference: http://www.cnblogs.com/TankXiao/p/3063871.html

http://blog.csdn.net/hunterno4/article/details/19998273

Http://jingyan.baidu.com/article/2a1383289d7792074b134f69.html
Http://jingyan.baidu.com/article/2f9b480d81df9241ca6cc258.html

Fiddler filtering the specified domain name method one
Switch to the Filters tab in the right-hand window of fiddler, tick the "use Filters" at the top to locate the hosts area and set the following three options:


The first item in 1.Hosts has three sub-options and does not make changes:
"No Zone Filter"
"Show only Intranet Hosts"
"Show only Internet Hosts"

The second item in 2.Hosts only monitors the following URLs, such as monitoring Baidu only, fill in the following input box www.baidu.com
"No Host filter" does not set the hosts filtering
"Hide the following Hosts" hides filtered domain names
"Show only the following Hosts" shows only the domain names that are filtered
"Flag the following Hosts" tag filtered to the domain name

3. Enter the domain name to filter in the text box, use ";" for multiple domain names. Semicolon split. Fiddler default checks the host set in the HTTP header, forcing the domain name in the HTTP address to be displayed.

Fiddler filter The specified domain name method two
Fiddler_request

1. Switch to the Filters tab of the Fiddler right window, tick "use Filters" at the top, and locate the request headers or response headers area as needed
2. Tick "Set request Header" and text box to enter "Host" and "Domain name to filter"

Precautions:
1, fidder host agent Port 8888 is not used by the firewall settings to intercept network access:
2, the mobile phone and the host connected to the same network:
3, Fidder with v.4.6 or above version.

Use Fiddler to grab a bag for Android apps

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.