Malware & ransomware

What Is Malware? Types, How It Spreads and How to Stop It

Malware is any software built to harm you: viruses, worms, Trojans, ransomware, spyware and more. Here is how each type works and how to stop it.

Cysoro Security TeamPublished · 10 min read
MALWARE & RANSOMWARE What Is Malware? Viruses, worms, Trojans, spyware — how they spread and how to stop them. CYSORO.COM 0101
Quick answer

Malware, short for malicious software, is software or firmware intentionally designed to harm a computer, phone or network, steal data, or gain unauthorized access. It includes viruses, worms, Trojan horses, ransomware, spyware, keyloggers, rootkits and adware, and it usually spreads through phishing emails, malicious downloads, unpatched software and infected removable drives.

Key takeaways

  • Malware is an umbrella term — viruses, worms, Trojans and ransomware are all types of malware, not separate problems.
  • Most infections start with a person, not a hack: a phishing email, a fake download or an unpatched program.
  • Backups, updates, MFA and reputable antivirus stop most malware before it can do damage.

Every scary headline about hacked companies, stolen passwords and locked files has the same culprit behind it: malware. It is the umbrella term for all software built to do harm — and once you know the main types, you can spot most infections before they cost you anything.

What is malware?

Malware, short for malicious software, is software or firmware intentionally designed to harm a computer, phone or network, steal data, or gain unauthorized access. NIST defines it as software inserted into a system to compromise the confidentiality, integrity or availability of data or systems.

The word covers a whole family of threats. A virus, a worm, a Trojan horse, ransomware, spyware, a keylogger and a rootkit are all malware — they differ in how they spread and what they do once inside. Most real-world samples mix several types, so treat these categories as a vocabulary, not a strict taxonomy.

Malware is not the same as a bug or a crash. Bugs are accidents. Malware is deliberate: someone wrote it, packaged it to look harmless, and sent it out hoping you would run it. That intent is what makes it a security problem rather than a quality problem.

What are the main types of malware?

The main types are viruses, worms, Trojans, ransomware, spyware, keyloggers, rootkits, adware, backdoors and cryptominers. Each has a different trick, and knowing the trick tells you what to look for.

TypeHow it spreadsWhat it doesCopies itself?
VirusInfects programs or documents; runs when you open themDamages files, steals data, or installs more malwareYes, into files
WormExploits network services or mass-mails itselfSpreads to other machines, often carrying a payloadYes, as a standalone program
TrojanDisguised as useful software; you install itOpens a backdoor, steals data, drops other malwareNo
RansomwarePhishing, stolen passwords, unpatched systemsEncrypts files and demands paymentNot by definition
Spyware / keyloggerBundled with other software or dropped by a TrojanRecords activity or keystrokes and sends them outNo
RootkitInstalled by other malware or a drive-by downloadHides itself and other malware from detectionNo
AdwareBundled with free software or browser extensionsFloods you with ads, hijacks search resultsNo
CryptominerMalicious sites, infected apps, unpatched serversUses your CPU and electricity to mine cryptocurrencySometimes

Virus

A virus self-replicates by inserting copies of itself into host programs or data files, and it usually needs you to open the infected file to run. NIST splits viruses into compiled viruses, run by the operating system, and interpreted viruses, run by an application such as a document macro.

Worm

A worm is a self-replicating, self-contained program that usually executes itself without user intervention. Network service worms exploit a vulnerability to jump from host to host, while mass-mailing worms email themselves out. WannaCry, which exploited a fixed vulnerability in the SMB file-sharing protocol, is the classic network example.

Trojan horse

A Trojan horse is a self-contained, non-replicating program that, while appearing to be benign, actually has a hidden malicious purpose. The name comes from the Trojan Horse of Greek myth: the gift looks useful, the soldiers are inside. A typical attack runs from spam to a website, which installs Trojans through software vulnerabilities, and the Trojans then install keyloggers and other tools.

Ransomware

Ransomware encrypts files on a device, rendering the files and the systems that depend on them unusable, and then demands payment for the decryption key. CISA calls it one of today's most disruptive cyber threats, and its #StopRansomware Guide is the best official starting point for prevention and response. Our guide to what ransomware is and how it works covers it in depth.

Spyware and keyloggers

Spyware is software secretly installed to gather information about people or organizations without their knowledge. A keylogger is a specific kind: it monitors and records keyboard use, and some loggers actively send the data to another host. Stolen keystrokes mean stolen passwords, card numbers and messages.

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 its own existence — and other malware with it — which is why rootkit infections are hard to remove and sometimes require a full reinstall.

Adware and cryptominers

Adware floods your screen with ads, changes your homepage and redirects searches to earn its authors money. Cryptominers are quieter: they use your processor and electricity to mine cryptocurrency, so the symptom is a slow computer and a hot, noisy fan rather than pop-ups.

