Nanny-Level Tutorials of "Blast Liver Tidying" - Playing with Charles's Bag Grabbing Artifact Tutorial (1) - Getting to know Charles for the first time

1 Introduction

This tool, Brother Hong, still explains and shares according to Fiddler's ideas, so that it is convenient for friends or children's shoes to understand and accept. Today's main task is to explain and share some basic theoretical knowledge of Charles.

2. Introduction to Charles

Charles is not only one of the commonly used network packet capture and interception tools on the PC side (Windows, Mac and Linux systems), but also one of the commonly used network packet capture and interception tools on the mobile terminal (Android and 1os systems). When doing development and testing, we often need to intercept network capture packets for analysis in order to debug the network communication protocol between the client and server.

Charles and Fiddler have a similar principle. By setting themselves as the system's network access proxy server, all network access requests are completed through it, thereby realizing the interception and analysis of network capture packets.
In addition to debugging ports during development and testing, Charles can also be used to analyze communication protocols of third-party applications. With the SSL function of Charles, Charles can also analyze the Https protocol.

Charles is paid software, you can try it for free for 30 days. After the trial period, users who have not paid can still continue to use, but each use time cannot exceed 30 minutes, and there will be a 10-second delay when starting. Therefore, this payment plan is quite friendly to the majority of users. Even if you do not pay for a long time, you can still use the complete software functions. It's just that when you need to perform packet debugging for a long time, you will be affected by the forced shutdown of Charles.

If you want to learn interface automation testing, here I recommend a set of videos for you. This video can be said to be the number one interface automation testing tutorial on the entire network at station B. At the same time, the number of online users has reached 1,000, and there are notes to collect and use. Technical exchanges of various masters: 798478386    

[Updated] The most detailed collection of practical tutorials for automated testing of Python interfaces taught by station B (the latest version of actual combat)_哔哩哔哩_bilibili [Updated] The most detailed collection of practical tutorials for automated testing of Python interfaces taught by station B (actual combat) The latest version) has a total of 200 videos, including: 1. [Interface Automation] The current market situation of software testing and the ability standards of testers. , 2. [Interface Automation] Fully skilled in the Requests library and the underlying method call logic, 3. [Interface Automation] interface automation combat and the application of regular expressions and JsonPath extractors, etc. For more exciting videos, please pay attention to the UP account. https://www.bilibili.com/video/BV17p4y1B77x/?spm_id_from=333.337&vd_source=488d25e59e6c5b111f7a1a1a16ecbe9a

3. The main functions of Charles

The main functions of Charles include:

1. Grab the requests and responses of Http and Https, packet capture is the most commonly used.

2. Resending the network request is convenient for backend debugging. It is very cool to resend a piece in complex and special circumstances (the captured record can be directly repeated, and it can be modified if you want to modify it).

3. Modify the network request parameters (when the client sends to the server, it can be modified and then forwarded).

4. Interception and dynamic modification of network requests.

5. Supports simulating slow network, mainly to imitate the 2G/3G/4G access process on mobile phones.

6. Support local mapping and remote mapping. For example, you can map online resources to a local folder, so that you can deal with bugs and online debugging in some special cases (css, js and other resources on the network) It is local code, which you can modify locally, and the data and the like are all in the online environment, so it can be debugged online);

7. You can grasp the resources accessed by the mobile phone (if it is an environment with HOST configured, the mobile phone can use the host configuration to enter the test environment)

4. Operating systems supported by Charles

Operating systems supported by charles include:

