logo svg
logo

November 5, 2026

Updated: November 5, 2026

Types of Malware: 16 Kinds Explained With Examples

Viruses to wipers: how 16 malware types spread, real dated examples, their MITRE ATT&CK mapping and the controls and tests that stop them.

Mohammed Khalil

Mohammed Khalil

Featured Image

The main types of malware are viruses, worms, trojans, ransomware, spyware, adware, keyloggers, rootkits, bootkits, infostealers, remote access trojans (RATs), fileless malware, botnets, wipers, cryptojackers and logic bombs. They differ in how they spread (a virus needs a host file, a worm spreads on its own, a trojan relies on a user), how they hide, and what they do once inside: steal data, spy, extort, destroy or borrow your computing power. This guide explains all 16 types with a dated real-world example, the MITRE ATT&CK mapping and the controls that detect and prevent each one.

What Is Malware?

NIST defines malware as software or firmware intended to perform an unauthorized process that will have an adverse impact on the confidentiality, integrity or availability of an information system. The word is short for "malicious software," and it covers everything from a 1990s macro virus to a modern infostealer sold as a subscription service.

Two points make the rest of this guide easier to use:

Security teams map malware behavior to MITRE ATT&CK, a public knowledge base of adversary tactics (the goal of a step) and techniques (how the step is done). ATT&CK also keeps a software catalog with pages for named malware families such as WannaCry (S0366) and Emotet (S0367). This guide uses ATT&CK Enterprise v20 names. In v20 the tactic formerly called Defense Evasion (TA0005) is named Stealth, and a separate Defense Impairment tactic covers disabling security tools. For current infection counts and trend data, see our malware statistics roundup; this page focuses on how each type works.

The 16 Types of Malware at a Glance

#Malware typeWhat it doesHow it usually spreadsMain ATT&CK techniqueDated example
1VirusInfects host files and runs when they runInfected files, macros, removable mediaT1080 Taint Shared Content; T1204.002 Malicious FileMelissa, March 1999
2WormCopies itself across networks without user actionExploited network services, weak credentialsT1210 Exploitation of Remote ServicesWannaCry, May 2017
3TrojanPoses as legitimate software to get installedPhishing attachments, fake downloadsT1204.002 Malicious File; T1036 MasqueradingEmotet, October 2020 alert
4RansomwareEncrypts or steals data for extortionStolen credentials, exploits, phishing, loadersT1486 Data Encrypted for ImpactALPHV Blackcat, February 2024 update
5SpywareCovertly monitors a user or deviceExploits, malicious apps, bundlesT1113 Screen Capture; T1123 Audio CapturePegasus FORCEDENTRY, September 2021
6AdwareInjects or displays unwanted adsBundled or preinstalled software, extensionsT1176.001 Browser ExtensionsSuperfish on Lenovo laptops, FTC 2017
7KeyloggerRecords keystrokes to capture credentialsPhishing attachments, bundled in stealers and RATsT1056.001 KeyloggingFormBook, CISA top strains 2022
8RootkitHides malware by modifying the operating systemInstalled after compromise with admin rightsT1014 RootkitDrovorub, August 2020
9BootkitLoads before the operating system from the boot chainInstalled after compromise; boot loader flawsT1542.003 BootkitBlackLotus, NSA guide June 2023
10InfostealerHarvests saved passwords, cookies and walletsPhishing, fake CAPTCHAs, cracked softwareT1555.003 Credentials from Web Browsers; T1539LummaC2, May 2025
11Remote access trojan (RAT)Gives an attacker hidden remote controlPhishing attachments, trojanized toolsT1071.001 Web Protocols; T1105 Ingress Tool TransferNetWire takedown, March 2023
12Fileless malwareRuns in memory through built-in toolsPhishing links, scripts, exploitsT1059.001 PowerShell; T1218 System Binary Proxy ExecutionAstaroth, July 2019
13BotnetTurns many devices into remotely controlled botsSpam, default IoT passwords, loadersT1584.005 Botnet; T1498 Network Denial of ServiceQakbot takedown, August 2023
14WiperDestroys data or disks beyond recoveryInstalled after compromise, often disguisedT1485 Data Destruction; T1561.002 Disk Structure WipeWhisperGate and HermeticWiper, 2022
15CryptojackerUses victim computing power to mine cryptocurrencyExploited servers, cloud credentialsT1496 Resource HijackingXMRig at a federal agency, November 2022 advisory
16Logic bombTriggers a harmful action when a condition is metPlanted by an insider or in a supply chainNo dedicated technique; T1053 and T1485"Kill switch" conviction, March 2025

