Viruses were once the most common type of harmful program found, with literally hundreds of thousands of viruses in the wild. Nowadays however, as modern software security practices have made it much harder for attackers to create functional viruses, most harmful programs found today are likely to be trojans.
A virus almost always arrives as an executable file. The virus file is most popularly distributed as an email attachment, or as part of a trojan's payload. Some viruses are distributed using more sophisticated distribution methods such as:
Other ways viruses can be spread are through removable media such as floppy disks, CDs or USB thumb drives.
Once the virus file is run, it begins its attack on the files on the computer. Each time a host file is run, the virus code in it will replicate - that is, it will create and insert more unwanted code, either into the same file or into another file on the same machine (essentially infecting the other file as well).
Viruses can be sub-categorized based on the type of files they are designed to infect. The most common sub-types are:
- File viruses - targets executable or data files, such as applications, games and documents
- Boot viruses - targets the separate, critical boot sector of an operating system, which holds instructions for starting the computer
As the replication process repeats, the increasing additions of unwanted code can disrupt the host file's normal operations. If it happens often enough, the virus code can completely corrupt the host file. If enough files are infected, the entire computer may be completely disrupted.
In addition to infecting files, a virus can often perform other harmful actions. These actions can range from simple nuisances to severely harmful:
- Changing the desktop background
- Playing sounds or displaying images
- Deleting files and programs
- Modifying or stealing sensitive data files
Depending on what other actions the virus performs, the impact of an infection can range from annoying to devastating.