Published Apr 10, 2023Updated Jun 5, 2023
Contribute to Docs

A virus is a type of malware that can infect a computer system. Viruses have two main functions:

  1. Destruction: Refers to the damage a computer virus can cause to a computer by deleting files or reformatting the hard drive.
  2. Propagation: When a virus self-replicates by placing a copy of itself into other programs across a network.

Virus In-Use

A virus’s payload delivers the destructive power and negatively impacts the confidentiality, integrity, or availability of systems or data. Common signs of computer viruses can include unwanted pop-up windows, programs that self-execute, accounts being logged out, and crashing of the device. The risk of a virus can be mitigated by installing anti-virus software, scanning on a regular basis, and backing up data.

Different Types of Viruses

There are many different types of viruses. They include:

  • Boot Sector Virus: Originated when computers booted from floppy disks, now commonly distributed by USB drives. It injects itself into the boot process of the computer.
  • Macro Virus: Found in programs such as Microsoft Word or Excel that host their own scripting language. These viruses can hide in file formats run by these programs such as .doc or .xlsx.
  • Parasitic Virus: Attaches to an executable file such as a .com or .exe and is executed with the host file.
  • Polymorphic Virus: Attempts to evade anti-virus software by altering its own code each time it’s run.
  • Web Scripting Virus: Exploits vulnerabilities in browsers to install malicious software. Can be found on unsafe websites or even in malicious banner ads.

All contributors

Looking to contribute?

Learn Cybersecurity on Codecademy