- Как вы импортируете сертификаты CA на телефон Android?
- Install Burpsuite’s or any CA certificate to system store in Android 10,11 and Kali linux.
- What is the need to Install certificates in System Trust Store?
- Android 11 tightens restrictions on CA certificates
- Importing private CA certificates in Android
- Errors and Notes
Как вы импортируете сертификаты CA на телефон Android?
Я хочу подключиться к беспроводной сети моего университета, используя мой Nexus One. Когда я иду в «Добавить сеть Wi-Fi» в настройках беспроводной сети, я заполняю SSID сети, выбираю 802.1x Enterprise для безопасности и заполняю все.
Проблема в том, что для сертификации в нашем университете используется сертификат Thawte Premium Server CA.
Когда я нажимаю раскрывающийся список для сертификата CA, я ничего не получаю в списке (только N / A)
Теперь у меня есть сертификат (Thawte Premium Server CA.pem) и я переместил его на свою SD-карту, но он не выглядит так, как будто Android автоматически обнаруживает его.
Где я должен положить сертификат, чтобы диспетчер беспроводной связи Android распознал его. Другими словами, как я могу импортировать сертификат CA, чтобы Android распознал его на телефоне и отобразил его в раскрывающемся списке CA Certificate.
Спасибо за любую помощь,
PS мой телефон не рутирован
РЕДАКТИРОВАТЬ : После некоторых исследований, похоже, что вы можете установить сертификаты, перейдя в настройки вашего телефона> Расположение и безопасность> Установка с SD-карты
К сожалению, похоже, что единственным допустимым расширением файла является .p12. Не похоже, что на данный момент есть способ импортировать файлы .cer или .pem (которые являются единственными двумя файлами, которые поставляются с сертификатами Thawte).
Похоже, что вы можете использовать конвертер для преобразования ваших файлов .cer или .pem в .p12, однако файл ключа необходим.
Я не знаю, где взять этот файл ключей для сертификатов Thawte.
Источник
Install Burpsuite’s or any CA certificate to system store in Android 10,11 and Kali linux.
Oct 24, 2020 · 6 min read
Hi readers, if you like to understand what is CA(Certificate Authority) and how client-server interact please watch this video https://www.youtube.com/watch?v=T4Df5_cojAs. You will get a basic idea how HTTPS works. Otherwise if you know basic asymmetric(also known as public key) cryptography you are good to go.
Each device which uses SSL/TLS has a CA certificate store which contains public keys of all the trusted CAs(Firefox maintains its own store). Also there is something known as certificate chains(chain of trust) but this is out of scope of current topic.
In android there are two CA certificate stores User and System.
Us e r store contains certificates installed by user installed apps like adguard, sslAnalyzer etc. or by user itself for intercepting Https traffic or for MITM.
System store contains the certificates of trusted CAs which comes preinstalled by the device manufacturers and are pretty much same in all the devices because number of Trusted CAs are limited on the internet.
What is the need to Install certificates in System Trust Store?
While testing or perfoming security analysis of android apps using a proxy tool such as Burp, Zap, mitmprox etc. All the apps by defaults do not trust the user trust store unless explicitly stated in the network security configuration of the app.
It is good to check this configuration before attempting to bypass the certificate pinning or else you may get frustrated or may end up in a rabbit hole.
Even if a app does trust the user store in the configuration you may still have trouble proxying all the applications traffic. If the app uses the WebViews for loading any HTTPS web pages in the app they might not be loaded on the app. As the WebViews do not trust the user store even if the app does so.
Installing the certificate of proxy server in the system store will solve this issues.
First we need to copy the certificate in PEM format to internal storage of mobile phone. We will be installing burpsuite’s CA. To do these follow these simple steps:
Источник
Android 11 tightens restrictions on CA certificates
Your trusted Certificate Authorities (CAs) are the organizations that you trust to guarantee the signatures of your encrypted traffic and content. That’s a lot of power, and the list of trusted authorities is dangerous to mess around with. Nonetheless, it’s also something that power users might want to configure, for Android testing, for app debugging, for reverse engineering or as part of some enterprise network configurations.
Android has tightly restricted this power for a while, but in Android 11 (released this week) it locks down further, making it impossible for any app, debugging tool or user action to prompt to install a CA certificate, even to the untrusted-by-default user-managed certificate store. The only way to install any CA certificate now is by using a button hidden deep in the settings, on a page that apps cannot link to.
To be clear, carefully managing the trusted CAs on Android devices is important! Adding a CA should not be easy to do by accident or unknowingly. Protecting users from themselves is absolutely necessary here, and it’s a hard problem.
That said, there are many legitimate use cases where you want to be able to choose which CAs you trust, and that just got much harder. There’s a balance here to manage, and I’m not sure Android has made the right choice.
Let’s dig into the details:
How did Android CA certificate management work until now?
Until now, an app could ask a user to trust a CA certificate in the user certificate store (but not the system store), using the KeyChain.createInstallIntent() API method. Similarly, the operating system would offer to trust a CA certificate if one was manually opened on the device from the filesystem.
These certificate trust prompts came with a variety of loud warnings & confirmations, and mandated setup of a device pin or other screen lock before you could complete them, if one wasn’t already set. It wasn’t possible to do accidentally, and it was hard to trick users into accepting these scary prompts (although probably not impossible).
That only applied to the user certificate store. This store, in case you’re not familiar, differs significantly from Android system-wide certificate store, and since Android 7 (Nougat, released in 2016) it’s been impossible to install any CA certificates into the system store without fully rooting the device.
The system store is used as the default to verify all certificates — e.g. for your apps’ HTTPS connections — and as a normal user it’s completely impossible to change the certificates here, and has been for quite some time.
Until now however, you could install to the user certificate store, which apps could individually opt into trusting, but which they don’t trust by default.
This was very useful! This allowed developers to opt-into this trust in their local builds to debug traffic, it allowed testers to automatically & easily trust CA certificates so they can mock & verify HTTPS traffic in manual & automated testing, and it was used by a wide variety of debugging tools (including HTTP Toolkit) to easily let developers & testers inspect & rewrite their encrypted HTTPS traffic.
Unfortunately, automating that setup is no longer possible on these devices, and each of these use cases will now require a series of fiddly manual steps that tools can’t lead you to or help with.
In Android 11, the certificate installer now checks who asked to install the certificate. If it was launched by anybody other than the system’s settings application, the certificate install is refused with an obscure alert message:
Can’t install CA certificates CA certificates can put your privacy at risk and must be installed in Settings
This wasn’t clearly announced anywhere, as far as I can tell. The only mention in the Android 11 release information is a small side note in the enterprise features changelog, which notes that the createInstallIntent() API no longer works in some cases.
In practice, this change means the certificate install API no longer works, opening certificate files no longer works, and it’s impossible to initiate a certificate install even from ADB (the Android debugging tool).
It is still possible to install certificates using the device management API, but only in the special case where your application is a pre-installed OEM app, marked during the device’s initial setup as the ‘device owner’. If not, you’re out of luck.
In Android 11, to install a CA certificate, users need to manually:
- Open settings
- Go to ‘Security’
- Go to ‘Encryption & Credentials’
- Go to ‘Install from storage’
- Select ‘CA Certificate’ from the list of types available
- Accept a large scary warning
- Browse to the certificate file on the device and open it
- Confirm the certificate install
Applications and automation tools can send you to the general ‘Security’ settings page, but no further: from there the user must go alone (fiddly if not impossible with test automation tools).
More inconvenient still: with the existing APIs, the app could provide the certificate bytes directly, reading certificates from their own internal data or storage. Now, because the user must browse to it, the certificate has to be in the shared user-accessible storage on the device. This also risks it being rewritten by other apps on the device before it’s trusted, if they have the permissions to write to shared folders (not default, but not uncommon), allowing those apps to sneak their own CA on to unsuspecting users.
While it’s still possible to trust your own CAs on rooted devices, Android is also making a parallel drive for hardware attestation as part of SafetyNet on new OS releases & devices, which will make this far harder.
Hardware attestation makes it possible for Android apps to reliably know whether the OS on the device is the original installed by the OEM. Many apps use SafetyNet to block installs and usage on such devices, and that doesn’t just apply to secure banking apps: apps from Netflix to Pokemon Go to McDonald’s require SafetyNet checks. In a not-so-distant future, these and many other apps will be completely unusable on rooted devices, once hardware attestation becomes standard.
Put together, this is not good. Android’s been locking down on this for a while, but it really feels now like they’re moving to a world where custom ROMs are cut off from much of the Android ecosystem, and official ROMs are completely locked down and inaccessible even to developers.
First up: add a star on the Android bug I’ve filed, suggesting an automatable ADB-based option for CA certificate management, for development use cases like these: https://issuetracker.google.com/issues/168169729.
Once you’ve done that, in the meantime you have a few options:
- Accept that you need to manually install CA certificates, and do so/tell your users how to do so.
- Use a rooted device or emulator, and trust your certificate in the system store (you might be interested in how HTTP Toolkit does this).
- Completely reset the device, preprovision your application (before initial account setup), and configure your application as the device owner with dpm set-device-owner
- Enable debugging on the device, connect to it with ADB, and manually inject touch events to automatically walk through the various settings screens.
- Avoid using Android 11 entirely.
For now, HTTP Toolkit takes options 1 and 2:
- For users using Android Published a year ago by Tim Perry
Источник
Importing private CA certificates in Android
Internal encryption in company networks is important and something that’s done relatively easy. By creating your own certificate authority (CA) and signing your server certificates with it, you can establish a centralized point of trust on all your devices, making it much more easy for you to maintain your network encryption. Plus, it doesn’t cost a dime in licenses if you use free solutions such as openssl and you are much more flexible than with paid certificates.
When you are using your own domains, such as yourcompany.local, your own CA is a great way to provide trusted certificates for all your applications. The only requirement is that your CA certificate is imported on all devices that connect to those services. Let’s see how we can import your CA certificate into the Android certificate store.
On Android, importing system wide certificates is fairly straight forward. Just open your settings, scroll down to Security and tap the Install from storage option.
Browse to the location of your CA certificate and tap the file to import it. After naming your imported certificate authority and specifying what it should be used for, your should get a success message and the certificate should now be listed in the User tab.
Errors and Notes
The following screenshots show three minor things we encountered.
First, if you get the error message No certificate to install shown above, your certificate is most likely formatted incorrectly. Android requires .DER formatted certificates to be able to import them. You can convert your certificate easily with the following command.
Your certificate might already be called ca_cert.pem , which would indicate that it’s PEM formatted, however the ending .crt is not only used for .DER certificates but sometimes as a file extension for certificates in general, which can result in the wrong assumption that it is a .DER file, when it fact it might not be.
You can check the format with the following commands.
The first command tries to import the certificate as DER file. Since it fails, we now know that it’s not a DER formatted file. The second command tries to import the same certificate as PEM file. The command is successful and shows us the content of the certificate, which indicates that this must be a PEM formatted file.
Once you have converted your certificate, you should be able to import it and be presented with success message (see above).
The second thing we encountered was that if you use neither a PIN, nor a password to unlock your device, importing a CA certificate might require you to improve your device security first. Just set a pin or password, or if you have already but are using a «auto-unlock» app for your home network, simply disable WIFI temporarily and you should be good to go.
Last but not least, since a custom CA allows the owner of the CA to create valid certificates for any website on your device (even google.com, facebook.com, etc.), you should get the following info message. Only ever allow certificates you have good reason to trust in, especially when it comes to CA certificates.
Hopefully you enjoyed this little excourse into the Android certificate store. Leave a comment if you think we should also cover other devices such as iOS, Windows Phone, Linux, Mac and Windows and Mozilla applications, which all keep their own certificate store?
Источник