adb 导入 burp 证书

有时候,我们的 Android 系统可能存在于某些 IoT 设备中,亦或者系统本身裁剪了用户导入证书的功能,这个时候,我们怎么导入 burp 的证书,并且抓包呢?

0x10 导出 burp 证书并进行处理

Burpsuite 导出证书

方法一:直接在浏览器中输入 http://burp,下载证书

在这里插入图片描述

方法二:在 Burpsuite 中直接导出证书

在这里插入图片描述

将 der 格式的证书转为 pem 证书

openssl x509 -inform der -in cacert.der -out burp.pem 

生成 pem 证书的 hash

openssl x509 -inform PEM -subject_hash_old -in  burp.pem

证书重命名

cp burp.pem 9a5ba575.0

0x20 adb 导入证书

重新挂载文件系统,使其具有可写权限

adb root
adb remount
# adb shell mount -o remount,rw /system

导入证书

扫描二维码关注公众号,回复: 17337641 查看本文章
adb push 9a5ba575.0 /data/local/tmp

将证书复制到系统根证书所在目录

# adb shell
cp /data/local/tmp/9a5ba575.0 /system/etc/security/cacerts/
cd /system/etc/security/cacerts
chmod 644 9a5ba575.0

重启即可

0x30 adb 设置代理和关闭代理

设置代理

adb shell settings put global http_proxy ip:port

关闭代理(无需重启)

adb shell settings put global http_proxy :0

移除代理(需要重启)

adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port

猜你喜欢

转载自blog.csdn.net/song_lee/article/details/118058168