Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/darvincisec/InjectFakeSecurityProvider

A simple script to patch smali file to include a Fake Security Provider at 1 for Android Apps
https://github.com/darvincisec/InjectFakeSecurityProvider

Last synced: 3 months ago
JSON representation

A simple script to patch smali file to include a Fake Security Provider at 1 for Android Apps

Awesome Lists containing this project

README

        

# InjectFakeSecurityProvider
A simple script to patch smali file to include a Fake Security Provider at 1. This provider is created by patching the SpongyCastle library to print the key, key size, algorithm parameters, keystore password in logcat. With this you can retrieve application cryptographic assets provided applications depend on the default security provider.

If applications just rely on default Security Provider like this
```Java
Cipher.getInstance("AES");
KeyStore.getInstance("BKS");
```
then inserting a security provider
```Java
Security.insertProviderAt(new BouncyCastleProvider(), 1);
```
can divert all the cryptographic operations to be performed through the inserted security provider.

# Usage
```Shell
sh patchcryptoprovider.sh
```
Ex: sh patchcryptoprovider.sh 123.apk MainActivity

# Demo
Aegis OTP authenticator depends on the default Security Provider. By executing this script, this app is tampered with a fake security provider and hence OTP seed used in HMAC operation can be seen easily in the logcat

![Demo](demo.gif)