Computer Virus
A computer virus is a type of malicious software that spreads by modifying other programs or files to include a copy of itself, and runs when the infected program is invoked. A virus cannot run by itself; its host program must run to make it active.
Updated
Overview
Viruses are often triggered through user interaction, such as opening a file or running a program. A virus often causes damage and may be set off by an event such as a predetermined date. Some spread by copying themselves across systems and networks as well as by attaching code to other programs.
NIST divides viruses into two subcategories. Compiled viruses are executed by the operating system. They include file infector viruses, which attach to executable programs; boot sector viruses, which infect the master boot records of hard drives or the boot sectors of removable media; and multipartite viruses, which combine the two. Interpreted viruses are executed by an application: macro viruses use an application's macro programming language to infect documents and templates, and scripting viruses infect scripts.
Antivirus software is the most commonly used technical control against malware. NIST recommends configuring it to scan each file as it is downloaded, opened, or executed, and keeping its signatures fully up to date. Host-based intrusion prevention products that monitor attempted changes to files can also detect viruses trying to infect files. For personal devices, the FTC advises scanning USB drives and other external devices before using them.
Similar Terms
2 termsComputer Worm
A virus needs a host program or file and is often triggered by user interaction. A worm is self-contained, needs no host program, and usually executes itself without user intervention.
Malware
Malware is the general term for harmful software installed without the user's knowledge. A virus is one common type of malware, defined by how it spreads: by inserting copies of itself into other programs or files.
Frequently Asked Questions
How does a computer virus spread?→
A virus inserts copies of itself into host programs or data files, and the infected program must run for the virus to become active. Boot sector viruses can infect the boot sectors of removable media, and the FTC advises scanning USB drives and other external devices before using them.
What is a macro virus?→
A macro virus is an interpreted virus that uses an application's macro programming language to infect documents and document templates.
Is a virus the same as malware?→
No. Malware is the broader category, and viruses, worms, and trojan horses are classic types of it. Many instances of malware today are blended attacks that combine several methods, for example the propagation methods of both viruses and worms.
Related
Tool categories
Career roles
Glossary terms
Sources
Definitions follow the government and standards body sources listed above. This site is not affiliated with the agencies or organizations cited.