Skip to main content
Season 3 ends in 16 d 22:34:33 $2,000 10,000 pts = 1 month Premium
Online Security

What Is Malware? Viruses, Trojans, Spyware and Protection

Published 16 min read
Open the post and read it to claim 31 points
A laptop under a glowing blue hexagonal shield as red spiky shapes representing malware break apart against it

Sign in and earn +31 points by reading this

Read to the end, wait a few seconds, then tap the claim button below.

In short

Malware, short for malicious software, is any program or code designed to harm a computer, phone or network, steal data or take control without permission [1][2]. Viruses, worms, Trojans, spyware and ransomware are all types of malware [2][4]. Updates, backups, careful downloads and multi-factor authentication block most infections [5][7].

Key takeaways

  1. Malware is software intentionally inserted into a system for a harmful purpose, such as stealing, deleting or encrypting data [1][2][5].
  2. Virus, worm, Trojan horse, spyware, adware and ransomware are names for different kinds of malware, not separate threats [2][4].
  3. A virus usually needs a user action to spread, a worm can spread on its own, and a Trojan pretends to be something useful [4].
  4. Most infections arrive through email attachments and links, unsafe downloads, fake warnings or unpatched software [4][5][8].
  5. Warning signs include a slow device, unexpected pop-ups, programs opening by themselves and messages sent in your name [6][8].
  6. Keeping software updated, using strong passwords with multi-factor authentication and keeping offline backups are the core defences [5][7].
  7. If a phone or tablet is infected, a factory reset is often the safest fix; for a computer, update, scan and, if needed, reinstall [6].
On this page 12 sections
  1. What is malware?
  2. What are the main types of malware?
  3. What is the difference between a virus, a worm and a Trojan?
  4. How does malware get onto a computer or phone?
  5. What are the signs of a malware infection?
  6. How do you remove malware from a computer or phone?
  7. How do you protect yourself from malware?
  8. How do organisations defend against malware?
  9. Common mistakes
  10. Frequently asked questions
  11. Glossary
  12. Sources

What is malware?

Malware is malicious software: any program or code that is deliberately designed to damage a device, steal information or take control of a system without the owner’s permission [1][2].

The word combines “malicious” and “software”. The US National Institute of Standards and Technology (NIST) defines it as hardware, firmware or software intentionally included or inserted in a system for a harmful purpose, and lists viruses, worms, Trojan horses, spyware and some adware as examples [2]. NIST’s guide to malware incidents calls malware the most common external threat to most computers, causing widespread damage and disruption [1]. The US Cybersecurity and Infrastructure Security Agency (CISA) describes it as any software used to gain unauthorised access to IT systems to steal data, disrupt services or damage networks [3].

Malware can harm you in many ways. The UK National Cyber Security Centre (NCSC) lists the main ones [5]:

  • locking a device or making it unusable;
  • stealing, deleting or encrypting data;
  • taking control of a device to attack others;
  • capturing passwords and other credentials;
  • secretly “mining” cryptocurrency with your computer’s power;
  • using paid services, such as premium-rate calls, at your expense.

Malware is not the same as a software bug. A bug is an accidental mistake in a program. Malware is written on purpose to do harm, although it often exploits bugs, known as vulnerabilities, to get in [5].

What are the main types of malware?

The most common types are viruses, worms, Trojan horses, spyware, adware, ransomware and rootkits; many real attacks combine several of them [1][2][4].

Security agencies group malware by how it spreads and what it does. The names overlap, and a single piece of malware can fit more than one category. NIST’s guide notes that “blended attacks” use several methods at once [1].

  • Virus: a program that infects files or system areas and copies itself, usually spreading when someone opens an infected file or attachment [4].
  • Worm: malware that spreads from computer to computer without human action, often clogging memory and networks [4].
  • Trojan horse: a program that claims to do one thing but secretly does something harmful, often hidden in free downloads or email attachments [4].
  • Spyware: software that secretly collects information about what you do, such as the sites you visit or what you type [2].
  • Adware: software that pushes unwanted advertising; NIST counts some forms as malware when they act without consent [2].
  • Ransomware: malware that locks a device or encrypts or steals data and demands payment, usually in cryptocurrency [3][5].
  • Rootkit: malware designed to hide itself, and other malware, deep inside the operating system so it is hard to detect [1].

