A computer virus is a type of malware that attaches itself to other programs, replicates itself, and spreads from one computer to another. When a virus infects a computer, it makes copies of itself and attaches itself to other files or documents. It then modifies these files and continues to spread.
Viruses infect computers silently and are often designed to destroy personal files or take control of devices. By creating copies of themselves, computer viruses spread across devices and networks, like biological viruses passing from one person to another. And, like the biological versions, some computer viruses are simply annoying, while others can cause serious damage.
How do computer viruses work?
A computer virus is an umbrella term that includes many different types of viruses, delivery mechanisms, and effects. To understand how computer viruses work, it's helpful to divide them into two categories: those that begin infecting and replicating as soon as they land on your computer, and those that lie dormant, waiting for you to unwittingly execute code.

How are computer viruses spread?
Computer viruses are typically spread through malicious online downloads, infected email attachments, or through the connection of infected hardware, such as an external flash drive (USB drive). Computer viruses can be spread by almost any file sharing method if the virus is not detected by antivirus programs.
Emails. A common method of attack by cybercriminals. Emails like those used in phishing attacks can contain malicious attachments, malicious links, or even an infection right in the HTML code of the email body.
Downloads. Hackers can hide viruses in applications, documents sent through file sharing services, plugins, and most other places where files are available for download.
Messaging services. Viruses can be spread through SMS messages or messaging services such as Facebook Messenger, WhatsApp and Instagram. Here, as in email, they also take the form of malicious links, attachments or executable files.
Old software. If you don't keep your apps or operating system up to date, you could be exposing yourself to vulnerabilities that cybercriminals can exploit to spread.
Malvertising. Viruses can be hidden in online advertising, such as banner ads placed through advertising exchanges. Malvertising allows attackers to hide malicious code even on legitimate and trusted websites, such as the New York Times and the BBC, which were both attacked.
What do computer viruses do?
Computer viruses hijack your system's code and resources to replicate, causing performance issues on all types of devices. When launched, a computer virus releases its payload and begins its attack. Almost immediately you will begin to see the consequences of what computer viruses are capable of.
What can viruses do to your computer? Here are some of the effects they can cause:
- Slow or stuttering performance
- Damaged or deleted files
- Continuous pop-ups or adware
- Program crash and operating system crash
- Constantly spinning hard drive
- Faulty apps, files, and other programs