Windows 64 bit(msi Windows 32 bit(msi)

macOS(dmg)

Linux 64 bit(tar.gz) Linux 32 bit(tar.gz)

Open the browser to visit the official website of Charles, download the Charles installation package of the corresponding system, and then install it:

Windows: Run the installer application to install Charles in the Programs menu.

Mac OSX: Unzip the download file by double-clicking, then copy the Charles application into the Applications directory.

Linux: Charles has both APT and YUM repositories, and if you have a Debian-based or Red Hat-based Linux distribution, this is the preferred method of installing Charles. Otherwise, extract the tar:gz file to the appropriate site. If you have previously installed Charles and are upgrading; first make sure Charles is not running, then install or copy over the previous installation. Start Charles by running the bin/charles script.

5. Why study Charles?

1. Compared with fiddler, the biggest advantage of charles is cross-platform. Can support Windows, MacOs, ios, Android.

Charles is a commonly used network packet capture tool. After starting Charles, it will automatically open the browser proxy to intercept network requests. The basic functions of Charles and Fiddler are similar, except that Fiddler is free, but since Fiddler is developed in the c# language, there is no The MAC version will later launch a Fiddler Everywhere: a web debugging proxy tool that can run on any browser, any system, and cross-platform (Windows, Mac, Linux). It records all HTTP(S) communications between computers and the Internet, can inspect and edit communications, and has the ability to mock requests and modify responses returned. But I don’t know if it’s good to use Hong Ge. Charles is a paid software, but the functions can still be used, but there is a time limit. If we break it, there will be no such restriction.

2. In the actual development and testing process, it is necessary to quickly locate the problem by intercepting the network request message through the proxy. At present, most projects use https. Fiddler is not as easy to use as charles in this respect. In the actual development and testing process, it is necessary to intercept the network request message through the proxy to quickly locate the problem. At present, more projects use https, and Fiddler is not as easy to use as Charles in this regard.

3. Support viewing messages by domain name and interface, concise and clear

4. Support reverse proxy

5. Network speed limit, network type can be selected

6. Can parse the AMF protocol

6. Download and install Charles

6.1 Download Charles

Official website download: https: / / www.charlesproxy.com/ The specific steps are as follows:

1. After visiting the official website download address, as shown in the figure below:
 

picture

2. Click "DOWNLOAD" in the upper right corner, as shown in the figure below:

picture


3. Click "DOWNLOAD" in the upper right corner to enter the download page, as shown in the figure below: 

picture

 4. Select your corresponding operating system (Hongge downloaded Windows operating system here), and then click the installation package of the corresponding operating system to start downloading (here, the latest version of Charles is downloaded by default), as shown in the figure below:

picture

 5. After the download is complete, we will start installing Charles.

6.2 Install Charles

After downloading the installation package, we start to install Charles. The specific operation steps are as follows:
1. Double-click the installation package we downloaded, as shown in the figure below:

 2. After double-clicking, the running interface will pop up, as shown in the figure below:

picture

3. Click "Run" to start downloading and installing components, as shown in the figure below: 

4. After the installation component is downloaded, enter the interface as shown in the figure below:

 5. Click "Next", check to agree to the agreement, click to continue and click "Next", as shown in the figure below:

 6. Select the installation location and click "Next", as shown in the following figure:

 7. Click "Install", as shown below:

picture

 8. After a while, click "Finish" to complete the installation of Charles. As shown below:

 

 6.3 Cracking Charles

Because Charles is not free, you can try it for free for 30 days, but after 30 days, we need to pay, so Brother Hong will crack it in advance to solve this problem. The specific operation steps are as follows:

1. Visit the online cracking tool to generate an activation code online, address: https://www.zzzmode.com/mytools/charles/, as shown in the figure below:

2. RegisterName can be a registered name at will, as shown in the figure below:

 

 3. After clicking "Generate", the registration code will be generated and calculated, as shown in the figure below:

4. Start and open Charles, click Help->Registered Charles, and enter the registered user name and registration code in the pop-up registration interface, as shown in the following figure:

 At this point, the download, installation and activation of Charles is complete!

7.Charles capture principle

Both Charles' packet capture principle and Fiddler's packet capture principle are implemented by using the man-in-the-middle attack vulnerability of http.

7.1 General principle

As a middleman agent, when the client sends a message to the server, Charles will intercept the request sent by the client to the server, and then pretend to be the client to communicate with the server; when the server returns data, it will send the intercepted data to the client. Pretend to be a server to communicate with a client.

 

 8. Summary

This article introduces the installation and use of Charles, mainly to briefly discuss its packet capture principle; Charles' download, installation, activation and other related content.

Guess you like

Origin blog.csdn.net/m0_73409141/article/details/131790502