Ransomware is the type that causes the most disruption to organisations. The NCSC cites the WannaCry outbreak, which affected the UK’s National Health Service in May 2017, as an example of ransomware that spread across networks [5]. For a full explanation of that one type, see our guide What Is Ransomware? How Attacks Work and How to Defend.

Four symbolic figures on a circuit board: a wooden Trojan horse, a glowing worm, a spy with a magnifying lens and a red padlock gripping a folder
Malware comes in many forms: Trojans that pretend to be useful, worms that spread on their own, spyware that watches and ransomware that locks your files.

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

A virus attaches to files and usually needs you to open something to spread; a worm spreads by itself across networks; a Trojan does not copy itself but tricks you into installing it [4].

People often say “virus” for any malware, but CISA draws clear lines between the three classic types [4]. A computer virus infects files or system areas and then makes copies of itself. Unlike a worm, it often needs some user action, such as opening an email attachment or visiting a malicious web page, to spread. Some viruses are harmless; others damage or destroy files [4].

A worm is a type of virus that can spread without human interaction. Because worms copy themselves from computer to computer, they can use up memory and network bandwidth until systems stop responding, and some let attackers access a computer remotely [4].

A Trojan horse is named after the wooden horse of the ancient Greek story. It is a program that pretends to perform one useful action while in fact performing a harmful one, and it can be included in free software or email attachments [4]. Trojans rely on deception rather than self-copying, which is why they are closely linked with scams and social engineering.

The difference matters for defence. Worms are stopped mainly by patching software and blocking exposed network services; viruses and Trojans are stopped mainly by being careful with what you open and install, plus security software that scans files before they run [4][5].

How does malware get onto a computer or phone?

Most malware gets in because someone opens an infected attachment or link, installs software from an untrusted source, falls for a fake warning, or uses a device whose software has not been updated [4][5][8].

Knowing the usual routes in is the first step to closing them. CISA says most users get viruses from opening and running unknown email attachments, and that most viruses, Trojans and worms are activated when someone opens an attachment or clicks a link in an email [4]. The US Federal Trade Commission (FTC) warns that criminals send emails that look as if they come from companies you trust, and that free games, file-sharing programs and toolbars can come with malware [8].

  • Email and messages: attachments and links in phishing emails, texts and chat messages [4][8].
  • Downloads: pirated or “free” software, fake updates and apps from outside official app stores [8].
  • Fake alerts: pop-ups or calls claiming your device is infected and pushing you to install something or pay; the NCSC calls such phone calls a common scam [6][8].
  • Removable media: infected USB drives, which is why the NCSC advises turning off autorun [5].
  • Unpatched software: attackers can force their code to run by exploiting known flaws, which security updates fix [5].
  • Exposed remote access: the NCSC notes that ransomware is often deployed by attackers who get in through remote access services that are poorly protected or unpatched [5].

Many of these routes depend on tricking a person rather than breaking technology. That is why spotting manipulation is as important as having security software.

An email with an attachment, a USB stick, a cloud download and a warning card linked by dotted lines to a phone and a laptop
Common ways in: email attachments and links, untrusted downloads, infected USB drives and fake security warnings.

What are the signs of a malware infection?

Common signs are a device that suddenly runs slowly or crashes, unexpected pop-ups, programs that open or close by themselves, changed browser settings and messages sent from your accounts that you did not write [6][8].

Some malware is noisy; much is designed to stay hidden. The NCSC says the easiest way to confirm an infection on a PC or laptop is to run an antivirus scan [6]. Without one, it lists signs such as a device running slowly, rebooting by itself, closing programs you are using or opening ones you are not, pop-up boxes from programs you do not recognise, and friends receiving strange emails from you [6].

The FTC adds other warning signs: repeated error messages, a computer that will not shut down or restart, web pages you did not intend to visit, new toolbars or icons, a changed home page and a laptop battery that drains faster than it should [8].

None of these signs proves an infection. Old hardware, a full disk or a buggy update can cause the same symptoms. Equally, a device can be infected with no visible sign at all, especially with spyware. If you are unsure, a scan with up-to-date security software and a check of recently installed apps are sensible first steps [6].

Be suspicious of the warnings themselves. A pop-up or phone call telling you your device is infected and asking you to call a number, install a tool or pay is far more likely to be a scam than a real alert [6][8].