Technique names and IDs come from MITRE ATT&CK Enterprise v20, except spyware on phones, which ATT&CK covers in its Mobile matrix. The sources for each example are linked in the type sections below.

16 types of malware in five families, from viruses and worms to wipers, each with its main MITRE ATT&CK technique

Malware That Spreads: Viruses, Worms and Trojans

These three are the oldest and best-known malware types. The difference between them is how they spread: a virus rides on a host file, a worm moves on its own, and a trojan needs the victim to install it.

1. Virus

A computer virus is malicious code that attaches itself to a legitimate file, program or document macro and runs when that host runs. Once active, it copies itself into other files, so it spreads every time an infected file is shared or opened.

"Virus" is often used as a synonym for malware in general. Technically it is just one type, and pure file-infecting viruses are now a small share of what defenders see.

2. Worm

A worm is standalone malware that copies itself from one system to the next without any user action. It finds new targets by scanning for a vulnerable network service or weak credentials, exploits them, and repeats the process from each new host. That is why worms can cross an entire network in hours.

3. Trojan

A trojan (or Trojan horse) is malware disguised as something the victim wants: an invoice, a software update, a game or a free tool. Unlike a virus or worm, it does not copy itself. It relies on the user to install it, then opens the door for the attacker. Many trojans are droppers or loaders whose main job is to download other malware.

Malware That Extorts or Monetizes: Ransomware, Adware and Cryptojackers

These types exist to make money directly from the victim, either by demanding payment, by selling the victim's attention, or by stealing computing power.

4. Ransomware

Ransomware encrypts an organization's files or systems and demands payment for the decryption key. Most modern groups also steal data first and threaten to publish it (double extortion), so restoring from backup does not end the threat. Many operate as ransomware-as-a-service (RaaS), where developers rent the malware to affiliates who carry out intrusions.

For payment rates, attack volumes and costs, see our ransomware statistics rather than repeating them here.

5. Adware

Adware displays, injects or redirects users to advertising, usually without clear consent. Much adware sits in a gray area between unwanted software and malware, but some versions tamper with browsers or security settings in ways that create real risk.

6. Cryptojacker

A cryptojacker (cryptomining malware) secretly uses a victim's processors, servers or cloud accounts to mine cryptocurrency, usually Monero. It rarely steals data, so it is easy to dismiss, but it shows that an attacker has code execution on your systems and can switch to something worse.

Malware That Spies and Steals: Spyware, Keyloggers, Infostealers and RATs

These types collect information or give an attacker eyes and hands inside a system. They are often the first step toward account takeover, fraud or ransomware.

7. Spyware

Spyware covertly monitors a person or device and sends what it collects to someone else: messages, location, microphone and camera input, screenshots or browsing activity. It ranges from commercial "stalkerware" to mercenary spyware sold to governments.

8. Keylogger

A keylogger records what a user types, so it captures passwords, card numbers and messages before encryption can protect them. Software keyloggers are rarely standalone today; most come built into infostealers and RATs, which also grab clipboard contents and screenshots. Hardware keyloggers are small devices placed between a keyboard and computer.

9. Infostealer

An infostealer collects saved browser passwords, session cookies, autofill data, crypto wallets and files, packages them as a "log" and sends them to the attacker within minutes. Stolen session cookies are especially dangerous because they can let an attacker skip the login and MFA entirely. Infostealers are sold as subscription services, and the stolen logs are resold on criminal markets.

Our guide to infostealer malware and credential theft covers the full attack chain, and our stealer log statistics track how much stolen data circulates.

10. Remote access trojan (RAT)

A remote access trojan gives an attacker hidden, interactive control of an infected computer: browsing files, running commands, capturing the screen and webcam, logging keystrokes and downloading more tools. Legitimate remote support tools do similar things, but they show the user a visible session; a RAT hides.

Malware That Hides: Rootkits, Bootkits, Fileless Malware and Logic Bombs