How a malware infection usually unfolds1Gets inphishing email, fakedownload, USB drive,unpatched software2Hides and spreadsdisables security tools,copies itself, phoneshome for instructions3Does the damagesteals data, encryptsfiles, spies, or minescrypto on your powerCatching it at stage 1 is cheapest. Stage 3 is where the bill arrives.
The three stages of a typical malware infection. Illustration by Cysoro.

How does malware spread?

Malware spreads through people, not magic. The most common routes are phishing emails with malicious attachments or links, fake software downloads, compromised websites, unpatched software, infected USB drives and malicious ads.

Phishing is the biggest single route. An email that looks like an invoice, a delivery notice or a message from IT carries an attachment or a link, and one click runs the payload. Our spear phishing guide shows how the targeted version of this attack works.

Drive-by downloads are the quiet route: you visit a compromised site or see a malicious ad, and it exploits an unpatched browser or plugin to install malware without any click. That is why updates matter — the vulnerability WannaCry exploited had already been fixed, and unpatched machines paid the price.

Malware also spreads through supply chains and removable media. A compromised software update, a poisoned download mirror, or a USB drive found in a car park can carry it. In businesses, the most expensive route is stolen credentials: an attacker logs in with a real password and installs malware as if they worked there.

How do you know if your computer has malware?

Malware tries to stay quiet, but it usually leaves clues. No single sign proves an infection, but several together mean you should investigate.

  • Your computer suddenly slows down or the fan runs hard while you do nothing.
  • Pop-ups appear everywhere, including outside the browser, or your homepage and search engine change.
  • New toolbars, extensions or programs show up that you did not install.
  • Programs crash, files disappear, or your browser redirects to strange sites.
  • Friends get odd messages from your accounts, or your email sends mail you did not write.
  • Your security software is disabled and will not turn back on, or updates fail repeatedly.
  • Your data usage spikes for no reason, or your battery drains much faster than usual.

On a phone, watch for the same pattern: overheating, rapid battery drain, data spikes, apps you did not install, and pop-ups outside apps. If you use a phone for work, check our guide on how to know if your phone is hacked.

What are real examples of malware attacks?

Three documented cases show the range: a worm that spread worldwide in a day, a banking Trojan that stole from thousands, and ransomware that shut down hospitals.

WannaCry (2017). A worm that exploited the SMB file-sharing protocol spread to hundreds of thousands of computers in more than 150 countries within a day, encrypting files and demanding Bitcoin. It hit the UK's National Health Service hard, cancelling appointments and operations. The patch had been available for two months.

Emotet. Originally a banking Trojan, Emotet became a delivery service for other malware, spreading through phishing emails with malicious Word documents. It was so disruptive that an international law enforcement operation took down its infrastructure in 2021 — and variants returned later.

NotPetya (2017). Disguised as ransomware, NotPetya was really a wiper: it encrypted systems with no workable way to recover them. It spread through a compromised software update and caused billions of dollars in damage to global companies including Maersk and Merck.

The FBI's Internet Crime Complaint Center received 3,611 ransomware complaints in 2025, with reported losses above $32 million, and it notes that figure excludes lost business, staff time and remediation costs. The full picture is in the 2025 IC3 Annual Report.

Malware vs virus vs ransomware: what is the difference?

These terms overlap, which is why they are constantly mixed up. Malware is the umbrella term. A virus is one type of malware that copies itself into files. Ransomware is another type that encrypts files for payment.

Think of it like this: malware is the category, like "vehicle". A virus is a car, ransomware is a truck, a Trojan is a delivery van with something hidden in the back. They are all vehicles, but they work differently and need different responses.

The distinction matters when you respond. A virus can often be removed by antivirus. Ransomware needs backups and an incident response plan, because decryption is not guaranteed even if you pay. A rootkit may need a full wipe. Use the right name, and you pick the right fix.

How do you remove malware?

Removing malware is a process, not a single button. Follow these steps in order, and do not enter passwords or make payments on the infected device until it is clean.

  1. Disconnect from the network. Unplug ethernet or turn off Wi-Fi so the malware cannot spread or phone home.
  2. Back up important files only — documents and photos, not programs — to an external drive, and scan that drive later.
  3. Run a full scan with reputable antivirus or anti-malware software, updated first. Use a second-opinion scanner if the first finds nothing but symptoms persist.
  4. Remove what it finds and restart. Scan again to confirm the system is clean.
  5. Change your passwords from a clean device, starting with email and banking, and turn on multi-factor authentication.
  6. Check for damage: look for new mail-forwarding rules, unknown devices on your accounts, and unfamiliar transactions.
  7. If it persists, wipe and reinstall. Back up files, format the drive, reinstall the operating system, and restore only scanned files. This is the only reliable fix for rootkits.

If the malware stole a password you reuse elsewhere, check whether it appears in known breaches with our free pwned password checker and change it everywhere it was used.

