1. Introduction
Hello, I’m Anguo!
Before compiling crawler, we need to capture the target application, and then analyze a wave before entering the script writing stage
For iPhone users, daily bag grabbing is not easy. PC tools, such as Charles and Fiddler, are perfectly capable. “Stream” is a very powerful network packet capture application on iOS, with a simple interface and very powerful functions
But for the Android high version of the system for small partners, the capture is not so convenient! Because the security policy of a later version system is improved, the CA certificate must be placed in the system certificate directory to capture packets. However, the certificate installed by users is the user certificate by default. As a result, many apps cannot capture packets
This article describes how to capture packets in advanced Versions of Android using common scenarios
2. Non-root devices
Android also has a powerful network capture tool called HttpCanary, a small yellow bird.
The specific operation steps are as follows:
2-1 Export the HttpCanary root certificate
After installing the Little Yellow Bird App, go to the Settings page and export the HttpCanary root certificate
Select System Trusted(.0).
In this way, the HttpCanary root certificate is saved to the internal storage path /HttpCanary/cert/…0
2-2 Install APKPure and VMOS Pro applications
VMOS PRO download: apkpure.com/cn/vmos-pro…
PS: Since the VMOS PRO application format is XAPK, it is recommended to install the XAPK application using APKPure
2-3 VMOS imports the RE application, target application, and HttpCanary root certificate
Open the VMOS Pro application and import the Root Explorer application, target application, and HttpCanary Root certificate file
In this way, the VMOS contains the target application, the RE file management application, and the HttpCanary root certificate file is saved to “VMOSfiletransferstatio/” by default
2-4 Import the certificate to the system certificate directory
In VMOS Pro, use the RE application to move the HttpCanary root certificate file to the system certificate directory
System certificate directory: / system/etc/security/cacerts
2-5 Start packet capture
Open the Little Yellow Bird App, set it to “VMSO” in setting the target application, then turn on the packet capture switch in the main interface, and finally operate the target application in VMOS
Network requests from targeted applications are now displayed in the yellow Bird home screen
The HttpCanary application is recommended to use “parallel space” for packet capture. However, it is not recommended to use the “parallel space” for packet capture
3. Root device
If the phone has completed Root, we only need to move the third-party certificate (such as: little yellow bird, Charles, etc.) to the system certificate directory
This is explained through the Little Yellow Bird App and Charles, similar to Fiddler
3-1 Little Yellow Bird App packet capture
The operation steps are as follows:
-
Unlock the phone and Root it
-
Install the little Yellow Bird HttpCanary application and export the HttpCanary root certificate in the same format as above
-
Copy the CA certificate to the PC over the data cable
-
Download ADB on PC and configure environment variables
-
PUSH the certificate to the system certificate directory using the following series of ADB commands
-
Open the Little Yellow Bird app and set the target app
-
Click the packet capture button on the main interface of little Yellow Bird to capture packets for the target application
Adb root # disable system validation adb disable-verity # restart the phone adb reboot # grant adb root permission adb root # Before the folder, Must enter the command "adb remount 'adb remount # copy certificate to/system/etc/security/cacerts / # below adb push 87 bc3517. 0 / system/etc/security/cacerts reroot # # / restart the adb to see whether they contain CA certificate of import adb root adb shell CD/system/etc/security/cacerts/lsCopy the code
3-2, Charles caught
The operation steps are as follows:
-
Charles downloads a certificate (such as a CER certificate) from help and copies it to the phone over the cable
-
Find the certificate in file Management and install it manually
It is installed into the user certificate by default
The installation directory: / data/misc/user / 0 / cacerts – added
-
Use the following ADB command to enable read and write permissions on the phone’s system directory
-
Install the RE file management application and grant Root permission to move the above certificates from the user certificate directory to the system certificate directory
The certificate system directory: / system/etc/security/cacerts
-
Restart the phone
-
Caught testing
Check the IP address of the PC, keep the mobile phone in the same LAN, and then set it to manual proxy, and finally capture packets for testing
Adb reboot # run adb root # remount ADB remountCopy the code
4. The last
The packet capture process in various scenarios of advanced Android systems is described in the above section based on whether the mobile phone is Root
In addition to the above way to capture packets, there are many options. For Root device, we can install Magisk mask, and then cooperate with movecert module to capture packets. Or we can also capture the package through the EdXposed framework + Trustmealredy module, in actual work, we can choose their own way according to the needs
If you think the article is good, please like, share, leave a message, because this will be my continuous output of more high-quality articles the strongest power!
Recommended reading
Learn how to batch convert HEIC files using Python
Learn how to quickly acquire related stocks in Python to help you invest in value!
Python ipo, I suggest you do this!
Complete process | carefree fish what good sell? I figured it out for you!