These types are built to avoid detection or to wait. They let attackers stay inside for months, survive reboots and cleanups, or trigger damage long after the person who planted them has left.

11. Rootkit

A rootkit modifies the operating system so that malware, files, processes and network connections are hidden from the user and from security tools. User-mode rootkits alter programs and libraries; kernel-mode rootkits load as drivers or kernel modules and can lie to almost any tool running on that system.

12. Bootkit

A bootkit infects the boot process, either the legacy master boot record or the UEFI boot loader, so it runs before the operating system and its security tools start. That gives it control over what loads next and lets it survive operating system reinstalls in some cases. Malware that goes one level deeper into the motherboard firmware is called a firmware or UEFI implant.

13. Fileless malware

Fileless malware avoids writing a traditional executable to disk. It runs in memory and abuses tools that are already on the system, such as PowerShell, WMI and signed Windows binaries (often called living off the land), which makes signature-based scanning far less effective.

Our explainer on fileless malware covers the techniques and detections in more depth.

14. Logic bomb

A logic bomb is code that sits quietly inside a legitimate program or system until a condition is met, such as a date, an event or the absence of a specific user account, and then performs a harmful action like deleting data or locking users out. Logic bombs are usually planted by insiders with legitimate access, which is why they slip past perimeter defenses.

See our full guide to what a logic bomb is for more cases and insider-threat controls.

Malware That Controls or Destroys at Scale: Botnets and Wipers

15. Botnet

A botnet is a network of infected computers, servers or IoT devices ("bots") controlled by an attacker through command-and-control infrastructure. The bot malware itself may be quiet, but the network can be rented out for distributed denial-of-service attacks, spam, credential stuffing, proxying criminal traffic or delivering ransomware.

16. Wiper

Wiper malware destroys data, file systems or the disk's boot structures so that systems cannot be recovered without backups. It is used for sabotage, often by state-backed actors, and is sometimes disguised as ransomware even though no working decryption is possible.

How Malware Moves Through an Attack

Knowing the type tells you what the malware does; knowing where it sits in the attack tells you where to stop it. Most intrusions follow a similar path, described in ATT&CK tactics and in the older cyber kill chain:

StageATT&CK tacticMalware types most active hereControl that breaks the step
DeliveryInitial AccessTrojans, worms, botnet loaders, infostealers via phishingEmail filtering, patching, phishing-resistant MFA
First runExecutionTrojans, fileless malware, virusesMacro blocking, application control, script logging
Staying inPersistence, StealthRootkits, bootkits, logic bombs, adware extensionsSecure Boot, signed drivers, change control
ControlCommand and ControlRATs, botnetsEgress filtering, beacon detection
SpreadingPrivilege Escalation, Lateral MovementWorms, credential-stealing toolsLeast privilege, segmentation
ObjectiveCollection, Exfiltration, ImpactSpyware, keyloggers, infostealers, ransomware, wipers, cryptojackersBackups, DLP, EDR, resource monitoring
Six attack stages from delivery to objective, the malware types active in each and the control that breaks it

After the first foothold, attackers usually need more access before they deploy ransomware or wipers. Our guides to privilege escalation and lateral movement explain those middle steps, and the MITRE ATT&CK framework guide shows how to use the matrix to plan detections.

How to Detect and Prevent Malware

No single product stops all 16 types. A short list of layered controls covers most of them, and each one can be checked rather than assumed.

ControlMalware types it bluntsHow to verify it works
EDR on every endpoint and serverTrojans, fileless malware, RATs, infostealers, ransomware, wipersRun ATT&CK-mapped emulation in a lab or under an authorized test and check which steps alert
Email and attachment filtering with macro blockingViruses, trojans, keyloggers, infostealersSend safe test messages and confirm quarantine; audit macro policy
Phishing-resistant MFA and short session lifetimesKeyloggers, infostealers, ransomware entryAttempt login with a captured password in an authorized test; review token lifetimes
Risk-based patching of exposed systemsWorms, cryptojackers, ransomware, botnetsTrack time to patch known exploited vulnerabilities; external scans
Application control and script restrictionsFileless malware, trojans, adwareTest whether unapproved binaries and scripts run on a standard build
Secure Boot, signed drivers and boot integrity monitoringRootkits, bootkitsCheck device health attestation and boot partition alerts
Egress filtering and DNS monitoringRATs, botnets, infostealers, cryptojackersReview blocked destinations and beacon alerts
Network segmentationWorms, ransomware, wipersSegmentation testing from a standard user network
Offline, immutable backupsRansomware, wipersTimed restore tests of critical systems
Code review, change control and offboardingLogic bombs, insider-planted malwareAudit production changes and account removal times
Device and software inventoryAdware, spyware, IoT botnetsCompare inventory with network scans
Matrix of seven security controls against five malware families, rated strong, partial or little coverage

