What Is a Computer Virus, and How Does It Spread? (Explained Clearly) - CompTIA Security+
What is a computer virus? Learn how it spreads, how it differs from worms, Trojans, and ransomware, and what to do if you suspect an infection.
👉 Master your Security+ skills with Pluralsight here: Pluralsight
You’ll learn what a computer virus is, how it spreads, and how it differs from worms, Trojans, and ransomware. This beginner-friendly CompTIA Security+ guide helps you interpret antivirus alerts and know what to do if you suspect an infection.
Chapters:
0:00 Intro
0:14 What makes malware a computer virus?
0:52 How does a computer virus spread?
1:37 How is a virus different from a worm, Trojan, or ransomware?
2:37 What should you do if you suspect a computer virus?
3:40 Outro
Affiliate notice: Some links may earn a commission. Thanks for your support.
- A computer virus is defined by how it replicates, not by the damage it causes. It copies itself into other files, programs, or startup code, turning them into carriers.
- Delivery, execution, and replication are separate events. Receiving an infected attachment doesn’t mean its code ran; deleting it won’t remove any copies that already spread.
- Virus, worm, Trojan, and ransomware describe different traits. A virus infects a host, a worm spreads on its own, a Trojan disguises itself as legitimate, and ransomware blocks access and demands payment. These labels can overlap.
- Quarantine doesn’t prove containment. Ask what arrived, what ran, and what spread. On a work device, stop sharing the suspicious file and report the alert to IT or security. See NIST’s malware handling guide for containment and recovery guidance.
- Reduce your risk with layered protection. Keep software updated and antivirus active, block untrusted macros, download from trusted sources, and test that you can restore your backups.
- 👉 Try Pluralsight for guided defensive labs, feedback, and practice exams that help you interpret alerts and focus your Security+ preparation.
A computer virus is a type of malware that spreads by copying itself into other files, programs, or startup code. The file or code that carries the copy is called the host. When the infected host runs, the virus can turn other files into carriers.
What makes malware a virus is how it replicates, not how much damage it causes. A virus can spread without a separate payload, an action beyond replication such as deleting files. And once a virus has infected other files, deleting the original attachment or download won’t remove those copies.
How does a computer virus spread?
An infected Word attachment illustrates three stages that are easy to confuse:
FAQ
Quick answers to the questions people usually ask about this topic.
Can you get a computer virus just by receiving an email?
Can you get a computer virus just by receiving an email?
Receiving an email with an infected attachment does not, by itself, mean your device is infected. The attachment has been delivered, but the viral code still has to run before it can infect other files. If the attachment is unexpected, verify it with the sender through a separate channel before opening it.
Does an antivirus alert mean my computer was infected?
Does an antivirus alert mean my computer was infected?
Not necessarily. Antivirus can flag a file before its code runs, and it detects other threats besides viruses. Check which file triggered the alert, what action the tool took, and whether there’s evidence that the code ran or changed other files.
Can a computer virus infect a backup?
Can a computer virus infect a backup?
Yes. A backup can contain files that were already infected when they were copied. If malware can modify a connected backup drive, files on that drive may also be affected. Before restoring, verify that the backup is clean rather than assuming the newest copy is safe. NIST’s malware handling guide covers recovery considerations.
Is an infected file safe after I move it to another device?
Is an infected file safe after I move it to another device?
No. Moving or copying a file does not remove the malicious code it contains. The code may not run on an incompatible device, but the file can still carry the virus to another device where it can run. Don’t transfer a suspicious file to another computer just to test it.
How can I tell if malware is a virus in a CompTIA Security+ scenario?
How can I tell if malware is a virus in a CompTIA Security+ scenario?
Look for evidence that the code copied itself into other files, programs, or startup code, turning them into carriers. An email attachment tells you how the malware arrived, and a ransom note tells you what it did. Neither clue alone shows that it replicated like a virus.
Where can I practice interpreting malware alerts for CompTIA Security+?
Where can I practice interpreting malware alerts for CompTIA Security+?
If you can explain the difference between a blocked attachment and evidence that code ran, try Pluralsight to apply that distinction in guided defensive labs. Use lab feedback, assessments, and practice exams to identify what to review next.
Comments
Add a comment...Pinned by @jaymayor
@jaymayor👉 Master your Security+ skills with Pluralsight here: https://www.jaymayor.com/go/security-plus
Some links may earn a commission. Thanks for your support.
