VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

What is a Computer Virus | Malware, Infection and Device Protection

Original conceptual educational illustration of a secure padlock and shield, network credentials, and a broken defensive connection.

What is a computer virus? A computer virus is a type of malicious software (malware) that attaches itself to a legitimate file or program and can replicate when that infected host is run or shared. It may alter files, disrupt a device, steal information or deliver other harmful code. The key feature is that a virus depends on a host, whereas other kinds of malware may spread or operate in different ways.

People often use ‘virus’ to mean any harmful software, but the wider word is malware. Worms, trojans, spyware, ransomware and rootkits are different categories, although one malicious program can combine several behaviours. Understanding the difference helps people recognise why an infected file, a deceptive app and a password-stealing website require different responses.

Quick notes: A virus infects a host file or program. A worm can spread independently across systems or networks. A trojan disguises itself as something legitimate. Ransomware attempts to deny access to data, often by encrypting it. Antivirus tools can help detect and block threats, but no product catches everything. Keep devices and apps updated, use reputable software, protect accounts and make backups that are not permanently connected.

What makes a computer virus a virus?

A traditional computer virus inserts or attaches malicious code to a host, such as an executable file, document macro or other content that can cause code to run. When the infected host is opened or executed, the virus may run and attempt to infect other files or locations. Some viruses require a user action; others exploit software weaknesses to trigger execution.

The defining concept is replication through a host. Not every malicious program replicates, and not every unwanted program is a virus. A password-stealing trojan, for example, can be highly damaging without behaving like a classic file-infecting virus.

Virus, worm, trojan and malware: what is the difference?

  • Malware: the broad category for software or code designed to cause harm, steal data, disrupt systems or gain unauthorised access.
  • Virus: malware that infects a host file or program and may replicate when that host is run or shared.
  • Worm: malware that can replicate and spread between systems without needing to attach itself to a host file in the same way.
  • Trojan: malware disguised as legitimate or useful software to persuade someone to install or run it.
  • Ransomware: malware that blocks access to data or systems, commonly by encrypting files, and demands payment.
  • Spyware: software that secretly collects information about a user or device.
  • Rootkit: tools or components designed to conceal malicious activity or maintain privileged access.

These categories are not always exclusive. An attack may use a trojan to install ransomware, or a worm-like component to spread a payload across a network. The labels describe behaviours and delivery methods rather than mutually exclusive boxes.

How a computer virus can infect a device

  1. Delivery: an infected file, removable drive, malicious download or compromised software reaches a device.
  2. Execution: a user or a software process opens the host or triggers the vulnerable behaviour.
  3. Infection: the malicious code attaches to other files or modifies the system, depending on its design.
  4. Replication: the virus attempts to spread to other hosts or devices.
  5. Payload: it may corrupt data, steal information, disrupt work or download further malware.
  6. Detection and response: security software or an administrator may identify the activity and isolate the affected device.

Not all infections follow this exact sequence. Some malicious programs do not replicate at all, and modern attacks often use several stages. The useful question is what happened on the device and whether accounts, files or connected systems may also be affected.

How viruses spread

Infected attachments and files

An email or messaging attachment may contain an infected document or executable. A document can also use active content or macros in ways that create risk. Treat unexpected attachments with caution, especially when a sender urges immediate opening or asks you to enable unusual features.

Removable storage

A USB drive or other removable device can transfer infected files between computers. Do not plug in unknown drives, and follow your organisation’s scanning and device-use policies.

Unsafe downloads and fake installers

A download site may advertise a useful application but provide a bundled installer containing unwanted or malicious components. Download software from the official provider or a trusted app store, check the publisher and avoid repackaged installers from unfamiliar sources.

Compromised or unpatched software

Attackers may exploit software weaknesses to run malicious code. Security updates fix known vulnerabilities, so delaying patches leaves devices exposed to issues that vendors may already have addressed.

What does a computer virus do?

The effects depend on the code and its permissions. Some viruses corrupt or delete files; others make changes that cause programs to fail. A malicious program may steal data, install other malware, disrupt operations or create a route for further compromise. Some infections are designed to stay hidden rather than display an obvious warning.

A device that is slow, hot or displaying pop-ups is not necessarily infected with a virus. Those symptoms can also result from ordinary software errors, insufficient storage, browser notifications, background updates, failing hardware or unwanted applications. Do not diagnose an infection from one symptom alone.

Signs that a device may be compromised

  • Unexpected security alerts or software detections.
  • Unknown applications, browser extensions or system changes that you did not authorise.
  • Files that have changed names, become inaccessible or appear to be encrypted.
  • Unusual account sign-ins, messages sent without your knowledge or suspicious network activity.
  • Security tools that have been disabled unexpectedly or settings that keep changing.
  • Unusual pop-ups or redirects, especially when combined with other signs.

These signs are reasons to investigate, not definitive proof of a virus. A reputable security scan, review of installed applications and help from a trusted IT professional can help determine what is happening.

