Android 8.1 導入Burp、Fiddler證書


Android 8.1 導入Burp、Fiddler證書

Android從7.0過后,默認不在信任用戶導入的證書文件,以至於在數據抓包的時候,不能正確抓取HTTPS的數據包。
一、安裝 Burp 證書
  1. 獲取證書
掛上代理后,訪問 https://burp 下載證書,即 cacert.der。
  1. 將證書轉換為移動設備用戶憑據文件(Ubuntu 16.04)
# 轉換為 *.pem 文件
root@cj:~# openssl x509 -inform DER -in cacert.der -out cacert.pem
# 回顯某一 hash 值
root@cj:~# openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1
9a5ba575
# 將 *.pem 重命名為 <hash>.0
root@cj:~# mv cacert.pem 9a5ba575.0
  1. 安裝證書(手機已Root)
# 將 <hash>.0 傳到手機
adb push 9a5ba575.0 /sdcard/
# adb連接至設備
adb shell
# shell獲取root權限
su
# 系統重新掛載
mount -o rw,remount /
mount -o rw,remount /system
# 復制 <hash>.0 
cp /sdcard/9a5ba575.0 /system/etc/security/cacerts/
# 授權,644 rw-r--r--,本用戶有可讀可寫權限,群組有只讀權限,其他用戶為只讀權限。
chmod 644 /system/etc/security/cacerts/9a5ba575.0
# 重啟手機
reboot

  1. 驗證
設置->安全性和位置信息->加密與憑據->信任的憑據(顯示信任的CA證書)->系統->PortSwigger

二、安裝 Fiddler 證書

1.獲取證書

兩種方式:
1) 掛上代理 http://<本機ip>:8888 下載證書,點擊 FiddlerRoot certificate 進行下載,即 FiddlerRoot.cer。

2)Fiddler->Tools->HTTPS->Actions->Export Root Certificate to Desktop,將 FiddlerRoot.cer證書導出至桌面。
  1. 將證書轉換為移動設備用戶憑據文件(Ubuntu 16.04)
root@cj:~# openssl x509 -inform DER -in FiddlerRoot.cer -out F.pem
root@cj:~# openssl x509 -inform PEM -subject_hash_old -in F.pem |head -1
269953fb
root@cj:~# mv F.pem 269953fb.0
  1. 安裝證書(手機已Root)
adb push 269953fb.0 /sdcard/
adb shell
su
mount -o rw,remount /
mount -o rw,remount /system
cp /sdcard/269953fb.0 /system/etc/security/cacerts/
chmod 644 /system/etc/security/cacerts/269953fb.0
reboot
  1. 驗證
設置->安全性和位置信息->加密與憑據->信任的憑據(顯示信任的CA證書)->系統->DO_NOT_TRUST_FiddlerRoot

  1. 抓包配置
Fiddler->Tools->Connecttions->Allow remote computers to conect


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM