Security Basics
Types of Malware Explained
Beginner · Concept · 6 min read · Updated October 30, 2026
Malware is short for "malicious software". It is any program built to do something its owner did not agree to: steal information, damage files, spy on activity, or give someone else control of the device. The FTC describes it as harmful software installed on your device without your knowledge.
Names such as virus, worm and trojan are often used as if they mean the same thing, and they do not. Each describes a different behavior. Knowing the difference helps you understand security news, read an alert from your protection software, and decide what to do. This entry is a field guide to the main types, how they get onto devices, and the signs that something is wrong.
Why the type matters
Think of the difference between a burglar who picks a lock, one who walks in with a fake delivery uniform, and one who copies your keys and waits. The goal may be the same, but the way in, and the way to stop them, differs.
Malware types are classed by what they do and how they spread. Real programs often combine features. A single piece of malware might arrive disguised as a harmless file, steal passwords, and then add your device to a network of controlled machines. So treat the categories below as useful labels, not strict boxes.
The main types
| Type | What it does | How it typically spreads |
|---|---|---|
| Virus | Attaches itself to files or programs and damages or changes them | Runs when you open the infected file |
| Worm | Copies itself from one computer to another without help from the user | Across networks, through weak spots in software |
| Trojan | Pretends to be useful software while hiding harmful code | Free downloads, fake apps, disguised attachments |
| Ransomware | Locks files and demands payment to restore access | Phishing messages, unpatched software, stolen sign-ins |
| Spyware | Quietly watches activity and collects information | Bundled with other software or installed by trickery |
| Adware | Shows unwanted ads, sometimes redirecting your browser | Free software bundles and shady sites |
| Keylogger | Records what you type, such as passwords | Usually part of spyware or a trojan |
| Rootkit | Hides other malware so it is hard to find | Installed after another break-in |
| Bot | Lets a remote controller use your device with others in a group | Any of the routes above |
Viruses and worms
A virus needs you to help it. CISA explains that viruses damage or destroy files and spread through infected removable media, malicious email attachments and malicious web pages. A worm is like a virus, but it spreads on its own from computer to computer. Because it multiplies without anyone clicking, it can use up a system's resources until the machine stops responding.
Trojans
A trojan, named after the wooden horse in the old story, hides inside something that looks welcome. CISA notes that trojans often sit inside free software that appears legitimate. You choose to install it, which is exactly why it works. The tell-tale sign is a program that asks for more access than its job would need.
Ransomware
The CISA ransomware guide defines ransomware as a form of malware designed to encrypt files on a device, making them and the systems that rely on them unusable. The attacker then demands payment for the key. Some groups also steal the data first and threaten to publish it. Having a separate backup is the main practical defense, and the 3-2-1 backup rule explains how to build one.
Spyware, adware and keyloggers
The FTC lists spyware among the common types, and says criminals use malware to steal usernames, passwords, and bank details, to show unwanted ads, and to make a device more open to further infections. A keylogger is a form of spyware that records keystrokes. Adware is the milder end of this group, but it can still slow a device and lead to harmful sites.
Rootkits and bots
A rootkit is built to conceal. It hides files, processes or other malware from the system and from scanning tools. A bot is a device that obeys a remote controller. A large group of infected devices working together is called a botnet. The owner of an infected device usually notices nothing, except perhaps a slower connection.
How malware gets onto a device
Malware does not appear by itself. It needs a way in. CISA lists the first four routes below, and they match what the FTC advises people to avoid. The fifth is a common route that this entry adds:
- Removable media, such as an infected USB drive.
- Opening an email attachment or clicking a link in a message.
- Visiting a malicious website.
- Installing free software that is not what it claims to be.
- Opening a booby-trapped file, such as a document or PDF, in a program that has an unfixed flaw.
Many of these start with a trick on a person, which is why phishing messages and malware travel together. The fifth route depends on out-of-date software, covered in why updates matter.
Signs of a possible infection
No single sign proves anything, and some infections show none. The FTC lists these common warning signs:
- The device slows down, freezes or crashes more than usual.
- Your home page changes, or you are redirected to unexpected sites.
- New toolbars or add-ons appear.
- Pop-up ads show up often, even on sites that normally have none.
- Error messages from the operating system repeat.
- System tools, such as the task manager, stop working.
- Friends receive emails or posts from you that you did not write.
If several appear together, take them seriously. A single slow day probably means nothing.
What to do if you suspect malware
Stay calm and work through the list. It follows FTC and CISA advice:
- Stop signing in to banking, shopping and other important accounts on that device.
- Disconnect the device from the internet if you can. CISA's ransomware guide advises isolating affected systems.
- Update your security software, or install a reputable one, and run a full scan.
- From a different, clean device, change your passwords, and turn on two-factor authentication.
- If the device belongs to work, tell your IT team straight away.
- If you cannot clean the device, ask the manufacturer, a trusted technician or your IT team.
- In the United States, report scams and malware ads to ReportFraud.ftc.gov.
Common mistakes
- Calling everything a virus. The wrong name leads to the wrong response. A ransomware attack and a nuisance adware problem call for different steps.
- Thinking only one operating system gets malware. Any system can be affected. Some are targeted more than others, but none is exempt.
- Trusting security software to catch everything. It helps a lot, but it is one layer. No tool finds every threat.
- Installing software from random sites. Download from the official source of the program.
- Calling a number on a pop-up. Fake "your computer is infected" alerts often send you to a scammer posing as support. The FTC lists these among the ways infections begin.
- Ignoring early signs. Waiting lets the problem grow and gives time for passwords to be used elsewhere.
FAQ
What is the difference between a virus and malware?
Malware is the whole family. A virus is one member of it, a program that attaches to files and spreads when they are opened.
Can my phone get malware?
Yes. Phones can be affected through fake apps, malicious links and unpatched software. Install apps from the official store, keep the system updated and be careful with permissions.
Is ransomware the same as a virus?
No. Ransomware is defined by what it does, which is locking files for payment. It can arrive through several routes, including phishing.
Do I need antivirus software?
The FTC and CISA both advise using security software and keeping it updated. Choose one that comes from a reputable source, and remember it complements careful habits and does not replace them.
Where should I start with protection?
Keep devices updated, use a unique password for each account, and keep a separate backup. The Security Basics area covers each of these.
Sources
- Protecting Against Malicious Code (opens in a new tab) — CISA (Cybersecurity and Infrastructure Security Agency)
- Malware: How to Protect Against, Detect, and Remove It (opens in a new tab) — U.S. Federal Trade Commission (FTC)
- #StopRansomware Guide (opens in a new tab) — CISA (Cybersecurity and Infrastructure Security Agency). Source for the definition of ransomware
Next in Security Basics: Encryption Basics: What It Protects and What It Does Not