Using Postern + Charles to capture network

1. Install Postern on your android device and install Charles on your computer

Postern @Github
Charles official website
After charles installed, you can go to https://www.zzzmode.com/mytools/charles/ to activate charles.

2. Set up charles

click “Proxy” on top bar and chose “Proxy settings…”
modify Http proxy and Socks proxy, the default port is “8888” and it may cause port occupied by some other programs like jupyter notebook, change the port of notebook or charles to solve this issue.
在这里插入图片描述

3. Set up Postern

Use charles to check your IP:
click “Help” on top bar and choose “Local IP Address”, it shows like this:
在这里插入图片描述
your IP always starts with “192.168.xx.xx”
Now go to your android device and open Postern, tap the left bar and choose “Proxy”, then tap “Add Proxy”. Input your IP address and server port, set server type to “SOCKS5” to capture more network. (modify Server Name whatever you want, this one is not important), then tap “Save”.
在这里插入图片描述
在这里插入图片描述
Then tap “Rules” on left bar and create a new rule by tapping “Add Rule”, choose “Proxy/Proxy Group” to the proxy you just set up, and save this rule.
在这里插入图片描述

turn on the VPN, usually you can see a key shaped icon(or the word of “VPN”) in your device’s top status bar.
在这里插入图片描述
Now, you should successfully capture the Http network in your android device. But you need more settings to capture Https web traffic.

Click “Proxy” on top bar of charles and choose “SSL Proxy Settings”, below the first function “SSL Prxoy”, add a new rule, we need to capture all the https network, so we need to set it to "Host: * , Port: 443"
在这里插入图片描述

Next step, we need to set up the Certificate on your device.
Click “Help” on top bar of charles and choose “SSL Proxy” --> “Install Charles Root Certificate on a Mobile Device or a Remote Browser”, then a dialog box will show up and tell you how to install it in detail.
在这里插入图片描述
But be ware that, you may have mutiple IP address, the IPv4 IP address you are using always starts with ‘192.168.xx.xx’, so in this case, the real IP you need to set is not ‘172.17.0.1’, you need to check by clicking “Help–>Local IP Address” in charles. The second IP is what we need.
在这里插入图片描述
Now, terminate Postern on your device. Go to system settings, tap “Network & Internet”, find the WIFI which both your computer and phone are using, edit it. Set the proxy method to “Manual”, and also “Proxy hostname: 192.168.28.126, Proxy port: 8888”, save it.
Open one browser, go to url: chls.pro/ssl, it can see the web like this.
在这里插入图片描述
your browser will start downloading the certificate.
After it downloaded, go to phone system settings --> Security & location --> Advanced --> Encryption & credentials --> Install from storage, select the certificate you just downloaded before and install it.
You can find it in “User credentials”, but it’s not enough, we need to make the user credentials to “Trusted credentials”. You can use some other tools to help you achieve this e.g. MT管理器, Magisk中的 Move Certificates模块. Follow the “Charles 手机证书配置” in my previous article https://blog.csdn.net/puppyinasock/article/details/129859887 to finish it.

After the certificate set up, set your wifi proxy to “None” and turn on Postern to start capturing!

4. Enable International network

Sometimes the target app or website needs international network, to enable this, go to charles, click “Proxy” --> “External Proxy Settings”. set Web Proxy Server of HTTP and HTTPS to 127.0.0.1:7890(by your proxy settings) and SOCKS Proxy to “127.0.0.1:7891”,
在这里插入图片描述
that’s it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值