Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsondt/7751cde37a6747d68e0508697d93af10 to your computer and use it in GitHub Desktop.
Save tsondt/7751cde37a6747d68e0508697d93af10 to your computer and use it in GitHub Desktop.
Add Burp CA certificate to a rooted Android device
  • Export the CA certificate: Proxy -> Options -> Import / Export CA certificate -> Export certificate in DER format
  • Prepare the certificate in the correct format:
openssl x509 -in cacert.der -inform DER -outform PEM >> "$(openssl x509 -inform DER -in cacert.der -subject_hash | head -1).0"
openssl x509 -in cacert.der -inform DER -text -noout >> "$(openssl x509 -inform DER -in cacert.der -subject_hash | head -1).0"
  • Copy the certificate into /etc/security/cacerts:
    • On the machine shell:
      adb push xxxxxxxx.0 /sdcard/
      adb shell
      
    • On adb shell:
      su
      mount -o rw,remount /system
      mv /sdcard/xxxxxxxx.0 /etc/security/cacerts
      chown root:root /etc/security/cacerts/xxxxxxxx.0
      chmod 644 /etc/security/cacerts/xxxxxxxx.0
      
  • Reboot the Android device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment