Android Application Testing Using Drozer in Kali Linux – Part I
Drozer is an open source security audit framework for pentesting Android applications that includes following components in the framework.
drozer allows you to search for security vulnerabilities in apps and devices by assuming the role of an app and interacting with the Dalvik VM, other apps’ IPC endpoints and the underlying OS.
drozer provides tools to help you use, share and understand public Android exploits. It helps you to deploy a drozer Agent to a device through exploitation or social engineering. Using weasel (MWR’s advanced exploitation payload) drozer is able to maximise the permissions available to it by installing a full agent, injecting a limited agent into a running process, or connecting a reverse shell to act as a Remote Access Tool (RAT).Source
drozer: console that runs on your PC provides CLI functionality.
drozer-agent: is actually an Android app that runs a server on Android device.
drozer-modules: central repository for all security analysts and anyone can use for testing Android exploits.
drozer-common: components that are shared between Agent and Console
Step 1: Install Drozer Console in Kali Linux
- Drozer requires python 2.7. By default Kali Linux contains python.
# python –version
Python 2.7.16Note: Use double hyphen in the above version command
If python 2.7 is not available, install using these commands. Otherwise skip these 2 commands.
# sudo apt-get update
# sudo apt-get install python2.7
- Download .whl file from https://github.com/mwrlabs/drozer/releases
- Install drozer using .whl file and all the prerequisites get installed automatically.
# cd Downloads
#python2.7 -m pip install drozer-2.4.4-py2-none-any.whl
- Confirm the successful installation by executing # drozer command
Drozer requires python 2.7. By default, Kali Linux contains python.
#python –version //double hypen
If python2.7 is not available, install using the 2 commands provided in the last section.
# pip install protobuf
# pip install pyOpenSSL
# pip install Twisted
Build Python wheel
# git clone https://github.com/mwrlabs/drozer.git
# cd drozer
# python setup.py bdist_wheel
Install Python wheel
# sudo pip install dist/drozer-2.4.4-py2-none-any.whl
Step 2: Install Drozer Agent on Android device or Emulator
- Download Drozer Agent
- Install Drozer Agent on the Android device or Emulator using adb install command
We are using Genny motion for Android emulator.
# cd downloads
# adb install drozer-agent-2.3.4.apk
- Follow screenshots to Start Agent
- Now connect Drozer Client running on Kali Linux to Drozer Agent on Android emulator.
# adb forward tcp:31415 tcp:31415
# drozer console connect
In the next part, we look at how to use Drozer to perform penetration testing on Android Mobile application.