rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
33.89k stars 13.93k forks source link

how do android/meterpreter/reverse_tcp auto connect to the session even after rebooting, so the target no longer needs to click on the payload app #19177

Closed KeiIsSuck closed 2 months ago

KeiIsSuck commented 4 months ago

apk name : androsettings.apk (hehe)

I've looked into chatgpt but I don't quite understand I ask to chagpt: how to make android/meterpreter/reverse_tcp auto connect to the session even though the target cellphone is already in a dead/reboot

and chatgpt answered: create a shell script that will run the payload every time the device boots, chatgpt gave me the script but, I used the script given on YouTube and https://medium.com/@AhmadCyberZone.com/android-hacking-season-3-using-a-persistence-backdoor-891817f94071 :)

chatgpt script:

!/system/bin/sh

payload_path="/data/local/androsettings.apk"

if [ ! -f "$payload_path" ]; then am start --user 0 -n com.example.myapp/.MainActivity fi

and chatgpt say: After that, make sure you have created a payload with the name "androsettings.apk" and saved it in the "/data/local/" directory. Then, add the service entry to the "init.rc" file as follows:

service start_payload /system/bin/sh /data/local/backdoor.sh (backdoor.sh from medium.com) class main user root group root oneshot

If I follow these instructions correctly will the app run/connect to my session, even though the phone is dead/rebooted without the target opening or clicking the apk again?

sorry if my question doesn't weird or is wrong, I use google translate because I have trust issues with myself

if what i typed is wrong can someone fix it plz, or if there is something better can i get a solution from you :) i'm still a beginner

github-actions[bot] commented 3 months ago

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

github-actions[bot] commented 2 months ago

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.