Updated: 07/31/2022 by Computer Hope
Robotic bug on a laptop screen.

A computer virus is a malicious program, script, macro, or code designed to damage, steal personal information, modify data, send e-mail, display messages, or a combination of these actions.

When the virus is executed, it spreads by copying itself into or over data files, programs, the hard drive boot sector, or anything else writable. To help spread the virus, writers use knowledge of security vulnerabilities, zero-days, or social engineering to access a host's computer.

How does a computer get a virus?

There are many ways a computer can become infected with a computer virus or other malware. When a virus is made, it's often distributed through shareware, pirated software, e-mail, P2P programs, or other programs where users share data. Once downloaded, copied, or otherwise acquired, if the infected program is executed, it can potentially affect anything that a computer can access.

Virus protection

How to protect the computer from viruses

You can protect your computer from viruses by installing an antivirus protection program. Once installed on a computer, an antivirus monitors, detects, and cleans any computer viruses by looking for virus signatures.

The recommended method of detecting and cleaning the computer from any computer viruses or other malware is an antivirus or antimalware protection program.

Alternatively, a user can look at various aspects of the computer and detect possible signs indicating a virus is on the computer. While this method can locate some viruses, it doesn't determine the exact virus you may or may not have and is not recommended.

What can a virus do to a computer?

What a virus does to a computer depends on the type of virus. Most computer viruses delete data, overwrite information, display messages, and add itself to other files on the computer. Almost all computer viruses only damage the data on the computer and do not physically harm the computer or its hardware. For example, a non-resident virus can infect a specific file, and when accessed, it can spread to other files, corrupting those files and making them unreadable.

Below are some issues the computer may exhibit when infected with a virus. However, realize that many symptoms can also be caused by another computer-related issue and not a virus.

  • Delete some or all files without consent.
  • Cause various error messages in files or on programs.
  • Changes volume label.
  • Marks clusters as bad in the FAT.
  • Randomly overwrites sectors on the hard drive.
  • Replaces the MBR with own code.
  • Create more than one partition.
  • Access a non-existing drive, causing error messages like: "Invalid drive specification."
  • Causes cross-linked files.
  • Causes a "sector not found" error.
  • Decrease the speed of the computer, causing the system to run slow or be low on resources.
  • Create logical partitions or partitions decrease in size.
  • Make directories appear as garbage.
  • Modify the order of execution; for example, cause COM files to start before EXE files.
  • Cause hardware problems such as keyboard keys not working, printer issues, modem issues, etc.
  • Disable ports such as LPT or COM ports.
  • Cause keyboard keys to be remapped.
  • Alter the system time and date.
  • Cause system to hang or freeze randomly.
  • Cause activity on HDD or FDD randomly.
  • Increase file size.
  • Change file attributes.
  • Increase or decrease memory size.
  • Randomly change file or memory size.
  • Extend boot times.
  • Erase or completely wipe a drive.
  • Increase disk access times or make the computer always busy.
  • Cause a computer to make strange noises, make music, clicking noises, or beeps.
  • Display pictures randomly.
  • Unusual or undocumented error messages.

It is possible for more sophisticated viruses, like Stuxnet, to cause physical damage to components inside the computer or equipment controlled by a computer.

How viruses may affect a file

Viruses can affect any files; however, usually attack .com, .exe, .sys, .bin, .pdf, .pif or any data files

Viruses can infect any file, including executable files or data files, such as Microsoft Word documents or Excel spreadsheets. Most viruses target files used frequently to help spread the infection.

Increase the size of files

When infecting files, viruses increase the file size. However, with more sophisticated viruses, these changes can be hidden to make detection more difficult.

A virus can delete files as the file is run

Because most files are loaded into memory, once the program is in memory, it can delete the file used to execute the virus to hide its tracks.

It can corrupt files randomly

Some destructive viruses are designed to corrupt, lock, destroy, and delete files causes some or all data to be lost.

It can cause write-protect errors when executing .exe files from a write-protected disk

Viruses may need to write themselves to files that are executed; because of this, if a diskette is write-protected, you may receive a write-protection error.

It can convert .exe files to .com files

