sensepost / objection

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

[bug] Why Internet Permission is required in script mode #536

Closed harshitshah4 closed 2 years ago

harshitshah4 commented 2 years ago

Describe the bug A clear and concise description of what the bug is. So when patching the apk with script it should ideally not check for injecting internet permission right ? gadget's config.json file also has interaction type as "script". My understanding is we need to inject internet permission in "listen" mode, where we need to interact with frida's gadget via cli using usb debugging.

To Reproduce Steps to reproduce the behavior:

  1. objection patchapk --script-source /path/to/script.json --gadget-config /path/to/config.json --architecture

Similar issues Please link the issues in this repository that is similar to yours.

For example: #358, #229 etc.

Expected behavior Since Frida Gadget requires to have internet permission in order to open socket, this helps debugging helps via cli, when running in "listen" mode, but since in "script" mode, we don't require internet permission, objection shouldn't try to insert or look for Internet Permission in AndroidManifest.xml. A clear and concise description of what you expected to happen.

Evidence / Logs / Screenshots After running the above command following logs are generated:

Screenshot 2022-04-07 at 5 28 32 PM

Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:

objection --debug explore

Environment (please complete the following information):

Application If possible, please attach the target application where you can reproduce this bug to the issue.

Additional context Add any other context about the problem here.

leonjza commented 2 years ago

Yeah, technically we don't need the permission for script mode, but it's not something I think we'll change now. The patcher will change soon when we rely on the Frida provided injection capability soon anyways.

harshitshah4 commented 2 years ago

@leonjza What is this capability provided by Frida? Do you mean jdwp? Wouldn't that require making the app debuggable ? Some apps might not work in that case. Since quite few apps behave different when ran in debug mode.