Most trojans and malware are remotely controlled by opening a port in your computer, this can be a non used port number or a disguised port normally used for something else, e.g. FTP. Firewalls should protect you from applications opening undesired ports but in reality firewalls give so many warnings that it is easy for a user to mistakenly authorise a connection. Some sites like Shields Up can scan your computer online and report on open ports, this is a good way to test your firewall quality, CloseTheDoor could be used to detect malware after an online port scanner comparing results to make sure that nothing awkward is going on.
This lightweight open source network tool will help you detect computer backdoors if they already exist, and prevent remote attacks on your machine, CloseTheDoor will listen on UDP/TCP ports in IPv4 and IPv6 and list what programs are associated with each connection displaying the listening port, protocol, PID and associated service, a right click on one of the connections gives the choice to locate the executable file that has opened the port and terminate the process or search Wikipedia and Google for more information on what the process does.