Malicious code can take many forms. Three types that you need to defend against are viruses, worms, and Trojans. A virus is the classic form of malware that needs to be delivered onto a device. A worm is able to replicate itself through automated processes, such as email generation with the malware hidden in an attachment. A Trojan masquerades as a desirable utility that the victim willingly downloads and activates.