How to reduce the risk of computer viruses

  1. Keep software updated: install security updates for the operating system, browser and applications from trusted sources.
  2. Use reputable security protection: keep built-in or trusted anti-malware tools enabled and update their detection information.
  3. Download carefully: use official websites and trusted app stores; check the publisher before installing.
  4. Be cautious with attachments: verify unexpected files through a separate channel before opening them.
  5. Use a standard account: avoid doing everyday work with administrator privileges when they are not needed.
  6. Back up important files: keep versioned or offline copies so that one compromised device cannot change every backup.
  7. Protect accounts: use unique passwords and multi-factor authentication, and do not approve unexpected sign-in prompts.

These controls reduce risk but do not guarantee prevention. A security tool can miss a new or modified threat; a patched device can still be tricked into revealing a password; a backup can be useless if it has never been tested. Security is a combination of technology, habits and recovery planning.

What to do if you suspect a computer virus

Do not rush to download another ‘cleaner’ from a pop-up. A fake warning may itself be part of a scam. Use your device’s trusted security settings or a reputable support route. If the device is part of a workplace or school network, contact the responsible IT team promptly.

  1. Stop sensitive activity: avoid online banking, shopping or entering passwords on a device you suspect is compromised.
  2. Disconnect if appropriate: if there is active suspicious behaviour or an organisation instructs you to do so, disconnect the device from networks to limit spread; follow IT instructions for managed devices.
  3. Use trusted security tools: run an up-to-date scan or follow the organisation’s incident-response procedure.
  4. Protect accounts from a clean device: change important passwords from a known-good device, prioritise email and financial accounts, and revoke unfamiliar sessions where possible.
  5. Check backups: preserve unaffected copies and do not reconnect backup drives until the device has been assessed.
  6. Seek help and report: record what happened, alert the responsible IT team or service provider, and contact your bank immediately if payment details or transactions may be affected.

For ransomware or suspected data theft, do not assume that paying an attacker will restore files or protect stolen information. Follow your organisation’s incident plan and seek qualified assistance. Preserve evidence where possible and avoid making changes that could destroy useful information.

Why backups matter

A backup is a separate copy of information that can be restored after deletion, corruption, device failure or attack. A synchronised folder is not always a true backup: unwanted changes or encrypted files may synchronise to the other copy. Effective backup plans often include version history, multiple copies and at least one copy that is protected from routine access by the affected device.

Test restoration, not merely backup creation. A green check mark can confirm that a process ran, but only a successful restore test demonstrates that the files can actually be recovered. Keep backup credentials and storage appropriately protected.

What antivirus and anti-malware software can do

Security software can scan files, monitor behaviour, block known malicious sites, isolate suspicious items and help remove some threats. Different products use signatures, reputation, heuristics and behaviour analysis. Their coverage and capabilities vary, and false positives or missed detections are possible.

No security tool can guarantee that a device is free from every threat. Users still need updates, careful installation habits, account protection and backups. For a school-level comparison of anti-malware, firewalls and encryption, read G3 Computing: Security Safeguards.

Computer virus versus phishing

A computer virus is malicious code that infects a host and may replicate. Phishing is a deceptive attempt to make a person reveal information or take an unsafe action. A phishing message may deliver malware, but it may also simply steal a password through a fake login page. The two terms describe different parts of an attack.

Learn how to recognise deceptive messages in What Is Phishing?. For another common threat, read How a Fake Tech Support Pop-Up and Malware Scam Works.

Frequently asked questions about computer viruses

What is a computer virus in simple words?

It is a type of malware that attaches to a host file or program and can replicate when that host is run or shared.

Is every malware a virus?

No. Malware is the broad category. Worms, trojans, ransomware and spyware are other types of malicious software.

Can a phone get a computer virus?

Phones can be infected or compromised by malicious apps, spyware and other threats. The exact terminology and infection methods differ across operating systems.

Can antivirus remove every virus?

No. Security tools can detect and remove many threats, but no product guarantees detection of every malicious program.

Does a slow computer mean it has a virus?

Not necessarily. Slow performance has many possible causes. Investigate multiple signs and use trusted diagnostic tools.

Can a virus steal passwords?

Some malware can capture credentials or other sensitive information, but phishing and account attacks can also steal passwords without a virus.

What is the safest way to recover files?

Use verified, unaffected backups after the device has been assessed and cleaned. Follow trusted IT guidance if the device is managed or the incident involves ransomware.

Continue learning at eduKateSG

For the wider topic of online deception, read What Is Phishing?. For protections at device and network level, continue with Anti-Malware, Firewalls and Encryption. These pages explain different layers of digital safety.

Sources and further reading

The US Cybersecurity and Infrastructure Security Agency (CISA) provides practical guidance on updates, strong passwords, multi-factor authentication and phishing. The UK National Cyber Security Centre provides accessible security advice. For managed devices, follow the procedures of your school’s or employer’s IT team. This is an educational overview, not a diagnosis of a particular device.