Packet Capture - Brief Summary - Windows and Android Packet Capture
Preface
For the installation of the small and powerful packet capture tool "Fiddler", please refer to my other blog: Packet Capture - Installation and Initial Use of the Classic Packet Capture Tool Fiddler
This article mainly introduces how to use Fiddler to capture Windows and Android packets.
Windows
Capturing Windows packets is very simple, just install the certificate and enable HTTPS. But there are also special cases: some software does not use system agents.
- For example, QQ music client needs to manually set the system proxy to
127.0.0.1:8888
- UWP applications run in a sandbox and do not have permission to access the local network by default. Fiddler's principle is to set up a local intermediary server, which may cause the UWP application to be unable to connect to the Internet when running.
- When using requests in python, you need to make the following settings
response = requests.get( url='https://letmefly.xyz/', proxies = { 'http': 'http://127.0.0.1:8888', 'https': 'http://127.0.0.1:8888' } )
Android without root
Capturing Android packets requires:
Tools -> Options -> Connections
Open in FiddlerAllow remote computers to connect
- If a firewall prompt pops up on your computer, please click Allow Fiddler to pass through the firewall.
- Connect your phone and computer to the same wifi (your phone can also be connected to the computer’s hotspot)
- In the mobile phone
长按连接的wifi -> 修改网络 -> 代理 -> 手动
, the server host name fills in the IP address of the computer in the LAN (you can useipconfig
the command to obtain it), and the port fills in ````8888,
to save```` - Access the mobile phone
127.0.0.1:8888
to download the certificate and click to install.
Under normal circumstances, the computer can capture the HTTPS packet of the mobile phone.
However, starting with Android 7, the system no longer trusts certificates installed by users, and non-root users cannot install system certificates. This causes some apps (such as QQ Music/Douyin) to refuse "unsafe connections", resulting in these apps being unable to connect to the Internet. Installing packet capture software on an Android phone is the same as capturing packets directly in Android. Without root, it seems that only the "magic router" can capture packets on the router.
I have to complain that in QQ Music, the music-related interface will display "Certificate not trusted", but the advertisements are not loading properly. . . .
rooted android
Configure it on your computer openssl
(if you have git on your computer, you can use it directly), ( Tools -> Options -> HTTPS -> Actions -> Export Root Cerificate to Desktop
) to export the Fiddler certificate, use the following command:
openssl x509 -inform DER -in C:\Users\LetMeFly\Desktop\FiddlerRoot.cer -out C:\Users\LetMeFly\Desktop\FiddlerRoot.pem
openssl x509 -inform PEM -subject_hash_old -in C:\Users\LetMeFly\Desktop\FiddlerRoot.pem
At this time, there is a high probability e5c3944b
that the hash value will be calculated.
ren C:\Users\LetMeFly\Desktop\FiddlerRoot.pem e5c3944b.0
Add certificate to rooted phone using ADB/system/etc/security/cacerts
adb devices
adb push C:\Users\LetMe\Desktop\e5c3944b.0 /system/etc/security/cacerts
Note that you may need to change the permissions of the directory to be writable first.
adb shell
cd /system/etc/security/
chmod 777 cacerts
will be modified cacerts
from the original to .drwxr-xr-x
drwxrwxrwx
If the operation fails, you can refer to this blog (this blog doesn’t seem to work either. If you encounter an error, search it yourself XX)
All you need to 设置 -> 安全性与位置信息 -> 加密与凭据 -> 信任的凭据 -> 系统
do is DO_NOT_TRUST_BC
to hit the target and turn it on, and you can happily grab the hot stuff!
summary
QQ Music アイドル's "listening" time is more than 20,000 minutes in a single day. At first, I also wanted to capture the package and make the list, but failed. . . The technology is not enough, so I only captured the package of "single listening time in a single day" (sound power). I also accidentally discovered that for the first time, QQ Music will give you three days of luxury green diamonds when you bind your mobile phone. I spent a few days with basically no results, and I no longer had any interest in ranking. So I summarized it and sealed it away.
It is not easy to create an original article. Please attach a link to the original article after reprinting it with the author's consent ~
Simultaneously publish the article on CSDN: https://letmefly.blog.csdn.net/article/details/132504020