News for hackers. Stuff that matters.
Re:Mitmproxy 7.0 by pimterry on Friday July 16, 2021 @11:40AM (#27857429)
In short:

* By default, all modern Android apps only trust CA system certificates, and on a normal device you cannot change those.

* You can change system certificates on rooted devices and most (but not all) emulators.

* Apps can opt-in to trusting user-installed CA certificates within their manifest config, but almost all don't.

If you're on a non-rooted device, the only way to MITM traffic is by modifying the application itself, so that it opts into trusting your cert. You can either inject Frida-Gadget to do that, do it manually, or use https://github.com/shroudedcode/apk-mitm which tries to do it automatically (but it's a bit hit & miss whether it works).

If you're on an emulator/rooted device, it's totally possible, see https://httptoolkit.tech/blog/intercepting-android-https/#in... for how that works.

That's separate to explicit certificate pinning. That's also possible on Android (with some standard config settings, or manually in code) although it's got much less popular I think since the defaults were tightened up. In that case you do usually need Frida, and it's generally easiest to just use a rooted device. I wrote a blog post about exactly how to do that last week: https://httptoolkit.tech/blog/frida-certificate-pinning/#how...

Re:Mitmproxy 7.0 by stavros on Monday July 19, 2021 @05:40PM (#27887561)
I love you, Pim. I never thought to change the system CA store, I always thought they'd pin to their own cert anyway.
Re:Mitmproxy 7.0 by mirashii on Friday July 16, 2021 @12:43PM (#27858145)
> By default, all modern Android apps only trust CA system certificates, and on a normal device you cannot change those.

Sure you can. It's in a settings pane, Settings -> Security -> Encryption and Credentials -> Install a certificate.

MDM profiles can also install certificates.

There's pretty much zero possibility of this being removed as a feature as it is essential to a wide variety of corporate environments.

Re:Mitmproxy 7.0 by pimterry on Friday July 16, 2021 @12:54PM (#27858275)
Those certificates are user-added certificates, not system certificates. Android has two separate certificate stores, the UI only exposes the user certificate store, and by default apps only trust the system certificate store.

This was changed back in 2016, the original announcement post has some good details: https://android-developers.googleblog.com/2016/07/changes-to...

Enterprises can add certificates to the system store I believe, but only as part of the initial provisioning of the device, and only for enterprise-managed devices.

Re:Mitmproxy 7.0 by GekkePrutser on Friday July 16, 2021 @01:53PM (#27859082)
Indeed, and such enterprise-management devices must be wiped for enrolment.

There's some management modes which don't require that but they don't offer the ability to install system certs.

Re:Mitmproxy 7.0 by mumphster on Friday July 16, 2021 @12:47PM (#27858192)
This doesn’t bypass cert pinning in apps which was the original question