Malware & ransomware

What Is a Computer Worm? How Worms Spread and How to Stop Them

A worm is malware that copies itself from machine to machine on its own. Here is how it spreads, the outbreaks that changed security, and the defenses that stop it.

Cysoro Security TeamPublished · 9 min read
MALWARE & RANSOMWARE Computer Worm Self-spreading malware — and how to stop it CYSORO.COM SCAN COPY
Quick answer

A computer worm is a standalone type of malware that copies itself from one computer to another across a network, usually without any user action. Unlike a virus, it needs no host file to spread. Worms exploit software flaws, weak passwords, email, or USB drives, and each infected machine starts hunting for the next victim, so one infection can become thousands within hours.

Key takeaways

  • A worm is self-replicating malware: it copies itself across networks without a host file and often without any click from the user.
  • Worms spread through unpatched network services, weak passwords, email, and USB drives — WannaCry used an SMB flaw patched two months earlier.
  • Patching, disabling SMBv1, strong unique passwords, and network segmentation stop most worm outbreaks before they start.

Most malware waits for you to open it. A computer worm does not. Once it lands on one machine, it starts scanning for the next one by itself — and the next, and the next. That is why a single unpatched computer has, more than once, turned into a global outbreak in a single day.

What is a computer worm?

A computer worm is a standalone program that copies itself from one computer to another over a network, with no host file and usually no user action. Self-replication is the defining trait: the worm is its own delivery mechanism.

Unlike a virus, which attaches itself to an existing file and spreads when that file is opened or shared, a worm is a complete program on its own. Once it runs on a host, it immediately looks for new targets, copies itself across, and runs the copy — which then scans again.

The name comes from the idea of a creature that burrows through a system on its own. The term entered wide use after 1988, when the Morris worm infected an estimated 6,000 systems on the early internet, an event that directly prompted the formation of the CERT Coordination Center at Carnegie Mellon University.

Worms also differ from Trojans. A Trojan pretends to be legitimate software and needs you to install it; a worm needs no invitation once it finds a way in.

And a worm is not a payload by itself — many worms carry one, such as ransomware, spyware, or a botnet agent. WannaCry, for example, was ransomware that spread as a worm: the worm was the delivery van, the encryption was the cargo.

How does a computer worm spread?

A worm spreads by repeating four steps on every machine it infects: land, scan, copy across, and run the copy. Because each new copy runs the same loop in parallel, infections grow exponentially rather than one at a time.

How one worm infection becomes thousands 1 Land exploit, attachment, USB drive or share 2 Scan sweep the network for vulnerable targets 3 Copy across replicate itself onto the next host 4 Run and repeat the copy scans again and fires its payload SQL Slammer doubled roughly every 8.5 seconds and infected most vulnerable hosts in about ten minutes.
The worm replication loop — every infected host becomes a new source of infection. Illustration by Cysoro.

The most common ways in are:

  • Network vulnerabilities. The fastest and most dangerous route. The worm carries an exploit for a flaw in a network-facing service and uses it to land on any reachable, unpatched host. This is how SQL Slammer, Conficker, and WannaCry moved.
  • Weak or default passwords. The Mirai worm logged in to cameras and routers with the passwords they shipped with. CISA's alert TA16-288A says Mirai tried a short list of 62 common default username and password pairs.
  • Email and messaging. Email worms mail themselves to every address they can harvest, usually from the victim's own address book, so the message arrives from a known contact.
  • Removable media. Stuxnet spread through infected USB drives, and later worms such as Raspberry Robin hid behind a shortcut that looks like an ordinary folder.
  • File sharing and software supply chains. Some worms disguise themselves as legitimate content on peer-to-peer networks, while newer ones spread through developer tools such as package registries and code editor extensions.

Speed is what makes worms different from other malware. The Slammer worm doubled roughly every 8.5 seconds in January 2003 and reached more than 90% of the servers it could infect within ten minutes, according to CAIDA measurements. WannaCry spread to more than 150 countries within 24 hours.

Computer worm vs virus vs Trojan: what's the difference?

Worm, virus, and Trojan describe different things, and the difference tells you how an infection spreads. Worm describes how malware travels on its own, virus describes malware that attaches to a host file, and Trojan describes malware disguised as something legitimate.

WormVirusTrojan
Spreads by itselfYes — copies itself to other machinesNo — needs the host file to be sharedNo — needs you to install it
Needs a host fileNo, standalone programYes, attaches to filesNo, but needs a download
Needs user actionUsually not, after the first infectionYes, someone must run the fileYes, someone must install it
Typical examplesWannaCry, Slammer, MorrisFile infectors, macro virusesFake installers, remote access tools
Main dangerSpeed — whole networks fall fastSpreads with shared filesQuiet, long-term access

The labels also overlap. One piece of malware can be a worm and ransomware at the same time, or a Trojan that later downloads a worm. When you read a report, ask two questions: how did it spread, and what did it do once it was in?

