Malware & ransomware

Types of Malware: 10 Kinds Explained With Real Examples

Malware is not one thing. It is a family of malicious software — viruses, worms, trojans, ransomware, spyware and more — and each type spreads differently and needs a different response.

Cysoro Security TeamPublished · 11 min read
VIRUS TROJAN RANSOMWARE SPYWARE MALWARE & RANSOMWARE Types ofmalware 10 kinds, real examples, real fixes.
Quick answer

The main types of malware are viruses, worms, trojans, ransomware, spyware and botnets. They differ in two ways: how they spread — a virus infects files, a worm copies itself across networks, a trojan relies on you installing it — and what they do once they are in, from encrypting your files to stealing passwords or hiding quietly for months. Most attacks mix several types, so treat these categories as a vocabulary, not as boxes.

Key takeaways

  • Malware is defined by intent, not technique: any software built to harm, steal or disrupt without permission counts.
  • Ransomware is the costliest type for businesses, while spyware and infostealers are the quietest — they steal for months before anyone notices.
  • Patching, phishing-resistant MFA, endpoint protection and tested offline backups stop most malware, whatever its type.

People say "virus" when they mean any malicious software, but a virus is only one type — and often not the one that hit you. Ransomware, spyware, trojans and worms all work differently, spread differently and need a different response. Knowing which type you are dealing with is the first step to removing it.

What is malware?

Malware, short for malicious software, is any program designed to harm a device, steal data, spy on users or disrupt systems without the owner's permission. NIST's glossary defines it as software intended to perform an unauthorized process that harms the confidentiality, integrity or availability of a system.

The word describes intent, not a specific technique. A virus, a worm, a trojan and a piece of ransomware are all malware, but they spread differently and do different things once they are in. NIST's malware guide, SP 800-83 Rev. 1, warns that most real samples mix several types, so treat these categories as a vocabulary for understanding an attack rather than as neat boxes.

Malware usually arrives through one of four doors: phishing messages, malicious downloads, unpatched software, or exposed remote access. Our guide to spear phishing shows how the first door works.

The delivery-text version reaches phones every day — our FedEx scam text guide shows how those messages work and what to do with them.

The main types of malware at a glance

Every type below differs in how it spreads and what it does. This table is the quick reference; the sections after it explain each type with a real example.

TypeHow it spreadsWhat it doesCopies itself?
VirusInfects programs or documents; runs when you open themDamages files, steals data, installs more malwareYes, into files
WormExploits network services; no user action neededSpreads to other machines, often carries a payloadYes, as a standalone program
TrojanDisguised as useful software; you install itOpens a backdoor, installs other malware, steals dataNo
RansomwarePhishing, stolen passwords, exposed RDP, unpatched systemsEncrypts files and demands payment; often steals data tooNot by definition
Spyware / keyloggerBundled with other software or dropped by a trojanRecords activity or keystrokes and sends them to the attackerNo
AdwareBundled installers, third-party download sitesInjects ads, changes browser settings, tracks youNo
RootkitInstalled after another compromiseHides the attacker's presence deep in the systemNo
Backdoor / RATDropped by a trojan or loaderGives the attacker remote control of the machineNo
BotnetBuilt from infected machinesUses thousands of devices for spam, DDoS or miningVia its malware
WiperLike ransomware, but destroys instead of encryptingDeletes or corrupts data permanently; no recovery key existsNo

What is a computer virus?

A virus self-replicates by inserting copies of itself into host programs or data files, and it usually needs a user action — opening a file or running a program — to spread. NIST splits viruses into compiled viruses, which run as operating-system code, and interpreted viruses, which run inside an application.

The best-known interpreted kind is the macro virus: malicious code hidden in a document's macros that runs when the document opens. Classic file infectors attach to executables, boot sector viruses infect the code a computer runs when it starts, and multipartite viruses do both. Modern antivirus catches most classic viruses easily, which is why attackers now prefer trojans and loaders — but the virus concept survives in every piece of malware that spreads by infecting files.

