wiKB

Wiki-based Knowledge Base

View on GitHub

Android

Usefull working directory

/data/local/tmp/

List applications (packages)

pm list packages

See pm help for a full list of usages.

Location of apps data

/data/data/<package_name>

Perhaps something in:

Launch an Android application in a VM using Anbox

Notes about a test done on December 28th, 2019 using an Ubuntu 16.04.6 Xenial LTS (Backbox).

Note: adb was already installed.

Install Anbox

snap install --devmode --beta anbox

Install the kernel modules

sudo add-apt-repository ppa:morphis/anbox-support
sudo apt update
sudo apt install linux-headers-generic anbox-modules-dkms

Enable the modules (or reboot)

sudo modprobe ashmem_linux
sudo modprobe binder_linux

Install adb if needed:

sudo apt install android-tools-adb

The device should now be visible from adb using:

adb devices

Or maybe it is needed to launch the session manager? (don’t remember)

anbox session-manager

Install the application

adb install example.apk

Launch application

anbox launch --package=com.contoso.superapp --component=com.contoso.superapp.MainActivity

Play with it

It is now possible to listen traffic on the anbox0 network interface.

Using adb, frida, iptables, Burp Suite, etc. it is possible to do almost everything!

Set a proxy

Using adb with:

adb shell settings put global http_proxy <ip>:<port>

see: https://stackoverflow.com/questions/31807559/undo-setting-proxy-via-settings-global-in-android/47476009#47476009

Mettre en place frida sur un téléphone Android

1. S’assurer que le téléphone est rooté

et si c’est le cas, ne pas oublier d’activer l’option “accès root” dans les options développeurs

2. Vérifier que adb fonctionne

Il est possible de connecter le téléphone en USB ou bien d’activer le débogage par réseau. TODO : expliquer la partie pour activer le débogage par réseau à l’aide de la commande adb tcpip 4444 Note : avec Virtualbox et la kali en VM, les options usb sont restés en mode USB 2.0 et le cable utilisé était un câble USB 2.0 malgré qu’il soit sur un port USB 3.0.

3. Démarrer adb en mode root

sinon il n’est pas possible d’accéder aux autres applications : adb root

4. Envoyer et démarrer le démon frida

5. Installer le client sur kali

sudo apt update
sudo apt install android-tools-adb android-tools-fastboot
sudo usermod -a -G plugdev joe # si l'utilisateur n'appartient pas encore au groupe plugdev
sudo su - joe # pour recharger les permissions

6. Profit

Il est maintenant possible de :

(Le -U est utilisé car le téléphone est branché en USB)

Outrepasser le SSL pinning dans une application Android

0. 0b10 façons de faire

1. S’assurer que frida est fonctionnel

Voir plus haut

2. Décompresser l’application

apktool d example.apk -o apktool_output

3. Insérer le gadget