According to this article on Wikipedia, a trojan horse can allow a remote connection by opening a random port if it is able to bypass the firewall. I'm not much of an expert of routers and Network Address Translation but if a trojan horse opens a connection through the firewall, how does this allow the owner of the trojan who is on another network to connect to the victim computer since the victim computer IP is private and can't be connected to.
Example scenario A trojan horse opens a random port 1234 on the victim computer when ran and assume that it bypasses firewall. How is the attacker able to connect to the victim computer remotely.
Victim computer has private IP 192.168.1.147 and public IP 10.1.1.44 and attacker has private IP 192.168.0.119 and public IP 10.2.1.54, how do the two computers communicate with each other?
Assuming that victim computer has a listener on port 1234 and attacker has connector that connects to port 1234 and takes IP of victim. What IP would the attacker use? Would it be the public IP or the private IP?