A trojan horse is a piece of code that is designed to interfere with the regular functioning of a computer. Infections can spread out quickly and trigger significant damage to both specific computer systems and networks. Some infections are harmless, while others can erase files, corrupt data, or even damage hardware.