How do you remove malware from a computer or phone?

The NCSC’s approach has three steps: confirm the infection, fix it (update and scan a computer, factory-reset a phone or tablet), then restore data from a clean backup and secure your accounts [6].

  1. Stop sensitive activity. The FTC advises stopping online shopping, banking and anything else that involves passwords until the device is clean [8].
  2. On a PC or laptop: update the operating system and programs, run your antivirus product and follow its advice. If it cannot clean the device, the NCSC says you will need to wipe it and reinstall everything, starting with the operating system, possibly with expert help [6].
  3. On a phone or tablet: these usually cannot be cleaned by antivirus in the same way, so the NCSC says the safest solution is a factory reset from the settings menu [6].
  4. Restore your data from the last backup you know was clean. Rescuing files from an infected device risks bringing the infection back [6].
  5. Change your passwords from a clean device, starting with email and banking, because malware may have captured them [8].

If you paid a caller who claimed to fix your device, the NCSC advises reporting it and contacting your bank or card provider [6]. For phone-specific advice and fake alerts, see our guide Phone Virus Removal on Android and iPhone: Spot Fake Alerts.

How do you protect yourself from malware?

Keep software updated, use strong passwords with multi-factor authentication, think before opening links and attachments, install apps only from trusted sources and keep backups that malware cannot reach [5][7][8].

CISA asks everyone to take four core steps: avoid and report phishing scams, use strong passwords, use multi-factor authentication and a password manager, and update software [7]. The NCSC and FTC add practical habits [5][6][8]:

  • Turn on automatic updates for the operating system, apps and browser; updates fix the flaws malware exploits [5][8].
  • Use security software on computers and keep it updated; the NCSC recommends antivirus for PCs and laptops [6].
  • Install software only from trusted sources, such as official app stores and developers’ own websites [5][8].
  • Check before opening attachments, even from people you know; if you were not expecting a file, ask the sender another way first [4].
  • Back up important files regularly, keep at least one copy disconnected from your device and test that you can restore it [5].
  • Turn on multi-factor authentication, so a stolen password alone is not enough to get into your accounts [5][7].
  • Ignore unexpected warnings that push you to buy or install security software [8].

Not all multi-factor methods are equally strong. App-based codes, security keys and passkeys resist interception better than text messages; see our guide Is SMS 2FA Safe? What the SilentAir Attacks Show.

A laptop on a tidy desk beside a disconnected backup drive with its cable coiled, a padlock with a key and a phone
Updates, strong sign-in and a backup kept disconnected from your device are the core defences against malware.

How do organisations defend against malware?

Organisations use “defence in depth”: several layers of protection, on the assumption that some malware will get through, so it can be detected and contained before it does real harm [5].

The NCSC states plainly that there is no way to completely protect an organisation against malware, so it recommends layers of defence with several measures at each layer [5]. Its guidance is organised into four actions [5]:

  • Make regular backups, including offline copies kept separate from the network, and test restoring them.
  • Stop malware being delivered and spreading, with mail filtering, blocking of known malicious websites, multi-factor authentication on remote access and removal of permissions people no longer need.
  • Stop malware running, by allowing only trusted applications, restricting macros and scripts, turning off autorun and installing security updates quickly.
  • Prepare for an incident, with a tested response plan, contact lists available offline and a clear view of legal reporting duties.

NIST’s guide gives similar advice for desktops and laptops, pairing prevention with an incident response capability ready for widespread infections [1]. For individuals the lesson is the same on a smaller scale: no single tool is enough, but updates, backups, careful clicking and strong sign-in together make an infection much less likely and much less damaging.