What is a worm?

A worm is a self-replicating, self-contained program that usually executes itself without user intervention. That is what makes worms fast: nobody has to click anything. NIST distinguishes network service worms, which exploit a vulnerability in a network service to jump from host to host, from mass-mailing worms, which email themselves out.

The textbook example is WannaCry. In May 2017 it infected more than 200,000 systems worldwide, according to NIST's National Cybersecurity Center of Excellence, exploiting a Windows SMBv1 vulnerability for which Microsoft had released a patch two months earlier. WannaCry was both a worm and ransomware: it spread on its own like a worm and encrypted files like ransomware. Organizations that had patched or disabled SMBv1 were protected. The lesson has not changed: patch known exploited vulnerabilities quickly and block risky services at the network edge.

What is a trojan horse?

A trojan horse is self-contained and non-replicating: while appearing benign, it actually has a hidden malicious purpose. It arrives disguised as something useful — a free tool, a cracked program, a document, a software update — and the victim installs it willingly.

Once inside, a trojan usually does one of three things: it opens a backdoor so the attacker can return, it downloads and installs other malware, or it steals data directly. Trojans are the delivery method, not the payload, which is why the same trojan family can lead to ransomware one month and credential theft the next. The defense is simple in principle and hard in practice: install software only from official sources, and be suspicious of any download that asks you to disable your security software first.

What is ransomware?

Ransomware is an ever-evolving form of malware designed to encrypt files on a device, rendering them and the systems that rely on them unusable — that is CISA's definition in its #StopRansomware Guide. Modern ransomware usually adds a second threat: the attackers steal your data first, then threaten to publish it if you do not pay. This is called double extortion.

Ransomware rarely arrives alone. CISA's guide notes that many infections start with precursor dropper malware such as QakBot, Bumblebee, Emotet or Dridex, which sits quietly on a machine for days or weeks before the ransomware is deployed. QakBot shows the scale: the US Department of Justice said in August 2023 that the FBI had identified more than 700,000 infected computers, and that ransomware groups including Conti, ProLock, Egregor, REvil and Black Basta had used QakBot for initial access.

NotPetya, which struck in June 2017, is the cautionary tale about what ransomware can hide. It looked like ransomware, demanded payment and showed a ransom note — but it was actually a wiper. It encrypted the master boot record in a way that could not be reversed, so paying changed nothing. The White House later said the damage ran into the billions of dollars.

Do not pay the ransomCISA and the FBI advise against paying: it does not guarantee your files back, it funds the next attack, and in the NotPetya case there was no working decryption at all. Isolate the machine, report the incident, and restore from clean backups.

What are spyware, keyloggers and infostealers?

Spyware is software secretly installed to gather information about people or organizations without their knowledge. It hides on a device, records activity such as keystrokes, passwords, browsing and messages, and reports the data to an operator. A keylogger is the narrowest kind: it records every keystroke, which hands the attacker passwords, card numbers and messages as they are typed.

Infostealers are the modern, industrial version. They steal browser-saved passwords, session cookies, cryptocurrency wallets and autofill data, then sell the haul on criminal markets. In May 2025, Microsoft, the US Department of Justice and international partners disrupted Lumma Stealer, targeting around 2,300 domains under a court order. Lumma had been one of the most widely used infostealers, and its takedown shows how central credential theft has become to the whole malware economy.

Spyware is the quietest type of malware, and that is its danger. Ransomware announces itself within minutes; spyware can sit unnoticed for months. The signs are subtle: a laptop that runs hot, a battery that drains fast, data use that does not match what you did, and logins from places you have never been. If a password was stolen, check whether it appears in known breaches with the free pwned password checker and change it everywhere it was reused.

What about adware, rootkits, backdoors and botnets?

These four types are less famous than ransomware, but they do real damage — and they often work together in a single attack.

Adware

Adware displays unwanted ads, often as pop-ups, banners or injected links in a browser, and it usually arrives bundled with free software from third-party download sites. Some adware is merely annoying; the dangerous kind redirects your browser to unsafe sites, changes your homepage and search engine, and tracks your browsing. It is also a common first step: adware opens the door, and worse malware walks through it.

