1 Minute Read

I got tired of needing to install the cacert from burp into emulated android images … so below is a quick and dirty one liner in order to get the cert installed. Just make sure you have burp running on http://127.0.0.1:8080

curl --proxy http://127.0.0.1:8080 -o cacert.der http://burp/cert  \
&& openssl x509 -inform DER -in cacert.der -out cacert.pem \
&& cp cacert.der $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 \
&& adb root \
&& adb remount \
&& adb push $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /sdcard/ \
&& echo -n "mv /sdcard/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 /system/etc/security/cacerts/" | adb shell \
&& echo -n "chmod 644 /system/etc/security/cacerts/$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0" | adb shell \
&& echo -n "reboot" | adb shell \
&& rm $(openssl x509 -inform PEM -subject_hash_old -in cacert.pem |head -1).0 \
&& rm cacert.pem \
&& rm cacert.der

Source where commands came from

If all goes according to plan the cert is installed and your emulator will reboot, after which you should be able to update the wifi proxy settings and you will be good to go!


Jonathan Crosby

growing my chops in cybersecurity
(all opinions are my own and not the views of my employer)