Android >=7 Burpsuite 抓包

操作

在Burp中导出证书,这里的名字为burp.der.

然后在命令行中进行如下操作:

1
2
3
4
5
6
7
openssl x509 -inform DER -in burp.der -out burp.pem #转换格式
openssl x509 -inform PEM -subject_hash_old -in burp.pem | head -1 #打印hash,并将pem命名为hash.0
> 9a5ba575
cp burp.pem 9a5ba575.0
adb remount #重新mount
adb push 9a5ba575.0 /system/etc/security/cacerts/ #传上去
adb reboot #搞定

前提

  1. 手机完全root

适用

要测试的APP在容器是的容器里面,sslunpinning有时不能将所有层都hook好,导致一部分流量仍然提示证书错误.

可能遇到的问题

1
2
remount of /system failed: Read-only file system
remount failed

解决办法:

1
2
3
4
5
6
adb root
adb disable-verity
adb reboot
adb remount
adb shell
mount -o rw,remount /system