Rootkit

A rootkit is a collection of files installed on a host to alter its standard functionality in a malicious and stealthy way. It hides the attacker's activity deep in the operating system or firmware, so security software cannot see the malware it is protecting. Rootkits are usually installed after another compromise, and removing one often means reinstalling the operating system from scratch.

Backdoor and remote access trojan (RAT)

A backdoor is a hidden way back into a system that bypasses normal authentication, and a remote access trojan is malware that gives an attacker full remote control of a machine — screen, files, camera and microphone. RATs are a favorite tool for targeted attacks and for the long, quiet phase before a ransomware deployment, when the attacker explores the network and finds the backups.

Botnet

A botnet is a network of infected machines controlled remotely by one operator. Each infected device is a bot, and the operator rents the botnet out for spam, distributed denial-of-service attacks, credential stuffing and cryptomining. Your computer can be part of a botnet without you noticing anything except slightly slower performance and higher data use.

One attack, several malware types chained together 1. Phishingemail or textwith a link 2. Trojanfake documentor installer 3. Loaderdownloads thereal payload 4. Payloadspyware, thenransomware Each stage is a different type — so stopping any one stage stops the attack. Email filters stop stage 1. Patching stops stage 3. Backups defeat stage 4. QakBot, Emotet and Bumblebee are loaders: they exist to deliver the next stage.
Real attacks chain several malware types — stopping any stage stops the whole attack. Illustration by Cysoro.

What are fileless malware, wipers and cryptominers?

Three newer types do not fit the classic list, and they are increasingly common in real attacks.

  • Fileless malware: runs in memory using legitimate tools already on the machine, such as PowerShell, and leaves no file on disk for antivirus to find. It is hard to detect and usually needs behavioral monitoring to catch.
  • Wiper: destroys data instead of encrypting it. NotPetya was a wiper disguised as ransomware, and wipers are often used in politically motivated attacks where the goal is damage, not money.
  • Cryptominer: secretly uses your computer's processor to mine cryptocurrency for the attacker. The signs are a fan that never stops, a battery that drains fast, and a machine that slows to a crawl.

Loaders and droppers deserve a mention too. A loader is malware whose only job is to download and install other malware, and a dropper is a file that installs malware when it runs. QakBot, Emotet and Bumblebee all work this way, which is why CISA's ransomware response checklist tells investigators to look for precursor dropper malware before restoring from backups.

What are the signs of a malware infection?

Some malware announces itself; most does not. Look for these signs, and treat two or more together as a reason to investigate.

  • Performance: the computer is suddenly slow, the fan runs constantly, or the battery drains far faster than usual.
  • Browser changes: a new homepage or search engine, toolbars you did not install, or pop-ups on sites that never had them.
  • Strange activity: programs opening by themselves, files renamed or missing, or your mouse moving on its own.
  • Network: data use spikes, or your firewall logs connections to places you do not recognize.
  • Account alerts: logins from unfamiliar places, password reset emails you did not request, or contacts receiving messages you did not send.
  • Ransom note: files you cannot open, new file extensions, and a note demanding payment. This is ransomware, and it needs an incident response, not a virus scan.

Our guide to knowing if your phone is hacked covers the same signs for mobile devices, where malware hides even more easily.

What should you do if you have malware?

Act in this order, and do not skip the isolation step: a connected infected machine can spread malware to every device on the network.

  1. Disconnect: take the machine off the network — unplug the cable or turn off Wi-Fi — and power it down if you cannot disconnect it.
  2. Do not pay: if it is ransomware, do not pay. Report it to CISA or the FBI's Internet Crime Complaint Center, and follow the CISA ransomware response checklist.
  3. Scan: run a full scan with your endpoint protection, and a second opinion scan from a reputable on-demand scanner.
  4. Change passwords: from a clean device, change passwords for every account used on the infected machine, starting with email and banking. Use the password strength checker to make the new ones strong.
  5. Restore or reinstall: restore files from clean, offline backups, and reinstall the operating system if a rootkit or backdoor is suspected.
  6. Check for the precursor: look for loader or dropper malware that may have been there first, and find how it got in, or it will happen again.
