base on The Leading Security Assessment Framework for Android. # 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](https://labs.reversec.com/tools/drozer/) ## 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](https://hub.docker.com/r/drozerdocker/drozer). * Instructions on building your own Docker container can be found [here](https://github.com/ReversecLabs/drozer/tree/develop/docker). ## Manual Building and Installation ### Software pre-requisites 1. [Python3.8](https://www.python.org/downloads/) 2. [Protobuf](https://pypi.python.org/pypi/protobuf) 4.25.2 or greater 3. [Pyopenssl](https://pypi.python.org/pypi/pyOpenSSL) 22.0.0 or greater 4. [Twisted](https://pypi.python.org/pypi/Twisted) 18.9.0 or greater 4. [Distro](https://pypi.org/project/distro/) 1.8.0 or greater 5. [Java Development Kit](https://adoptopenjdk.net/releases.html) 11 or greater ### Installing You can use `pip` or `pipx` (preferably, if available) to install the latest release of drozer from PyPI: ```shell pipx install drozer ``` Alternatively, you can download individual [releases](https://github.com/ReversecLabs/drozer/releases/) from GitHub and run: ```shell pipx install ./drozer-*.whl ``` If you haven't already, consider running: ```shell pipx ensurepath ``` to ensure `pipx`-installed packages appear in your `PATH` ## Building To build drozer from source you can run. ```shell 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:** ```shell export ANDROID_SDK=/home/drozerUser/Android/Sdk/platforms/android-34/android.jar ``` **Windows - PowerShell:** ```powershell New-Item -Path Env:\ANDROID_SDK -Value 'C:\Users\drozerUser\AppData\Local\Android\sdk\platforms\android-34\android.jar' ``` **Windows - cmd:** ```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](https://github.com/ReversecLabs/drozer-agent/releases/latest). ```shell 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 ```shell 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) ```shell 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](https://github.com/ReversecLabs/drozer/issues). ", Assign "at most 3 tags" to the expected json: {"id":"8966","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"