There are many different types of malicious code, but two common categories are viruses and worms. A virus is a type of malware that is designed to replicate itself and spread to other computers by attaching itself to a host program or file. A worm, on the other hand, is a standalone program that can replicate itself and spread to other computers without needing to attach itself to a host program or file. Other common types of malicious code include Trojans, ransomware, and spyware.