Three examples of malicious code are viruses, spyware, and Trojan Horses. A virus is a program designed to cause damage or steal information. Spyware secretly gathers information about a person’s activity. A Trojan Horse disguises itself as legitimate software to gain access to systems.