drozer icon indicating copy to clipboard operation
drozer copied to clipboard

Add support for adding byte array to extra in `app.service.send`

Open pploszczyca opened this issue 10 months ago • 4 comments

Hi guys, first of all, thanks for the awesome tool!

I encountered some problems while trying to add a byte array by --extra with app.service.send. When I reviewed the code in the ServiceBindingProxy#add_extra method, I noticed that it is currently not supported. It would be nice to include this feature in the next release. Also would be nice to add in docs supported extra types with examples, it could be easier to know what types could be used.

Once again, thanks for maintaining this project :smile:

pploszczyca avatar Apr 21 '24 17:04 pploszczyca

Hi! ByteArray extras are currently broken in 3.0.1, but some work has already been done to bring that functionality in the develop branch. This currently focuses on Activities, not Services, but porting similar logic over should not be too hard.

Have a look at https://github.com/WithSecureLabs/drozer/pull/428/commits/24262d4c1da5172968685dcea3c30c78069b9ded - once fully tested and pushed, you should be able to supply byteArray extras as UTF-8 strings, or by providing either a hex or base64 representation.

We'll try to port this across Soon™ (or, better still, see if we can avoid duplicating Intent-building logic)

cyberMilosz avatar Apr 23 '24 09:04 cyberMilosz

Great! Thanks for the quick response

pploszczyca avatar Apr 24 '24 08:04 pploszczyca

Okay, I believe I've managed to get app.service.send to use the same logic as app.activity.start and app.service.start. I was able to confirm that ByteArrays could be added to the Bundle using the same syntax as in those cases (see help intents).

I do not have an app to test bound services against -- so while I've confirmed that these Extra types are handled correctly, there may yet be more bugs in the complete flow :)

cyberMilosz avatar May 06 '24 14:05 cyberMilosz

Didn't mean to close this issue yet

I only meant to finish the pull request

Yogehi avatar May 06 '24 15:05 Yogehi