14

android 7.0之后导入证书解决fiddler等软件无法解析加密报文

 3 years ago
source link: https://blog.csdn.net/liutianheng654/article/details/101287072
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

android 7.0之后导入证书解决fiddler等软件无法解析加密报文

original.png
liutianheng654 2019-09-24 15:34:21 articleReadEyes.png 21029
分类专栏: 逆向

7.0之后Android默认不相信用户自己安装的证书,需要程序自己实现是否相信用户证书。在此背景下,fiddler无法抓包https加密的报文,这种情况下解决办法只有两个,一个是不用android7.0以上的设备。。通常模拟器都是6.0目前,所以还可以。还有一个方法就是安装系统的根证书。我们这里就采用的第二个方法。

一台root的手机,这里使用的是nexus6p

1.先从fiddler中下载需要的证书,即在本地8888端口下载即可。我这里下载到的证书名字为:fiddlerRoot.cer

2.得到证书的哈希值:

openssl x509 -inform DER -subject_hash_old -in fiddlerRoot.cer | head -1
得到类似字符串:e5c3944b

(网上看到,如果是crt格式证书,命令为:openssl x509 -inform PEM -subject_hash_old -in CA_Name.crt | head -1)

3.重命名文件,将证书命名为e5c3944b.0

4.拷贝文件到手机存放根证书的目录:我这里不知道为什么直接adb进行root操作不行,所以是先拷贝到sdcard,然后再mv到存放根证书的目录

1)adb push e5c3944b.0 /sdcard/tmp/e5c3944b.0

2)  adb shell

3)  root权限 :su

4)重新挂载system分区为可读写:mount -o rw,remount /system

5)  mv /sdcard/tmp/e5c3944b.0 /system/etc/security/cacerts/e5c3944b.0

6)  cd /system/etc/security/cacerts

6)  chmod 644 e5c3944b.0

5.重启设备即可

上述一顿操作之后,就可以实现大多数应用的ssl解密了,还不行的试试xposed插件,justtrustme,可以破解ssl pining


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK