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.
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.
Start your morning with the signal that matters.
Weekday mornings. Five minutes. What changed in security, why it matters.
By subscribing you agree to our Privacy Policy.
Free. Weekday mornings. 5 minutes or less.
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:
- 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.
Start your morning with the signal that matters.
Weekday mornings. Five minutes. What changed in security, why it matters.
By subscribing you agree to our Privacy Policy.
Free. Weekday mornings. 5 minutes or less.
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.
How to Lower Your Cyber Insurance Premiums in 2027
A costly cyber insurance renewal doesn't have to mean cutting coverage. These strategies give insurers clear evidence of lower risk, from ISO...
Network Security Certifications (2026): Network+, CCNA, CCNP Security, Fortinet NSE, Palo Alto and GCIA
Network security certifications compared: Network+, CCNA, CCNP Security, Fortinet NSE 4 (formerly FCP), the Palo Alto Networks certs that replaced PCNSA and...
CompTIA Cybersecurity Certifications (2026): The Path From A+ and Network+ to Security+, CySA+, PenTest+ and SecurityX
CompTIA's cybersecurity certifications in order, from A+ and Network+ to Security+ V7 and V8, CySA+, PenTest+ and SecurityX, plus the new SecAI+...
Friday’s brief: Apache’s HTTP/2 fix, then Check Point break-ins, a ScreenConnect add-on and a GitHub secret stealer
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.
Free. Weekdays. Built for operators.