First off, I am no hacker or anything like that (but I like to read up on it) and this question I have for a while now.
So lets assume there is a victim and an attacker scenario. The attacker wants to install a backdoor.
1. scenario: It may be easy for the attacker to install a backdoor when he is physically at the place and has wifi access where he wants to install a backdoor. For example at a friends house. But how does he reconnect using a reverse shell ? The reverse shell, as far as I understood, connects via IP address of the machine itself. But doesn’t he need the public IP for that too?
2. scenario: What if the attacker has no access to be physically there ? Sure he somehow can get the IP address of a machine trough some sort of attack (trough email for example) but he has no idea or connection to the network itself. And even if he does, how does he remotely access the machine from a laptop while he is in another, completely different, place?