Viruses may use a separate file to run the program and rename the original file to another file extension, so the exe file is run before the com file.

Create copies of files

To help replicate, the virus may reproduce copies of itself or the files containing the virus throughout the computer.

It can reboot the computer when executed

Numerous computer viruses cause a computer to reboot, freeze, or perform other tasks not normally exhibited by the computer. However, realize that although your computer may be exhibiting these symptoms, it does not necessarily mean your computer has a virus.

Computer virus properties

Below is a list of different computer virus properties and each virus property. Realize that not all viruses infections have all of these abilities, and some properties are not listed.

Your computer can be infected even if files are only copied

Because some viruses are memory resident, once in memory (primary storage), it can infect any file or drive (secondary storage or off-line storage), even after the infected program is closed.

Illustration of interconnected circles, representing polymorphism.

They can be polymorphic

Some viruses can modify their code, which means one virus could have many different variants of itself. Polymorphic viruses can also change how they're delivered, such as changing the subject or body of the message to help keep them from being detected.

May be a stealth virus

Stealth viruses first attach themselves to other files on the computer before delivering their final payload. This type of tactic allows the virus to spread more rapidly.

Viruses can carry other viruses

Because viruses are only code, they can become infected with other viruses. Consequently, your computer can be infected with multiple viruses and infect a computer with each virus it contains.

It can make the system never show outward signs

Some viruses can hide changes made, such as when a file was last modified, making the virus more difficult to detect.

It can stay on the computer even if the computer is formatted

Some viruses can infect different portions of the computer, such as the master boot record, different partitions, or other areas. Also, if a computer virus is on a backup, it can re-infect the computer when the backup is restored.

Which operating systems are susceptible to viruses?

All operating systems can contract a computer virus or malware. Whether you use Android, iOS, Microsoft Windows, macOS, or a Linux variant, your computer and its programs or applications can be at risk of getting a virus and other malware.

Examples of computer viruses

Types of viruses

Below is a list of the different types of computer viruses. Visiting any of the following links gives you further information about that type of virus and its capabilities.

Appending virus
Boot sector virus
Cavity virus
CMOS virus
Companion virus
Encrypted virus
Executable virus
MBR virus
Macro virus
Multipart virus
Non-resident virus
Overwrite virus
Polymorphic virus
Rabbit virus
Resident virus
Spacefiller virus
Stealth virus

Specific viruses

Below is a listing of specific computer viruses and details about that virus. This list is a very small subset of the millions of different viruses that were released since the 1980s.

Alive.3400 virus trojan
Badtrans trojan virus
Blaster worm
Cap virus
CIH virus
E-Morph virus
Excel/Laroux virus
Flor virus
KAK virus
Live Stages virus
Lonely hearts trojan virus
Love letter virus
Melissa virus
Mutation virus engine
Nakedwife virus
Nimda virus
NYB virus
OVER 1644 virusResume worm
Satan Bug Natas virus
Sircam virus
Stoned Empire Monkey virus
Sulfnbk virus
VBS/Gnutella worm
VBS/[email protected] script virus

Can a virus physically damage my computer?

As they are only code, viruses and other malware are only capable of affecting the data on your computer and cannot physically damage it. However, there are viruses designed to physically damage computers or hardware equipment connected to computers and may even be potentially dangerous to humans. One of the most notable viruses capable of damaging hardware is Stuxnet, which was designed to target and enter industrial equipment, like nuclear reactors.

Can a virus infect a CD, DVD, or another disc?

No, a computer virus cannot infect a CD or DVD, as CDs or DVDs are locked (read-only) after being created, preventing additional files from being put on that disc. However, if during the creation of the disc, a virus is also copied to it, the disc would become infected.

When was the term "virus" first coined?

The concept of a computer program capable of reproducing itself was first mentioned by John von Neumann in his 1949 "Theory of Self-Reproducing Automata" essay. Later, Fred Cohen, in 1983, coined the term virus, describing it in a research paper as "a computer program that can affect other computer programs by modifying them in such a way as to include a (possibly evolved) copy of itself."

What was the first computer virus ever created?

