I will use android/browser/webview_addjavascriptinterface to pwn an Android target, but I want to execute a command before the victim falls in the exploit. I want to install an APK file on the victim machine automatically.

closed as unclear what you're asking by forest, Peter Harmann, Tom K., Overmind, multithr3at3d May 8 '18 at 15:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Your title does not match the question in the post. What you have said in the post is that you want to execute a command before exploitation (impossible). Your title asks how to execute a command before meterpreter executes a network connection (a trivial task). Which question do you want an answer to? – schroeder May 4 '18 at 9:29
  • The answer to your title is to simply write a script as a payload that installs the APK and then runs meterpreter, or configure meterpreter with pre-defined commands, which include installing the APK. – schroeder May 4 '18 at 9:31

I think we need to step back to the basics here for this question. The vulnerable software is exploited in order to execute arbitrary code. What you are asking is how to execute commands before you're able to execute your commands. This is simply not possible.

Not the answer you're looking for? Browse other questions tagged or ask your own question.