I have a problem that when I try to open multi handler in msfconsole to exploit android, the sessions are not showing. But when I connect both PC and android to the same wifi, then the sessions are showing.
Can anyone help with it?
I have a problem that when I try to open multi handler in msfconsole to exploit android, the sessions are not showing. But when I connect both PC and android to the same wifi, then the sessions are showing.
Can anyone help with it?
The problem is routing.
There are basically 2 classes of IP addresses: public and private.
Public ones are, well, public. They can be reached by anyone, from any part of the world (unless a firewall is in the way). That's why someone in Italy can connect to a webserver in Canada. The downside is that IPv4 addresses are limited, so not everyone can get one. IPv6 are plentiful, but not everyone uses them yet.
Private ones are local to the network. They are great for local area networks because everyone can get an address. Downside: people from one network cannot directly talk to other network. You need NAT, port forwarding, and so on.
Now, your problem: when you use meterpreter on the Android phone without connecting to the same Wifi of the computer, they are on different networks. Your phone is on the private network of the ISP, and your phone is on your local network. There's no path between them. If you connect both to the same network, they can now talk.