One family, different habits
Malware, short for malicious software, is any program written to harm a computer, its data or its user. In everyday speech every infection is called a virus, but security specialists distinguish types by how they spread. That distinction matters because each one is stopped in a different way. Viruses, worms and trojans are the classic trio, described since the 1980s. They are best understood as delivery methods rather than as the damage itself. What the malicious code actually does once it arrives, whether stealing passwords, spying, encrypting files for ransom or recruiting the machine into a network of hijacked computers, is known as its payload, and the same payload can arrive by any route.
Viruses: passengers in files
A computer virus behaves like its biological namesake. It cannot live on its own; it inserts copies of itself into a host, such as a program, a boot sector or a document with built-in macros. When someone runs the infected program or opens the file, the virus activates, infects other files and may deliver its payload. It spreads when infected files are shared, once by floppy disk and now by downloads, USB drives and email attachments. The researcher Fred Cohen coined the term in the early 1980s. Brain, written in Pakistan in 1986, is often cited as the first virus for IBM-compatible personal computers. Pure file-infecting viruses are less common today.
Worms: self-propelled
A worm needs no host file and no human click. It is a standalone program that scans networks for machines with a particular weakness, breaks in and copies itself onward, so infections can multiply exponentially. In 1988 the Morris worm, released by a graduate student, slowed or crashed about 6,000 computers, roughly a tenth of the early internet. In 2000 the ILOVEYOU worm spread by email to millions of machines within days. In 2017 WannaCry combined a worm with ransomware, encrypting files on more than 200,000 computers in around 150 countries, including hospital systems. It exploited a Windows flaw for which a fix had been released two months earlier.
Trojans: the gift with a soldier inside
The trojan takes its name from the wooden horse of Greek legend, in which soldiers hid to enter the city of Troy. A trojan does not copy itself at all. It relies on deception, posing as a game, a free version of paid software, a fake invoice, a delivery-tracking app or a security update, so that the victim installs it willingly. Once running, it might open a hidden back door for an attacker, log keystrokes, steal banking details or download further malware. Because trojans exploit human trust rather than technical flaws, they are among the most common threats today, especially on phones sideloaded with apps from outside official stores.
Blended threats today
Modern attacks rarely fit neatly into one box. A phishing email may carry a trojan, which then behaves like a worm to spread through a company network, before delivering ransomware as its payload. Criminal groups sell components to one another, and nation-state operations use custom tools designed to stay hidden for years. Malware also targets more than PCs: routers, security cameras and other connected devices with weak default passwords have been hijacked by the hundreds of thousands. The old labels remain useful because they describe the moment of entry. Asking whether something arrived through a file, a network flaw or a trick usually points straight to the defence that failed.
Matching defence to threat
Each type suggests a guard. Against viruses and trojans, caution comes first: install software only from official stores or developers' own sites, be wary of unexpected attachments and links, and keep macros disabled in documents from unknown senders. Against worms, prompt updates are crucial, since most exploit flaws that already have fixes. Security software scans files and watches for suspicious behaviour, catching much that slips through, while firewalls limit which network connections are allowed. Regular backups, ideally with one copy kept offline, ensure that even a successful attack does not mean permanent loss. Organisations add staff training, because a convincing message can defeat the most sophisticated technical protection.
Sources & further reading
Figures are rounded and widely published; check the linked organisations for the latest editions. These organisations do not endorse this website.