Main types of malware at a glance
TypeHow it spreads or worksTypical harm
VirusInfects files; usually needs a user to open somethingDamaged or deleted files
WormCopies itself across networks without user actionSlowed or crashed systems, remote access
Trojan horseDisguised as useful softwareHidden harmful actions, other malware installed
SpywareHides and records activityStolen passwords and personal data
AdwareBundled with softwareUnwanted ads, tracking
RansomwareLocks devices or encrypts dataLost access, extortion, data leaks
RootkitHides deep in the operating systemLong-term hidden control
Possible signs of infection and what to do first
SignCould also beFirst step
Device suddenly slow or crashingOld hardware, full storage, a bad updateRun an up-to-date security scan
Pop-ups from unknown programsAdware bundled with a downloadCheck and remove recently installed apps
Friends get messages you did not sendA hacked account rather than a deviceChange the password from a clean device and turn on multi-factor authentication
Browser home page or search changedAn unwanted extensionRemove unknown extensions and reset the browser
Call or pop-up saying you are infectedAlmost always a scamHang up or close it; do not install or pay
Core defences and what each one blocks
DefenceWhat it helps stop
Automatic updatesMalware that exploits known software flaws
Multi-factor authenticationUse of passwords stolen by spyware or phishing
Trusted app sourcesTrojans hidden in fake or pirated software
Caution with attachments and linksViruses and Trojans delivered by email or message
Offline backupsPermanent data loss from ransomware or wipers
Security softwareKnown malware before it runs

Common mistakes

  • Calling every threat a “virus”.

    Fix: Virus is one type; malware is the umbrella term that also covers worms, Trojans, spyware and ransomware [2][4].

  • Delaying software updates.

    Fix: Turn on automatic updates; many infections exploit flaws that updates already fix [5].

  • Trusting a pop-up or caller who says your device is infected.

    Fix: Close it or hang up; such warnings are a common scam [6][8].

  • Keeping the only backup on a drive that is always plugged in.

    Fix: Keep at least one backup disconnected or in a service that protects older versions [5].

  • Opening an unexpected attachment because it came from a friend.

    Fix: Confirm with the sender another way first; their account may be compromised [4].

  • Rescuing files straight from an infected device.

    Fix: Restore from the last known clean backup instead [6].

Frequently asked questions

What is malware in simple words?

Software made to cause harm: to damage a device, steal information or take control of it without permission [1][2].

What is malware in cyber security?

In security terms it is code intentionally inserted into a system to compromise the confidentiality, integrity or availability of data, applications or the operating system [1][2].

Is a virus the same as malware?

No. A virus is one type of malware that infects files and copies itself; malware also includes worms, Trojans, spyware, adware and ransomware [2][4].

Can my phone get malware?

Yes. Phones can be infected, usually through malicious apps or links. The NCSC says a factory reset is often the safest fix for an infected phone or tablet [6].

What is a malware infection?

It means malicious code is running on your device. Signs can include slowness, pop-ups, programs opening by themselves or messages you did not send [6][8].

Do I need antivirus software?

For PCs and laptops, the NCSC recommends antivirus that updates regularly [6]. It works best alongside updates, backups and careful downloading [5][7].

Should you pay a ransomware demand?

Law enforcement does not encourage paying. The NCSC warns that paying does not guarantee your data back and leaves the device infected [5].

Glossary

Malware
Malicious software designed to harm, steal from or take control of a system [1][2].
Virus
Malware that infects files and copies itself, usually after a user action [4].
Worm
Malware that spreads between computers without human interaction [4].
Trojan horse
A harmful program disguised as something useful [4].
Spyware
Malware that secretly gathers information about a user’s activity [2].
Ransomware
Malware that locks devices or data and demands payment [3][5].
Defence in depth
Using several layers of security so one failure does not lead to a full compromise [5].

Sources

  1. SP 800-83 Rev. 1, Guide to Malware Incident Prevention and Handling for Desktops and Laptops US National Institute of Standards and Technology
  2. Glossary: malware NIST Computer Security Resource Center
  3. Malware, Phishing, and Ransomware US Cybersecurity and Infrastructure Security Agency
  4. Virus Basics US Cybersecurity and Infrastructure Security Agency · 2023-03-17
  5. Mitigating malware and ransomware attacks UK National Cyber Security Centre · 2020-02-13
  6. How to recover an infected device UK National Cyber Security Centre · 2018-12-17
  7. Cybersecurity Awareness Month: 4 core steps US Cybersecurity and Infrastructure Security Agency
  8. Malware (consumer information, archived copy) US Federal Trade Commission · 2015-09-05
Share this guide Telegram WhatsApp X
0 likes

Comments

Top comments

About the Pouyam Team Editorial policy

On Pouyam

Explore Pouyam

Guides are one corner of Pouyam. Here is where to go next.

Play and win dollar prizes

All games

Free online games with no download on Pouyam: every game earns season points, and the top players win dollar prizes.

Quick navigation