Viruses and worms: how self-spreading code moves and how networks contain it
A virus needs a host file or user action; a worm spreads by itself across networks. How WannaCry and NotPetya moved through SMB, which telemetry shows lateral spread, and the patching and segmentation that stop it.
Diagram
A worm outbreak in telemetry
Step 1 of 4
Entry
One host is infected through an unpatched exposed service or a user-run file.
# Entry # One host is infected through an unpatched exposed # service or a user-run file.
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Lateral scanning
- What fails
- Worms generate bursts of connections to one port across many addresses.
- Who is affected
- Every reachable host with the same weakness.
- What you would notice
- One source contacting hundreds of hosts on 445, 3389, or 22.
- What you change
- Alert on fan-out per source and port.
Flat networks
- What fails
- Without segmentation, one infection reaches everything.
- Who is affected
- The whole organization.
- What you would notice
- Workstations that can reach each other on SMB.
- What you change
- Block workstation-to-workstation SMB and RDP.
Patch gaps
- What fails
- WannaCry spread in 2017 through a flaw patched two months earlier.
- Who is affected
- Unpatched hosts.
- What you would notice
- Missing critical patches on exposed services.
- What you change
- Track patch latency for critical CVEs.
Notable outbreaks
The Morris worm (1988) showed self-propagation across the early internet. ILOVEYOU (2000) spread by email. Conficker (2008) used a Windows RPC flaw and USB drives. WannaCry and NotPetya (2017) used the EternalBlue SMB exploit; NotPetya also reused stolen credentials, which patching alone does not stop.
Check yourself
Recognition and the fix. Nothing here is a procedure.
What distinguishes a worm from a virus?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.