Short answer: a computer virus is a piece of malicious code that attaches itself to a normal file or program and copies itself when that file runs. It spreads when people open or share infected files, through email attachments, downloads, USB drives and file shares. A worm is different: it spreads across networks on its own, with no file for you to open.
A computer virus is a type of malicious software, or malware, that infects a computer, usually without the user knowing. A true virus attaches itself to other files or programs and spreads when those files are shared, for example through email attachments, messaging apps or file sharing.
Viruses and other malware come in many forms. Some only copy themselves and spread. Others have a specific goal, such as stealing passwords or changing system settings.
A trojan is a different kind of malware. See what a trojan horse is and how it spreads.
Reading an older article? Use the brief to stay current.
Get the free 5-minute weekday brief
Scam alerts you can act on, major breaches, and our free Scam Survival Kit (PDF). Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
Viruses need a host file to spread, but worms do not. See what a computer worm is and how it spreads.
Wondering what software you actually need to protect against threats like this? See anti-malware vs antivirus.
Email attachments are one of the most common ways viruses spread. A virus may be disguised as a normal file, like a document or a photo, and sent to many people at once. Be careful with attachments, especially ones you were not expecting, even if they seem to come from someone you know.
Messaging apps and file sharing are also common routes. Peer-to-peer networks are especially risky. People often download files from them without checking what they are, and pirated software is a favorite place to hide malware.
People often use “virus” for any kind of malware. Common types include:
Reading an older article? Use the brief to stay current.
Get the free 5-minute weekday brief
Scam alerts you can act on, major breaches, and our free Scam Survival Kit (PDF). Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
- Trojan horses: Named after the wooden horse in the Greek myth, Trojans pretend to be useful software so people install them. Once running, a Trojan can give an attacker remote access to the computer, letting them steal passwords or take control of the system.
- Worms: Unlike viruses, which need a host file to spread, worms are self-contained. They copy themselves across networks on their own by exploiting flaws in software or operating systems.
- Ransomware: Ransomware encrypts a victim’s files and demands payment for the key. Many gangs also steal the files first and threaten to publish them if the victim does not pay.
- Adware: Adware shows unwanted ads on the computer. It often comes bundled with free software and can be hard to remove.
To protect yourself, use up-to-date antivirus software. Be careful about what you download and what attachments you open, and avoid sketchy websites.
A few other habits help a lot:
- Keep software and operating systems up to date: Updates fix flaws that malware could use to get in.
- Use a firewall: A firewall blocks unwanted connections and can be set to stop suspicious traffic.
- Use strong passwords: Strong, unique passwords make it harder for attackers to get into your accounts and devices.
- Back up data regularly: Backups mean you can recover your files if malware destroys or locks them.
Computer viruses and other malware can cause a lot of trouble, from slow computers to stolen bank details. The basics go a long way. Use antivirus software, keep things updated and think before you click. Do those three things and your risk drops sharply.
Newer CyberExperts coverage on this topic
This article still works as background. If you want the current picture, start with the freshest related coverage below and today's brief.
CEH Certification Cost: Fees, Retakes and Renewal
What does the CEH certification cost? See the eligibility fee, retake rules, renewal credits and annual fee EC-Council publishes.
How to Tell If Your Phone Is Hacked
Signs your phone may be hacked, signs that are usually harmless, how to check an iPhone and an Android, what to do...
How to Opt Out of Data Broker Sites
How to opt out of data broker and people-search sites, including California's DROP tool, why it matters after a breach, and a...
Friday’s brief: Linux firewall flaw, fake Meta apps, and a UK ransom ban
The fastest way to catch up on what changed after this article was published.
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.