What Is a Computer Virus? Identify & Prevent Viruses

Computer viruses come in various forms, but almost all of them share the same purpose: to harm your computer or device. Though viruses may seem impossible to avoid, in this article, learn what computer viruses are, how they manifest, and how to access computer virus protection for your device and data.

What is a computer virus?

A computer virus is a piece of malicious code written with the intent of altering a computer’s basic operations. A computer virus attaches itself to a legitimate program, document, or attachment in order to get the user to download and execute it. Once executed, viruses damage the computer system as well as its data and files. They can steal passwords, change up data, log keystrokes, corrupt files, and worse.

By design, computer viruses spread from one device to another, meaning they can impact entire technology networks. They can remain dormant for long periods of time, but once they start causing damage, they typically don’t stop. Getting ahead of viruses to ensure that they can’t spread farther is key to the safety of your computer and others on the same computer network.

A person experiences a computer virus

How do computer viruses work?

Because there are several types of computer viruses, they don’t all work the same way. All computer viruses operate with the goal of damaging a device or network, but they can attack any device. Depending on the virus, a computer can be mildly affected or completely unusable.

Typically, as mentioned in the previous section, computer viruses attach to legitimate files or programs on a computer. They present themselves as safe online or in an email message, but when the user downloads them, they inadvertently download the virus to their device as well.

The virus then goes on to cause damage such as disrupting programs, deleting or altering files, clearing out hard drives, and inhibiting system performance. If the virus is controlled by a hacker, they can use it to gain access to your personal information, passwords, and bank account numbers.

Some viruses, like distributed denial-of-service Trojans, take over computers not to get to that specific device but to turn the device into part of a botnet for large-scale attacks. These viruses are either coded to spread or spread inadvertently through messages or email attachments.

Types of computer viruses

There are several different classes of computer viruses and malware. Beyond that, countless specific viruses have affected computer users over the years. Here are several common types of computer viruses that you might encounter.

Resident computer virus

A resident virus gets into a computer's memory and remains dormant until it delivers a payload. The term ‘payload’ refers to the part of the computer virus that causes harm, whatever that harm may be. In other words, the virus stays dormant until it’s time for it to execute its actions. A virus is either triggered to act by the user’s actions or by a specific deadline programmed into it.

Polymorphic virus

Polymorphic viruses are file infectors that can create modified versions of themselves independently. This helps them avoid detection. They use encryption keys to vary their physical file makeup, making it extremely difficult for traditional security programs to catch them because their code is frequently changing. Hackers use polymorphic code to avoid detection, too.

Boot sector virus

A boot sector virus attempts to harm the drive’s boot sector, which is the section responsible for directing the operating system so that it can connect to the interface. This makes the boot sector unusable, making the entire computer or device unusable as well. Boot sector viruses are typically spread via malicious USB drives. They activate when the user plugs in the USB device and boots up their computer.

Web browser hijacker virus

Browser hijackers can alter a computer’s browser settings to redirect users to malicious sites rather than their saved favorites or home page. The sites that the browser hijacker attacks turn into adware or phishing sites, which steal essential data from users.

Direct action virus

Direct action viruses cause immediate damage. When a user downloads a seemingly harmless file, it may have malicious code attached; in these cases, the direct action viruses get to work. They attach themselves to executable files, however; this means that, unlike other types of viruses, they tend to only spread when their file is executed. Once executed, the virus will self-replicate.

Macro virus

A macro virus embeds itself in Word documents or other word processors. It can either embed on its own or be downloaded from a phishing email. Because they don’t cause harm until the user runs the file, they are difficult to detect on an infected computer, much like Trojan viruses.

Overwrite virus

Overwrite viruses, as the name implies, are specifically designed to overwrite original files with their own code. They destroy the original code entirely, either piece-by-piece or systemically, which causes serious harm to the user’s system.

Multipartite virus

Multipartite viruses are disastrous, attacking both the boot sector and system’s executable files at the same time through file infectors. Because it attacks both the boot sector and the executable files, multipartite viruses are one of the most harmful viruses for a system. Once executed, the virus spreads and self-replicates. They are also known as hybrid viruses.

Signs you have a computer virus

If your computer has been infected by a virus, you may start to notice that strange behaviors in your device or programs. Keep an eye out for the following, which indicate you could have a computer virus.

  • Frequent pop-ups, both on your desktop and in your browser. Some popups are innocent, but if you notice that they are increasing, think twice. Often these pop-ups claim to notify you of a security breach or advertise necessary security software; in reality, they are malicious and contain viruses or other malware.
  • Strange emails or messages sent from your accounts. In an attempt to spread, viruses sometimes send emails or messages to your contact list. If you see strange messages in your “Sent” folder that aren’t from you, look into it.
  • A decrease in your computer’s speed or efficiency. Viruses impact the speed and usability of computers. Though all devices eventually slow down, especially with excessive bloatware, if you find that your computer is suddenly sluggish it could be a virus.
  • Frequent computer crashes or “blue screens of death.” All devices crash sometimes, but if you notice your computer crashes often, it’s a red flag. Viruses overload a computer’s system to the point of nonfunction, which leads to crashes or blue screens.

If you notice any other concerning changes in your computer’s abilities or files, run an antivirus scan to check for any problems.

How to prevent a computer virus

No user wants a computer virus, even if an attack only causes minimal damage. Prevention becomes key in order to prevent computer viruses, computer worms, Trojan horses, and all other types of malware. But with the diverse and elusive nature of viruses, how can users protect themselves?

The best way to prevent a computer virus is by installing antivirus software. Choose a quality program that protects against all kinds of malware and viruses; this software will act as your first – and strongest – layer of defense against viruses. Once you’ve installed it, make sure you keep the software up-to-date. If you consistently update your antivirus program and your device’s system, you will have a significantly better chance at blocking viruses before they can take root.

Furthermore, avoid accessing websites or opening emails that are at high risk for malware. Practice basic Internet safety and avoid shady websites, strange emails, and unsecured browsers. These simple steps go a long way in preventing viruses from attacking your device. If you get computer virus protection with a solid antivirus program, and remain wise in your online activity, you stand a great chance at preventing viruses.