sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.46k stars 854 forks source link

Add gadget config and script to apk patcher #329

Closed gergesh closed 4 years ago

gergesh commented 4 years ago

This adds two options to the apk patcher:

  1. Allow specifying a file to be used as gadget config
  2. Allow adding a script to be pushed into /data/app/com.example/lib/arch/libfrida-gadget.script.so

These can be used together to allow configring the gadget to load an included script instead of listening for connections, which could be useful for patching applications permanently without writing smali.

leonjza commented 4 years ago

Epic! Thanks so much, I'll test this asap. Did you have any thoughts on porting this over for iOS as well maybe?

gergesh commented 4 years ago

I don't have an iOS device to test this against but the implementation is very short, porting shouldn't take more than a couple of minutes.

gergesh commented 4 years ago

Did you get a chance to test this?

leonjza commented 4 years ago

Not yet, but chances are pretty good I'll get to this this week!

Techbrunch commented 4 years ago

If anyone wants to use it:

objection patchapk -s app.apk -c gadget -l script.js

Content of gadget:

{
  "interaction": {
    "type": "script",
    "path": "libfrida-gadget.script.so"
  }
}

@leonjza maybe this could be added to the wiki ?

leonjza commented 4 years ago

Absolutely! Need to create a ticket so that I don't forget 😊