Malware response in six steps 1Disconnect from the network immediately 2Do not pay — report to CISA or the FBI IC3 3Scan with endpoint protection and a second opinion 4Change passwords from a clean device 5Restore from clean offline backups, or reinstall Step 6: find how it got in — and close that door.
Response steps for a malware infection. Illustration by Cysoro.

How do you prevent malware?

No single tool stops every type, so the goal is layers. NIST's ransomware resources and CISA's guide agree on the same short list, and it works against worms, trojans, spyware and ransomware alike.

  • Patch fast: install operating system and application updates promptly, especially for vulnerabilities CISA lists as actively exploited.
  • Use phishing-resistant MFA: passkeys or security keys stop stolen passwords from being useful.
  • Keep endpoint protection on: antivirus and EDR catch known malware and suspicious behavior, and should be on every device.
  • Back up offline and test restores: backups that are connected to the network get encrypted too. Keep offline copies and test that they actually restore.
  • Limit remote access: close exposed RDP and VPN ports, or put them behind a gateway with MFA.
  • Train people: most malware still arrives through a phishing message, so short, regular training matters as much as any tool.

For a wider starting point, our small business cybersecurity checklist covers these controls alongside device security and incident planning.

The bottom line

Malware is a family, not a single threat: viruses infect files, worms spread on their own, trojans trick you into installing them, ransomware encrypts your data, and spyware steals quietly for months. Most real attacks chain several types together, so the defense has to be layered too.

Patch fast, use phishing-resistant MFA, keep endpoint protection running, and maintain offline backups you have actually tested. If you suspect an infection, disconnect first and investigate second — and check whether any stolen passwords appear in known breaches with the free pwned password checker.

Frequently asked questions

What are the main types of malware?

The main types are viruses, worms, trojans, ransomware, spyware, keyloggers, adware, rootkits, backdoors and botnets. Newer categories include fileless malware, wipers, cryptominers and loaders that install other malware.

What is the difference between a virus and a worm?

A virus attaches itself to a host file or program and spreads when that file is run or shared. A worm is a self-contained program that copies itself across networks without any user action, usually by exploiting a vulnerability.

What is the difference between a trojan and a virus?

A trojan is defined by deception: it looks like useful software but hides a malicious purpose, and it does not replicate itself. A virus is defined by replication: it inserts copies of itself into other files. A trojan can carry a virus, and a virus can arrive inside a trojan.

Is ransomware the most dangerous type of malware?

For businesses, usually yes, because it stops operations entirely and often includes data theft and a leak threat. For individuals, spyware and infostealers can be worse in the long run, because they quietly steal passwords and financial details for months.

Can malware infect a phone?

Yes. Phones get malware through malicious apps, fake updates, phishing links and compromised ad networks. The signs are the same as on a computer: battery drain, overheating, unexpected data use, pop-ups and apps you did not install.

How do I remove malware from my computer?

Disconnect from the network, run a full scan with your endpoint protection or a reputable on-demand scanner, and remove what it finds. If ransomware encrypted your files, do not pay: isolate the machine, report it, and restore from clean backups. If in doubt, reinstall the operating system.

Does antivirus stop all malware?

No. Antivirus and endpoint protection catch known malware and suspicious behavior, but new variants and fileless attacks can slip past them. That is why patching, MFA, backups and user training matter as much as the scanner itself.

Sources

  1. NIST CSRC — Ransomware Protection and Response
  2. CISA — #StopRansomware Guide
  3. CISA — I've Been Hit By Ransomware!
  4. NIST NCCoE — Data Integrity: Detecting and Responding to Ransomware
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against NIST SP 800-83 Rev. 1 definitions, NIST's ransomware resources and CISA's #StopRansomware Guide.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free