Top Related Projects
The Leading Security Assessment Framework for Android.
The Leading Security Assessment Framework for Android.
A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.
Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
Tool to look for several security related Android application vulnerabilities
Quick Overview
Drozer is an Android security assessment framework developed by ReversecLabs. It allows security researchers and developers to search for security vulnerabilities in Android applications and devices by assuming the role of an app and interacting with the Dalvik VM, other apps' IPC endpoints, and the underlying OS.
Pros
- Comprehensive Android security testing tool
- Supports both remote and on-device testing
- Extensible through modules and plugins
- Active community and regular updates
Cons
- Requires rooted Android devices for full functionality
- Steep learning curve for beginners
- Limited documentation for advanced features
- May trigger antivirus software as a potential threat
Code Examples
# Connect to a Drozer server
dz> connect 192.168.1.100
# List all installed packages on the device
dz> run app.package.list
# Identify attack surface of an application
dz> run app.package.attacksurface com.example.app
# Exploit a content provider vulnerability
dz> run app.provider.query content://com.vulnerable.app.provider/data
# Launch a shell on the device
dz> run post.capture.shell
# Perform a man-in-the-middle attack
dz> run tools.setup.proxy
dz> run tools.setup.server 31415
Getting Started
-
Install Drozer on your computer:
pip install drozer
-
Install the Drozer Agent app on your Android device.
-
Start the Drozer console:
drozer console connect
-
Begin testing with commands like:
dz> run app.package.list dz> run app.package.info com.example.app dz> run scanner.provider.finduris -a com.example.app
For more detailed instructions and advanced usage, refer to the official Drozer documentation.
Competitor Comparisons
The Leading Security Assessment Framework for Android.
Pros of drozer
- More active development and recent updates
- Larger community and contributor base
- Better documentation and user guides
Cons of drozer
- Potentially less stable due to frequent changes
- May have a steeper learning curve for new users
- Could have more dependencies or complex setup
Code Comparison
drozer:
from drozer.modules import Module
class ExampleModule(Module):
name = "Example Module"
description = "This is an example module"
def run(self, arguments):
self.stdout.write("Hello from drozer!")
drozer>:
from drozer.modules import Module
class SimpleModule(Module):
name = "Simple Module"
description = "A basic module example"
def execute(self, args):
print("Hello from drozer>!")
The code structures are similar, but drozer uses run
method while drozer> uses execute
. drozer also utilizes self.stdout.write
for output, whereas drozer> uses a simple print
statement.
Note: As the repositories mentioned in the prompt appear to be the same (ReversecLabs/drozer), this comparison is hypothetical and may not reflect actual differences between existing repositories.
The Leading Security Assessment Framework for Android.
Pros of drozer
- More active development and recent updates
- Larger community and contributor base
- Better documentation and user guides
Cons of drozer
- Potentially less stable due to frequent changes
- May have a steeper learning curve for new users
- Could have more dependencies or complex setup
Code Comparison
drozer:
from drozer.modules import Module
class ExampleModule(Module):
name = "Example Module"
description = "This is an example module"
def run(self, arguments):
self.stdout.write("Hello from drozer!")
drozer>:
from drozer.modules import Module
class SimpleModule(Module):
name = "Simple Module"
description = "A basic module example"
def execute(self, args):
print("Hello from drozer>!")
The code structures are similar, but drozer uses run
method while drozer> uses execute
. drozer also utilizes self.stdout.write
for output, whereas drozer> uses a simple print
statement.
Note: As the repositories mentioned in the prompt appear to be the same (ReversecLabs/drozer), this comparison is hypothetical and may not reflect actual differences between existing repositories.
A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.
Pros of House
- More modern and actively maintained codebase
- Supports both Android and iOS platforms
- Offers a user-friendly web interface for easier interaction
Cons of House
- Steeper learning curve due to more complex architecture
- Requires more setup and dependencies compared to Drozer
- May be overkill for simpler mobile app security assessments
Code Comparison
House (Python):
@app.route('/api/applications', methods=['GET'])
def list_applications():
applications = house_core.list_applications()
return jsonify(applications)
Drozer (Python):
class App(Module):
def execute(self, arguments):
for app in self.packageManager().getInstalledApplications(0):
self.stdout.write("%s (%s)\n" % (app.packageName, app.processName))
Both tools use Python, but House employs a web-based approach with Flask, while Drozer uses a command-line interface. House's code structure is more modular and follows modern web development practices, whereas Drozer's code is more straightforward but less flexible for complex scenarios.
Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
Pros of Mobile-Security-Framework-MobSF
- Supports both Android and iOS platforms
- Provides a comprehensive web-based interface for analysis
- Offers static and dynamic analysis capabilities
Cons of Mobile-Security-Framework-MobSF
- Requires more setup and dependencies
- May have a steeper learning curve for beginners
- Less focused on interactive testing compared to Drozer
Code Comparison
Mobile-Security-Framework-MobSF (Python):
def scan_file(self, file_path):
# Perform static analysis
static_analysis_result = self.static_analyzer.analyze(file_path)
# Perform dynamic analysis
dynamic_analysis_result = self.dynamic_analyzer.analyze(file_path)
return static_analysis_result, dynamic_analysis_result
Drozer (Python):
def run(self, arguments):
if arguments.package is None:
print("Package name not specified.")
return
self.packageManager = self.getContext().getPackageManager()
package = self.packageManager.getPackageInfo(arguments.package, PackageManager.GET_ACTIVITIES)
for activity in package.activities:
print("Activity:", activity.name)
The code snippets illustrate the different approaches:
- MobSF focuses on comprehensive analysis (static and dynamic)
- Drozer emphasizes interactive exploration of app components
Both tools are valuable for mobile app security testing, with MobSF offering a broader analysis scope and Drozer providing more targeted, interactive capabilities.
Tool to look for several security related Android application vulnerabilities
Pros of QARK
- More comprehensive static analysis capabilities
- Supports both Java and Kotlin for Android app analysis
- Provides detailed reports with remediation suggestions
Cons of QARK
- Less active development and maintenance
- Limited dynamic analysis features compared to Drozer
- May produce more false positives due to broader scope
Code Comparison
QARK (Python):
def __init__(self):
self.vulnerabilities = []
self.issues = []
self.apk_filename = None
self.manifest = None
Drozer (Python):
def run(self, arguments):
if arguments.package is None:
self.stderr.write("Package name not specified.\n")
return
self.packageManager().getPackageInfo(arguments.package, common.PackageManager.GET_ACTIVITIES)
Both tools are written in Python, but QARK focuses on static analysis of source code, while Drozer emphasizes dynamic analysis and interaction with running Android apps. QARK's code structure is geared towards vulnerability detection and reporting, whereas Drozer's code is more oriented towards runtime manipulation and testing of Android components.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
drozer
drozer is a security testing framework for Android.
drozer allows you to search for security vulnerabilities in apps and devices by assuming the role of an app and interacting with the Android Runtime, other apps' IPC endpoints and the underlying OS.
drozer provides tools to help you use, share and understand public Android exploits.
drozer is open source software, maintained by Reversec. An introductory user guide can be found on Reversec Labs
NOTE
This is an BETA release of a rewritten drozer version; this version is updated to support python3.
Currently, the following known issues are present:
- Building of custom agents functionality will crash the drozer client. This functionality is considered out of scope for the beta release of the revived drozer project.
Docker Container
To help with making sure drozer can be run on all systems, a Docker container was created that has a working build of drozer.
- The Docker container and basic setup instructions can be found here.
- Instructions on building your own Docker container can be found here.
Manual Building and Installation
Software pre-requisites
- Python3.8
- Protobuf 4.25.2 or greater
- Pyopenssl 22.0.0 or greater
- Twisted 18.9.0 or greater
- Distro 1.8.0 or greater
- Java Development Kit 11 or greater
Installing
You can use pip
or pipx
(preferably, if available) to install the latest release of drozer from PyPI:
pipx install drozer
Alternatively, you can download individual releases from GitHub and run:
pipx install ./drozer-*.whl
If you haven't already, consider running:
pipx ensurepath
to ensure pipx
-installed packages appear in your PATH
Building
To build drozer from source you can run.
git clone https://github.com/ReversecLabs/drozer.git
cd drozer
pip install .
To build the Android native components against a specific SDK you can set the ANDROID_SDK
environment variable to the path. For example:
Linux/macOS:
export ANDROID_SDK=/home/drozerUser/Android/Sdk/platforms/android-34/android.jar
Windows - PowerShell:
New-Item -Path Env:\ANDROID_SDK -Value 'C:\Users\drozerUser\AppData\Local\Android\sdk\platforms\android-34\android.jar'
Windows - cmd:
set ANDROID_SDK = "C:\Users\drozerUser\AppData\Local\Android\sdk\platforms\android-34\android.jar"
The location of the d8
tool used can also be changed by setting D8
.
Usage
Installing the Agent
drozer can be installed using Android Debug Bridge (adb).
Download the latest drozer Agent here.
adb install drozer-agent.apk
Setup for session
You should now have the drozer Console installed on your PC, and the Agent running on your test device. Now, you need to connect the two and youâre ready to start exploring.
We will use the server embedded in the drozer Agent to do this. First, launch the Agent, select the "Embedded Server" option and tap "Enable" to start the server. You should see a notification that the server has started.
Then, follow one of the options below.
Option 1: Connect to the phone via network
By default, the drozer Agent listens for incoming TCP connections on all interfaces on port 31415. In order to connect to the Agent, run the following command:
drozer console connect --server <phone's IP address>
If you are using the Docker container, the equivalent command would be:
docker run --net host -it drozerdocker/drozer console connect --server <phone's IP address>
Option 2: Connect to the phone via USB
In some scenarios, connecting to the device over the network may not be viable. In these scenarios, we can leverage adb
's port-forwarding capabilities to establish a connection over USB.
First, you need to set up a suitable port forward so that your PC can connect to a TCP socket opened by the Agent inside the emulator, or on the device. By default, drozer uses port 31415
adb forward tcp:31415 tcp:31415
You can now connect to the drozer Agent by connecting to localhost
(or simply not specifying the target IP)
drozer console connect
Confirming a successful connection
You should be presented with a drozer command prompt:
Selecting ebe9fcc0c47b28da (Google sdk_gphone64_x86_64 12)
.. ..:.
..o.. .r..
..a.. . ....... . ..nd
ro..idsnemesisand..pr
.otectorandroidsneme.
.,sisandprotectorandroids+.
..nemesisandprotectorandroidsn:.
.emesisandprotectorandroidsnemes..
..isandp,..,rotecyayandro,..,idsnem.
.isisandp..rotectorandroid..snemisis.
,andprotectorandroidsnemisisandprotec.
.torandroidsnemesisandprotectorandroid.
.snemisisandprotectorandroidsnemesisan:
.dprotectorandroidsnemesisandprotector.
drozer Console (v3.0.0)
dz>
The prompt confirms the Android ID of the device you have connected to, along with the manufacturer, model and Android software version.
You are now ready to start exploring the device.
Command Reference
Command | Description |
---|---|
run | Executes a drozer module |
list | Show a list of all drozer modules that can be executed in the current session. This hides modules that you do not have suitable permissions to run. |
shell | Start an interactive Linux shell on the device, in the context of the Agent process. |
cd | Mounts a particular namespace as the root of session, to avoid having to repeatedly type the full name of a module. |
clean | Remove temporary files stored by drozer on the Android device. |
contributors | Displays a list of people who have contributed to the drozer framework and modules in use on your system. |
echo | Print text to the console. |
exit | Terminate the drozer session. |
help | Display help about a particular command or module. |
load | Load a file containing drozer commands, and execute them in sequence. |
module | Find and install additional drozer modules from the Internet. |
permissions | Display a list of the permissions granted to the drozer Agent. |
set | Store a value in a variable that will be passed as an environment variable to any Linux shells spawned by drozer. |
unset | Remove a named variable that drozer passes to any Linux shells that it spawns. |
License
drozer is released under a 3-clause BSD License. See LICENSE for full details.
Contacting the Project
drozer is Open Source software, made great by contributions from the community.
For full source code, to report bugs, suggest features and contribute patches please see our Github project:
https://github.com/ReversecLabs/drozer
Bug reports, feature requests, comments and questions can be submitted here.
Top Related Projects
The Leading Security Assessment Framework for Android.
The Leading Security Assessment Framework for Android.
A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.
Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
Tool to look for several security related Android application vulnerabilities
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot