MobSF and Genymotion Device Image

In this tutorial, it is assumed that you are familiar with MobSF and you are using it from a physical local machine. For detailed information about MobSF, please refer to MobSF documentation.

Prerequisite

Setup your Genymotion instance

1. Quickstart

Before proceeding, please read Genymotion Device image (PaaS) Requirements carefully.

Then, refer to Genymotion Device image Quickstart to get started with Genymotion for your Cloud provider (AWS, GCP, Alibaba or MS Azure).

2. Network

Your instance must have a Public IP or it will not be reachable from your local machine. This IP will change every time the instance is shutdown and booted.

If you wish to keep the same Public IP, we recommend using a persistent public IP, such as Elastic IP if you are using AWS.

3. Security / Firewall

MobSF uses adb to communicate with Genymotion instance via TCP port 5555.

So, add an inbound rule to your EC2 firewall/security to open TCP port 5555 for your local machine IP only:

AWS security settings inbound rules

Warning

Do not allow TCP connections to port 5555 from anyone (0.0.0.0/0): ADB connection is not secure and opening TCP port 5555 to all may compromise your instance integrity and security! Only allow inbound connections from your local machine IP.

4. Enable ADB

You need to enable ADB on your Genymotion instance:

  1. Access your Genymotion instance display
  2. Go to Configuration and Enable ADB
Genymotion Device Image Configuration screen, "ADB" section.

For more details and alternate methods, please refer to How to enable ADB?

Setup MobSF

From your local machine, ensure that you can connect to your Genymotion instance via adb:

Bash
adb connect <public_ip>:5555
adb devices

For example:

Bash
$ adb connect 54.78.205.214:5555
connected to 54.78.205.214:5555
$ adb devices
List of devices attached
54.78.205.214:5555 device

You can now perform MobSF Dynamic Analysis with your Genymotion instance.

If Dynamic Analyzer doesn’t detect the instance, you need to manually configure ANALYZER_IDENTIFIER in <user_home_dir>/.MobSF/config.py, or via environment variable ANALYZER_IDENTIFIER, with the instance public IP.

For example:

Bash
ANALYZER_IDENTIFIER = '54.78.205.214:5555'.

If MobSF cannot detect adb, you need to configure ADB_BINARY in <user_home_dir>/.MobSF/config.py.

For example:

Bash
ADB_BINARY = '/Applications/Genymotion.app/Contents/MacOS/tools/adb'

Table of Contents