Use this when malware infects files and spreads when they run.
Virus
A virus is malware that attaches to files or programs and spreads when they are run or shared. Classic file infectors are less common today than trojans and worms.
1. A virus attaches to files and spreads when they run.
2. Rare today versus other malware.
3. Signatures catch most.
4. Reimage infected systems.
5. Scan removable media.
infected file executed → infects other files
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Infection vectors Narrow the fault
| Vector | Notes |
|---|---|
| Executable files | Classic file infectors |
| Macros | Office documents (blocked from internet by default) |
| Boot sector | Old, revived by bootkits |
| Scripts | VBS, JS, PowerShell |
True file-infecting viruses are rare today; most "viruses" in reports are trojans or worms.
Step 2 Common mistakes Narrow the fault
- Relying only on signatures.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Viruses attach to files and spread when those files run.
- They spread through shared files and media.
- Classic viruses are less common than trojans today.
- AV/EDR detections of file infectors — virus
Get-MpThreatDetection— Defender detections- Clean reimage procedure — recovery
ReferenceWhy it matters1 section · depth on demand
Virus vs worm vs trojan
| Virus | Worm | Trojan | |
|---|---|---|---|
| Spreads by | Infecting files, needs user action | Itself over networks | User installs it |
| Needs a host file | Yes | No | No (is the program) |
| Example | Macro viruses | WannaCry | Fake installers, RATs |
Classic file infectors are rare today; macro and script-based malware and trojans dominate. Defences: EDR, application control, blocking macros from the internet.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A computer virus is malware that attaches itself to legitimate files or programs and spreads when they are executed or shared. Classic file-infecting viruses are less common today than other malware types, but the term is still used broadly for malicious code.
Defences:
| Control | Effect |
|---|---|
| Antimalware with real-time scanning | Detects infected files |
| Application control | Prevents unknown executables running |
| No local admin rights | Limits system file infection |
| Software from trusted sources only | Avoids infected installers |
| Backups | Recovery from damaged files |
Macro viruses in Office documents were common historically; blocking macros from the internet (default in current Microsoft 365) removes most of that vector.
Defences
- Up-to-date EDR/antivirus with behaviour detection.
- Application allow-listing (AppLocker, WDAC) on servers and kiosks.
- Block macros from the internet (Office default since 2022).
- Scan removable media; disable AutoRun.
- Restore infected systems from clean images rather than cleaning in place.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Malware → Virus. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://attack.mitre.org/techniques/enterprise/ · confidence 94%