WithSecureLabs/drozer-agent

Start Server using adb

JoelPagliuca opened this issue ยท 5 comments

Just found this Docker image -> https://hub.docker.com/r/tracer0tong/android-emulator/
I'm super keen to combine this with the Drozer Docker image over docker-compose.
Current issue I'm having is not being able to start the server without a gui on the Android emulator.

Obviously exposing MainActivity.startServer() over a broadcast receiver for all builds is bad security practise, so could we possibly get a build option that exposes this server? or has it automatically start?

Hi @JoelPagliuca at the moment we don't have a build that meets your requirements. However, you are free to modify drozer-agent to suit your needs.
PRs are most welcome.

Alternatively if you're pressed for time, I can think of a very hacky way of solving this:

  1. Launch the Activity using am (Activity Manager)
  2. Use /system/bin/input to generate a touch event to launch the server.

I thought I'd end up going down this path.
Thanks for getting back to me, might see a PR from me in the future

Hey @JoelPagliuca, I revisited this issue and it turns out there is a way to launch the server. The following command should help you launch the server:

am startservice -n com.mwr.dz/.services.ServerService -c com.mwr.dz.START_EMBEDDED

Ah too easy, I'll switch to that then. Thanks mate

Hey, I'm looking at doing the above for a jenkins job - I apologise if this is an obvious question - but how can i get around this?

$  adb shell am startservice -n com.mwr.dz/.services.ServerService -c com.mwr.dz.START_EMBEDDED
Starting service: Intent { cat=[com.mwr.dz.START_EMBEDDED] cmp=com.mwr.dz/.services.ServerService }
Error: Requires permission not exported from uid 10087