Automate Static & Dynamic Analysis of the Mobile-Security-Framework
- Ubuntu based Linux
-
Install git
sudo apt install git -
Install Python 3.6
sudo apt install python -
Install JDK 8+
sudo apt install openjdk-8-jdk -
Install the following dependencies
sudo apt install python3-venv python3-pip python3-dev build-essential libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev wkhtmltopdf -
Install Graph Visualization Software
sudo apt install graphviz -
Install ADB Tool:
sudo apt install adb -
Android Emulator Options:
Recommended using Android 7.0 and above.
- Download & Install Android Studio: Android Studio Download Guide
- Add your Android SDK emulator directory to PATH:
export PATH="$PATH:/home/<user>/Android/Sdk/emulator - Set ADB_BINARY path in MobSF/settings.py, after the installation of MobSF:
ADB_BINARY = '/home/<user>/Android/Sdk/platform-tools/adb' - Create AVD Emulator with name mobsf:
Supports arm, arm64 and x86 architecture Android 5.0 - 9.0, upto API 28
- To see your created emulator:
cd ~/Android/Sdk/emulatoremulator -list-avds
-
Install npm
sudo apt install npm -
Install pm2
npm install pm2 -gorwget -qO- https://getpm2.com/install.sh | bash -
Download geckodriver
wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz tar -xvzf geckodriver* chmod +x geckodriver sudo mv geckodriver /usr/local/bin/. -
Install curl
sudo apt install curl -
Download MobSF
cd git clone https://github.com/ZachGeo/Mobile-Security-Framework-MobSF cd Mobile-Security-Framework-MobSF ./setup.shAdded Static Tool: Decompile APKs and Create CFG - Androguard
Official Repository of MobSF
-
Download Automation-MobSF
cd git clone https://github.com/ZachGeo/Automation-MobSF cd Automation-MobSF/run/ chmod +x setup.sh ./setup.sh
-
cd ~/Automation-MobSF/chmod +x emulator.shpm2 start ./emulator.shpm2 savecd ~/Mobile-Security-Framework-MobSF/chmod +x run.shpm2 start ./run.shpm2 savecd ~/Automation-MobSF/run/chmod +x androguard_dec_cfg.shchmod +x auto_upload_scan.shpm2 start ./auto_upload_scan.shpm2 save
- Option 1: User Interface - Manually.
- Open Browser.
- Type: localhost:8000
- Upload & Scan a sample based on the documentation of MobSF.
- Option 2: Command Line - Automatically.
- Move your Sample into the directory
~/Automation-MobSF/APKs& wait for the reports.
- Move your Sample into the directory
- Start emulator in order to have a writable system image during your emulation session:
-writable-system - Disable the Quick Boot and performs Cold Boot, without loading or saving the emulator state:
-no-snapshot - Wipe Data from the emulator at start:
-wipe-data - Find adb emulator name:
adb devices - Stop Emulator:
adb -s <emulator adb name> emu kill