The first computer virus, known as the Elk Cloner, was written (invented) by 15-year old high school student Rich Skrenta in 1982. The Elk Cloner virus spread to other computers by monitoring the floppy drive and copying itself to any floppy diskette inserted into the computer. Once a floppy was infected, it would infect all other computers that used the diskette. A computer that was infected would display a short poem on every 50th boot. After this virus and other viruses began being discovered, antivirus software was created to help clean the computers from viruses.

How many computer viruses exist today?

The exact number of computer viruses in existence today is complicated, if not 1impossible, to determine. In 2018, Kaspersky reported an estimated 187 million different viruses or related threats, including viruses and threats for computers and mobile devices.

New viruses, either original or variants of existing viruses, are created nearly every day. As such, antivirus companies, including Kaspersky, Symantec, and Trend Micro, update their list of known viruses daily.

What is the difference between malware and a virus?

Malware is a description of any malicious software, which includes computer viruses. Malware may also include spyware, Trojans, worms, or any other software designed with ill-natured intentions. See our malware page for further information.

Computer virus myths

Below are some comments we've come across that are common misconceptions with computer viruses and other malware.

"If I download a file onto a disk, I don't have to worry about viruses."

A file on a diskette or another drive (e.g., USB drive) can still be infected. Many viruses are memory resident and capable of loading themselves into memory. Once a diskette is placed in the computer, it could become immediately infected. Anywhere you can save or edit a file, a virus can infect.

"If I buy sealed software, I don't have to worry about viruses."
"If I buy registered software, I don't have to worry about viruses."

A program disc surrounded by plastic doesn't protect it from a virus. When software is saved onto a diskette or disc, if that computer is infected, the virus could also be saved. Although software from a developer is rarely infected, it's still possible and has happened.

"If I don't download anything from the Internet, I won't get a virus."

Although many of today's viruses and other malware come from downloading files, it's still possible to get infected without downloading. Also, when you are on the Internet, almost everything you view is downloaded to your computer.

"If I only read my e-mail, I will not have to worry about viruses."

Not true; some viruses are distributed through e-mail. Also, files can be attached to e-mail and, if executed, can infect the computer. Today, this is one of the most common ways computer viruses spread around the world.

"If I don't get on the Internet, I don't have to worry about viruses."

Although most viruses spread over the Internet today, a computer virus can infect from a diskette, disc, or USB drive. Also, if a computer connects to other computers over a local network, any other computer on the network could be invaded.

"You can contract viruses from looking at web pages."

True. Although it's more common to get viruses and malware from files you download, it's also possible to be infected by malware upon visiting a website. If a website has a bad ActiveX or JavaScript file, it's possible to spy on your browsing habits and infect the computer with malware and spyware.

"Computer viruses can infect humans."

False. A computer virus cannot infect humans and pose no danger because humans do not run on computer code. However, if the human has a computer-controlled device like a pacemaker, if the virus could access that device, it could be infected. So, in this rare situation, the human could technically catch a computer virus, and if the computer-controlled device helped keep that person alive, it could pose a danger to them.

"A computer that is turned off can be infected by a virus."

False. Computer viruses are software code, and like other programs you run on a computer, need a functional computer. A computer that is turned off or not otherwise working is safe from being infected by a virus.

What are the advantages and disadvantages of viruses?

If you read everything on this page, you can see numerous disadvantages to computer viruses, including deleting files, crashing computers, and impacting businesses. There are no advantages to computer viruses since most are malicious or cause the user grief. Although there are funny viruses that are not malicious and vigilante viruses that attack bad people or groups, we still don't consider them an advantage to computers or computer users.

What's the difference between a virus and a worm?

A worm self-replicates and executes without any initial interaction from a user, whereas a virus requires a user to perform an action (e.g., opening an infected file or installing a program).

What is the full form of "virus," or what is it short for?

The term "virus" is not an acronym. When referring to an antivirus (virus protection), the "anti" is a prefix that indicates a program helps protect against computer viruses.

Adware, Antivirus, Hard drive, Hoax, Infect, Intruder, Logic bomb, Security terms, Software terms, Threat, Trojan horse, Vaccine, Worm, Zoo