Forum Thread: How to Autorun Android Command Through Shell in Meterpreter?

I've been at this for days to no avail, I'm having issues with automating persistence within android on connection of a meterpreter session.

I've been playing around with the information at this link https://offensiveinfosec.wordpress.com/tag/autorunscript/, quite successfully I might add. however, the issue arises when I try to drop in to a shell and run commands on that shell within android.

The target is to upload a .sh file on connection, drop to a shell and then execute this command. The automation gets as far as "shell 1 process created" then ends. It's driving me up the wall.

Here is what I have written in my command file;

cd /
cd /sdcard/download
upload /root/Desktop/AndroidAutorun/Dn30.sh
shell
cd /
cd /sdcard/Download
sh Dn30.sh

As I mentioned, it executes flawlessly until shell, then nothing happens.

I'm relatively new to linux commands and am learning as I go along, please forgive me if its unbelievably obvious. Does anybody have any idea what I'm missing?

Be the First to Respond

Share Your Thoughts

  • Hot
  • Active