What are the most famous computer worms?

Each major worm outbreak taught the industry something it then had to patch. These are the cases every defender should know.

Six worms that changed how networks are defended 1988Morris~6,000 hosts 2000ILOVEYOUemail worm 2003Slammer10 minutes 2010StuxnetUSB spread 2016MiraiIoT botnet 2017WannaCry150+ countries The pattern in every case Each worm used a hole that could have been closed beforehand: an unpatched flaw, a default password, or a trusted file nobody checked. Patching and passwords are the fix, not luck.
Famous worm outbreaks, 1988–2017. Illustration by Cysoro.

Morris worm (1988)

Released on November 2, 1988 by Cornell graduate student Robert Tappan Morris, it exploited bugs in Unix mail and finger programs and guessed weak passwords. It infected roughly 6,000 of the 60,000 computers then online — about 10% of the internet.

It replicated so aggressively that machines were infected more than once, slowing them until they became unusable. Morris became the first person convicted under the US Computer Fraud and Abuse Act of 1986.

ILOVEYOU (2000)

ILOVEYOU arrived as an email attachment with the subject line "ILOVEYOU" and spread by mailing itself to everyone in the victim's address book. It showed how social engineering could turn a worm into a global event overnight, and it pushed companies to start blocking dangerous attachment types at the mail gateway.

SQL Slammer (2003)

Slammer exploited a flaw in Microsoft SQL Server and became the fastest-spreading worm ever recorded, doubling about every 8.5 seconds. It took down large parts of the internet's infrastructure within minutes, including bank ATM networks and airline booking systems.

Stuxnet (2010)

Stuxnet spread through infected USB drives and targeted industrial control systems, specifically centrifuges used in Iran's nuclear program. It proved worms could jump air gaps and cause physical damage, and it changed how critical infrastructure thinks about removable media.

Mirai (2016)

Mirai turned cameras, routers, and DVRs into a botnet by logging in with factory-default passwords. CISA's alert TA16-288A records that it powered a DDoS attack of more than 620 Gbps against the Krebs on Security website in September 2016, one of the largest on record at the time.

WannaCry (2017)

WannaCry was the most damaging worm of the modern era. On May 12, 2017 it spread across more than 150 countries, encrypting files on Windows computers that had not installed Microsoft's MS17-010 security update, published two months earlier on March 14, 2017.

It moved through the SMBv1 file-sharing protocol using the leaked EternalBlue exploit. Microsoft rated the MS17-010 flaw Critical because a specially crafted message to an SMBv1 server could allow remote code execution. CISA's alert TA17-132A notes the ransom demand was about $300 in bitcoin, and the software could run in as many as 27 languages.

The outbreak was slowed within hours when a researcher registered a domain the malware checked before running, which acted as a kill switch. The US government later attributed the attack to North Korea's Lazarus Group, which MITRE lists as a user of the WannaCry malware.

What damage can a computer worm do?

A worm's damage depends on its payload, but the spread itself is often the first harm: infected machines slow down, networks flood with scanning traffic, and services fall over under the load.

  • Ransomware. WannaCry encrypted files on hundreds of thousands of machines and disrupted hospitals, banks, and shipping companies, including the UK's National Health Service.
  • Data theft and spying. Some worms steal credentials, log keystrokes, or open a backdoor for later access.
  • Botnets. Mirai turned infected cameras and routers into a weapon for DDoS attacks, so the victims' devices attacked someone else.
  • Physical damage. Stuxnet damaged industrial equipment, proving a worm can cross from code into the physical world.
  • Denial of service. Even a worm with no payload can take a network down simply by replicating so fast that nothing else gets through.

For a small business, the realistic costs are downtime, lost data, and recovery work. A worm on one office PC can reach every unpatched machine on the same network, which is why our guide to securing your Wi-Fi network matters as much as antivirus.

How do you know if your computer has a worm?

Worms try to stay quiet, but the replication loop leaves traces. Watch for several of these signs together rather than any single one.

  • Sudden slowness or crashes. The machine is busy scanning and copying, so normal work crawls or programs close unexpectedly.
  • Unexplained network traffic. The router lights blink constantly, or your connection slows even when nobody is streaming or downloading.
  • Files appearing, changing, or disappearing. New files in strange places, renamed documents, or missing files can signal a worm payload at work.
  • Security tools disabled. Antivirus that switches itself off, or Windows Defender settings you did not change, is a strong warning sign.
  • Strange emails sent from your account. Contacts report messages you never sent, often with attachments — the classic email worm signature.
  • Unknown processes or high CPU use. A process you do not recognize consuming most of the CPU, especially at idle, deserves investigation.

If you see these signs, treat the machine as infected: disconnect it from the network first, then investigate. Staying connected lets the worm keep spreading while you look.

How do you remove a computer worm?

