What are the different types of malware?

Definition

Types of malware are the main kinds of software built to gain unauthorised access, steal data or cause damage: viruses, worms, Trojan horses, ransomware and spyware. They differ in how they spread and what they do.

Full glossary
Category
Attacks
Also called
malware types, kinds of malware
Last updated

CISA describes malware as any software used to get unauthorised access to IT systems so it can steal data, disrupt services or damage networks. CISA's guidance names these types most often.

Virus: A virus infects files or system areas, then makes copies of itself. Some are harmless, some damage data or destroy files. Unlike worms, viruses typically depend on you doing something, such as opening an email attachment or visiting a malicious web page.

Worm: A worm spreads by itself without anyone opening anything, which is why one infected device can hit a whole network quickly.

Trojan horse: A program that looks legitimate but hides a virus or other damaging program. You install it yourself, thinking it's something else.

Ransomware: Malware that locks your files or encrypts them until a payment is made. CISA's guidance says the US federal government does not support paying ransomware demands.

Spyware: Spyware collects information from a device without your consent, such as keystrokes, screenshots and passwords, and sends it to an attacker. A keylogger is one kind.

CISA's wider lists also include rootkits, bots and botnets, and adware.

How these get onto your device

Most start with something you click or install: a phishing email attachment, a fake update, a pirated app or a link in a text. Worms are the exception, because they travel between devices on their own.

Why the type matters

The type tells you what to do next. Spyware means changing every password from a clean device. Ransomware means disconnecting the device and restoring from a backup. The categories also overlap: one piece of malware can arrive as a Trojan and then act as spyware.

How to protect yourself

  1. 1

    Keep devices and apps updated

    Turn on automatic updates for your operating system, browser and apps. Many infections use flaws that updates already fix.

  2. 2

    Be careful with attachments and links

    Don't open attachments you didn't expect, even from someone you know. A phishing message is the most common way in.

  3. 3

    Install software only from official stores

    Pirated apps and fake installers are the classic Trojan delivery method.

  4. 4

    Back up your files offline

    A recent backup kept off your main device means ransomware can't hold your files hostage.

  5. 5

    Use unique passwords and two-step verification

    If spyware captures one password, unique passwords and a second step keep the damage to one account.

Serus

See where your personal data is exposed

Serus finds it on data brokers and people-search sites and removes it.

Run a free scan

Frequently asked

What is the most common type of malware?

That depends on the year and the source. Instead of ranking them, look at how they arrive: most need you to open or install something.

What is the difference between a virus and a worm?

A virus usually needs you to do something, like opening an attachment, to spread. A worm spreads on its own.

Is ransomware a virus?

It's a type of malware, not necessarily a virus. What defines it is the demand for payment to restore access to your files.

Can malware steal my personal data?

Yes. Spyware is built for that. It can collect keystrokes, screenshots and credentials without your consent.

Sources

Something wrong or out of date? Tell us and we'll re-check it.

Related terms

Full glossary

Cookie preferences

Choose which categories we may use. Full details for every cookie are in our Cookie Policy.

Strictly necessary

Authentication, session management, security and fraud prevention, and saving your consent choice. Always active. The site cannot function without them.

Functional

Remember preferences such as language and settings that improve your experience.

Analytics

Help us understand how the site is used, like pages visited, interactions, and performance, so we can improve it.

Marketing & advertising

Measure our marketing and deliver more relevant ads through partners such as Google, Meta, TikTok, X, and Reddit. Used only with your consent.

Your choice is saved for 12 months and applies across serus.ai, including the app. You can change it anytime from the cookie widget or the "Cookie settings" link in the footer. Withdrawing consent does not affect processing that happened before withdrawal.