Six defenses that stop most malware1. Keep everything updatedOS, browser, apps2. Run reputable antivirusreal-time protection on3. Use MFA everywhere it mattersstolen password alone fails4. Back up offline, and test restoresransomware-proof copy5. Treat unexpected attachments with suspicionverify before opening6. Do not run as admin day to day
Layered defenses against malware — no single control is enough on its own. Illustration by Cysoro.

How do you prevent malware?

Prevention is layered: no single tool stops everything, but together these controls stop most infections before they start. NIST's Guide to Malware Incident Prevention and Handling (SP 800-83 Rev. 1) recommends the same approach: prevent, detect, contain and recover.

Update promptly. Turn on automatic updates for your operating system, browser and apps. Most malware exploits vulnerabilities that already have patches.

Run reputable antivirus with real-time protection and keep it updated. On Windows, the built-in Microsoft Defender is a solid baseline; add a second-opinion scanner for occasional checks.

Use multi-factor authentication on email, banking and admin accounts, so a stolen password alone is not enough.

Back up offline and test restores. A backup that ransomware can reach is not a backup. Keep one copy offline or immutable, and confirm you can actually restore from it.

Be careful with downloads and attachments. Get software from the official vendor site or app store, never from a search ad or a file-sharing site. If an attachment is unexpected, verify with the sender through a different channel before opening it.

Do not run as an administrator day to day. Malware that runs with your permissions can do far more damage from an admin account than from a standard one.

For businesses, add application allow-listing, network segmentation and security awareness training. Our small business cybersecurity checklist covers these controls in a practical order.

Can malware infect phones and Macs?

Yes, and the idea that Macs and phones are immune is one of the most persistent myths in security. They get less malware than Windows PCs, but they are not immune.

Mac malware usually arrives as fake installers — a bogus Flash update, a pirated app, or a trojanized download. It then steals browser data, shows ads or opens a backdoor. Keep macOS updated, install apps only from the App Store or identified developers, and treat unexpected installer prompts with suspicion.

Phone malware hides in malicious apps outside the official stores, in smishing links sent by text, and in fake updates. Android phones face more of it because sideloading is easier; iPhones are harder to infect but not impossible, especially through malicious profiles and phishing. Keep your phone updated, review app permissions, and never install apps from links in messages.

The bottom line

Malware is any software built to harm you, and it comes in many forms — but the defenses are the same for all of them: update promptly, run reputable protection, use MFA, keep offline backups, and pause before you click.

If you suspect an infection, disconnect, scan, and change passwords from a clean device. And if a password you used anywhere was caught up in a breach, check it with the free pwned password checker before you reuse it anywhere else.

Frequently asked questions

What is malware in simple terms?

Malware is software made to do harm. Instead of helping you, it damages files, steals passwords, spies on you, locks your computer for ransom or quietly uses your device for someone else's benefit.

What is the difference between a virus and malware?

Malware is the umbrella term for all malicious software. A virus is one type of malware — it copies itself into other files and spreads when those files are opened. All viruses are malware, but not all malware is a virus.

How do I know if my computer has malware?

Common signs are sudden slowness, pop-ups, a changed homepage, new toolbars, programs crashing, the fan running hard at idle, and friends receiving strange messages from your accounts. Any one sign can have a harmless cause, but several together are worth investigating.

Can malware infect a Mac or a phone?

Yes. Macs and phones get less malware than Windows PCs, but they are not immune. Mac malware usually arrives as fake installers, while phone malware hides in malicious apps, smishing links and fake updates.

Does antivirus remove all malware?

Reputable antivirus removes most known malware, but deeply embedded threats such as rootkits can survive a scan. If an infection persists after a full scan, back up your files, wipe the device and reinstall the operating system.

Is ransomware a type of malware?

Yes. Ransomware is malware that encrypts your files and demands payment for the decryption key. Many modern ransomware attacks also steal data first and threaten to publish it.

Can I get malware just by visiting a website?

Yes, through drive-by downloads and malvertising, where a compromised ad or site exploits an unpatched browser or plugin. Keeping your browser and operating system updated closes most of these holes.

What should I do first if I think I have malware?

Disconnect the device from the network, do not enter passwords or make payments on it, and run a full scan with reputable security software from a trusted source. If money or accounts are involved, change passwords from a clean device and contact your bank.

Sources

  1. NIST — Guide to Malware Incident Prevention and Handling for Desktops and Laptops (SP 800-83 Rev. 1)
  2. Level — What Is Malware? Types, How It Spreads, and How to Protect Your Devices
  3. DailyDebian — Types of Malware Explained: Definitions and Signs
  4. Larely Learn — Types of Malware: Viruses, Worms, Trojans, Ransomware and More
  5. FBI Internet Crime Complaint Center — 2025 IC3 Annual Report
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, CISA malware guidance and the FBI IC3 2025 report.

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