Fiddler implements HTTP network packet capture

Insert image description here

Preface

Earlier we briefly learned about the application layer - custom protocols, but these are just custom protocols. In real life, custom protocols are still used in a minority. The more commonly used protocol in the application layer is the HTTP protocol. , before learning these two protocols, we need to use a tool - Fiddler to implement HTTP packet capture to view their request and response messages.

What is Fiddler

Fiddler is an HTTP protocol debugging proxy tool. It can record and inspect all HTTP communications between computers and the Internet, set breakpoints, and view all data "in and out" of Fiddler (referring to cookies, html, js, css and other files).

If it is just communication between the client and the server, it is actually difficult for us to see the client's request data packet and the server's response data packet. What our client gets is only the request data packet and the response data packet after processing. Since To learn the HTTP protocol, we must first learn its message format. To learn its message format, we need to get its message format. To obtain the HTTP request and response messages, we need to use packet capture tools. Capture HTTP packets.

Fiddler is specifically responsible for capturing HTTP packets. Although other tools can also capture HTTP packets, because Fiddler is specifically designed to capture HTTP packets, compared with other software, we still use it to capture HTTP packets. Fiddler.

Insert image description here

Download Fiddler

1. Download Fiddler Classic from the official website

Enter Fiddler official websitehttps://www.telerik.com/fiddler

Insert image description here

Although Fillder Everywhere has more functions, it requires paying a certain fee, so we choose the free version of Fiddler Classic. Find Fiddler Classic below and click Try For Free

Insert image description here

Simply fill in the information and download

Insert image description here

2. Install Fiddler Classic

After downloading the installation package of Fiddler Classic, you can install it. The installation process is very simple.

Insert image description here
Insert image description here

3. Open Fiddler Classic

After opening Fiddler, a prompt like this may appear. Just click NO.

Insert image description here
After opening, this interface appears:

Insert image description here
However, the packet capture data you appear may not be that much and all captured are HTTP packets, but not HTTPS packets. If you want to capture HTTPS packets, you need to make relevant configurations. Click Tools, Options

Insert image description here
Select HTTPS and check all options that appear.

Insert image description here
A prompt may pop up during the checking process. What pops up here is the security certificate. We choose YES. Remember, you must choose YES here, otherwise you need to Uninstalled and reinstalled.

Insert image description here

Shown on the left are the HTTP packets and HTTPS packets captured by our Fiddler

Insert image description here
When we visit www.baidu.com, a lot of data packets will be captured on the left. We don’t need to worry about so many, we just need to look at this blue one.

Insert image description here

After double-clicking the captured HTTP packet, the request packet and response packet of the HTTP packet will be displayed on the right.

Insert image description here

It can be opened in Notepad by clicking on the Row of the request packet and View In Notepad.

Insert image description here

Insert image description here

Looking at the response part below, we can find that the response packet contains garbled characters, so why do garbled characters appear here? Because when the server returns a response, it will compress the data to save network bandwidth. If each response packet is not compressed, it will cause a waste of network bandwidth, so we need to compress the compressed data packet. unzip.Insert image description here

Insert image description here
After decompressing, click Row to view the detailed data format.

Insert image description here

Click on the left part and use CTRL + a and delete to delete the captured data packets.

Insert image description here

Guess you like

Origin blog.csdn.net/m0_73888323/article/details/134112355