MobSF and Genymotion Device Image

2024-04-23

In this tutorial, it is assumed that you are familiar with MobSF. MobSF is used from a physical local machine. Detailed information about MobSF is available in the MobSF documentation.

Prerequisite

Setup your Genymotion instance

1. Quickstart

Before proceeding, read Genymotion Device image (PaaS) Requirements carefully. Then, refer to Genymotion Device image Quickstart to get started with Genymotion for your Cloud provider. The Cloud provider options are AWS, GCP, Alibaba, or MS Azure.

2. Network

An instance must have a Public IP. An instance without a Public IP is not reachable from your local machine.

The Public IP changes every time the instance is shutdown and booted. If you wish to keep the same Public IP, use a persistent public IP. An example persistent public IP is Elastic IP when using AWS.

3. Security / Firewall

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

Add an inbound rule to the EC2 firewall/security to open TCP port 5555. Restrict the inbound rule to your local machine IP only.

> Warning: Do not allow TCP connections to port 5555 from anyone (0.0.0.0/0): ADB connection is not secure. 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

Enable ADB on your Genymotion instance.

1. Access your Genymotion instance display. 2. Go to Configuration and Enable ADB.

For more details and alternate methods, 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

Example

$ 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 does not detect the instance, manually configure ANALYZER_IDENTIFIER. Configure ANALYZER_IDENTIFIER in <user_home_dir>/.MobSF/config.py. Configure ANALYZER_IDENTIFIER alternatively via environment variable ANALYZER_IDENTIFIER with the instance public IP.

Example

ANALYZER_IDENTIFIER = '54.78.205.214:5555'.

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

Example

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