Signature antivirus still has a place for well-known file-based malware, but most current threats are caught by behavior: a document that spawns PowerShell, a process reading browser password stores, an unusual outbound connection every 60 seconds, or a burst of file renames. Endpoint telemetry has to reach someone who can act on it quickly, whether an in-house SOC or a managed service.

How to Test Your Defenses Against Malware

Reading about malware types is useful; knowing which ones your controls would actually stop is better. Safe testing never uses live malware on production systems. Instead, it emulates malware behavior under written scope and rules of engagement:

The standard EICAR anti-malware test file is a harmless way to confirm that endpoint protection is active on a given machine, but it only proves that signature scanning works. Behavior-based detections need behavior-based tests.

Frequently Asked Questions

What are the main types of malware?

The main types are viruses, worms, trojans, ransomware, spyware, adware, keyloggers, rootkits, bootkits, infostealers, remote access trojans, fileless malware, botnets, wipers, cryptojackers and logic bombs. Many real malware families combine several of these, for example a trojan that installs a keylogger and joins a botnet.

What is the difference between a virus, a worm and a trojan?

A virus attaches to a host file and spreads when that file is opened or shared. A worm is standalone and spreads across networks by itself, usually by exploiting a vulnerability. A trojan does not spread on its own at all; it tricks a user into installing it by posing as legitimate software.

Which type of malware is the most dangerous for businesses?

For most organizations, ransomware and the tools that lead to it are the highest-impact types, because they combine data theft, extortion and downtime. Infostealers and loaders deserve the same attention, because stolen credentials and initial footholds are what ransomware operators buy. For current frequency data, see our malware and ransomware statistics posts.

Can antivirus detect fileless malware and rootkits?

Traditional signature antivirus struggles with both, because fileless malware leaves little on disk and kernel rootkits can hide from tools on the same system. Behavior-based EDR, script logging, Secure Boot, signed drivers and memory analysis are the main ways to detect them.

Can phones get malware?

Yes. Phones are targeted by spyware, banking trojans, adware and malicious apps. Keeping the operating system updated, installing apps only from official stores and managing corporate devices with mobile device management are the main defenses. High-risk users can enable hardened modes such as Apple's Lockdown Mode.

How do I know if my computer has malware?

Common signs include unexpected pop-ups or browser changes, slow performance or high CPU use, unknown programs or browser extensions, security tools that are disabled, and unusual network activity. Many modern threats show no visible sign, so organizations should rely on EDR alerts and log monitoring rather than user observation.

Next Step: Find Out Which Malware Would Get Through

Every malware type in this guide depends on something that can be tested: a phishing email that reaches an inbox, an unpatched service, a user with too much access, a missing alert, or a backup that has never been restored. Fix the obvious gaps first, then check the result from an attacker's point of view.

DeepStrike's penetration testing services include manual network, web application and cloud penetration testing, social engineering assessments and red team engagements, with reports that give reproduction steps, root causes and remediation guidance for every validated finding. To scope a test that starts from an assumed malware foothold, contact the team.

About The Author

Mohammed Khalil is a Cybersecurity Architect at DeepStrike, specializing in advanced penetration testing and offensive security operations. With certifications including CISSP, OSCP, and OSWE, he has led numerous red team engagements, focusing on cloud security, application vulnerabilities, and adversary emulation. His work involves dissecting complex attack chains and developing resilient defense strategies for clients in the finance, healthcare, and technology sectors.

Sources and References

background
Let's hack you before real hackers do

Stay secure with DeepStrike penetration testing services. Reach out for a quote or customized technical proposal today

Contact Us