Removal is a sequence, not a single scan. Do it in order, because a worm that is still running will fight the cleanup.

  1. Disconnect the device from Wi-Fi and wired networks immediately, and unplug any USB drives.
  2. Boot into Safe Mode so the worm's startup entries do not load.
  3. Run a full antivirus and anti-malware scan from a reputable vendor, and let it quarantine or delete what it finds.
  4. Check for persistence. Look at startup programs, scheduled tasks, and browser extensions for anything you do not recognize, and remove it.
  5. Patch the flaw that let it in. Install all operating system and application updates before reconnecting.
  6. Change passwords for email, banking, and any account used on the infected machine, from a clean device.
  7. Reconnect and watch. Monitor network traffic for a day or two. If the infection returns, back up your files and reinstall the operating system — it is faster and safer than a second cleanup attempt.

If the machine holds business data, tell your IT team or managed provider before you start, and check whether other machines on the same network show the same signs. A worm rarely infects just one device.

How do you prevent worm infections?

Worms exploit gaps that are mostly closable with basic hygiene. These five controls stop nearly every historical worm outbreak.

Five defenses that stop worms 1 Patch fastinstall security updates within days, not months — WannaCry's patch was two months old 2 Disable SMBv1 and old protocolsturn off legacy services nothing on your network still needs 3 Strong, unique passwordschange every default password; use a password manager, never reuse one 4 Segment your networkkeep IoT devices and guests off the network your PCs use 5 Back up offlineregular backups you can restore from make ransomware toothless
Defense in depth against worms — patching alone would have stopped WannaCry. Illustration by Cysoro.

Patch quickly and automatically. Turn on automatic updates for the operating system and applications. WannaCry's victims had two months to install MS17-010 and had not done so.

Disable SMBv1 and other legacy protocols. If nothing on your network needs SMBv1, turn it off in Windows Features. The same goes for old services such as Telnet and FTP on routers and cameras.

Change every default password. Routers, cameras, printers, and network storage all ship with defaults that are published online. Give each its own long password, stored in a password manager.

Segment your network. Put smart devices and guest Wi-Fi on a separate network from your computers. A worm that lands on a camera should not be able to reach your work PC.

Block suspicious attachments and scan USB drives. Configure email to block executable attachments, and scan every USB stick before opening files from it. If you suspect your phone was the entry point, see our guide on how to know if your phone is hacked.

Keep offline backups. A backup that a worm cannot reach is the fastest recovery from any ransomware-carrying worm.

The bottom line

A computer worm is dangerous because it does the attacker's work for them: one unpatched machine becomes a thousand. The good news is that the defenses are the same ones that stop most malware — patch fast, kill legacy protocols, use strong unique passwords, and keep networks segmented.

Start with the basics today: check for pending updates, disable SMBv1 if you do not need it, and change any device still using its factory password. Our small business cybersecurity checklist walks through these controls alongside backups and device security.

Frequently asked questions

What is a computer worm in simple terms?

A computer worm is malware that copies itself from one computer to another over a network, on its own. Once it infects one machine, that machine starts looking for the next victim, so infections spread fast without anyone clicking anything.

What is the difference between a worm and a virus?

A virus attaches itself to a host file and spreads when that file is opened or shared. A worm is a standalone program that copies itself across networks without a host file and usually without any user action.

Can a computer worm spread without the internet?

Yes. Worms can spread through local networks, shared drives, and USB sticks. Stuxnet famously spread through infected USB drives to reach systems that were not connected to the internet.

Is WannaCry a worm or ransomware?

It is both. WannaCry is ransomware that encrypts files and demands payment, and it spreads using a worm component that exploits the SMBv1 flaw to move from machine to machine on its own.

Can antivirus remove a computer worm?

Usually yes, if you disconnect the machine from the network first, run a full scan in Safe Mode, and then patch the flaw that let the worm in. If the infection keeps returning, back up your files and reinstall the operating system.

Are computer worms still a threat in 2026?

Yes. The techniques are the same, and unpatched services, default passwords, and flat networks still exist everywhere. Modern worms also spread through cloud credentials, USB drives, and software supply chains.

What is the fastest spreading worm ever?

SQL Slammer, from January 2003, doubled roughly every 8.5 seconds and infected more than 90 percent of the vulnerable servers it could reach within about ten minutes.

Sources

  1. CISA — Indicators Associated With WannaCry Ransomware (TA17-132A)
  2. MITRE ATT&CK — WannaCry, Software S0366
  3. Microsoft — Security Bulletin MS17-010, Critical
  4. CISA — Heightened DDoS Threat Posed by Mirai and Other Botnets (TA16-288A)
  5. TechTarget — What is a computer worm?
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against CISA alerts TA17-132A and TA16-288A, MITRE ATT&CK S0366 and Microsoft Security Bulletin MS17-010.

How we write and fact-check →

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free