computer virus
termKept in this browser · My desk
A program that copies itself into other programs, documents or boot sectors, so that it runs, and spreads further, whenever its host is run.
Fred Cohen's 1984 definition still holds: a program that can infect other programs by modifying them to include a possibly evolved copy of itself, spreading with the rights of every user who runs an infected program. RFC 4949 adds that a virus cannot run by itself, which is what separates it from a worm, and the trojan horse differs again because it does not copy itself at all. In everyday speech every piece of malware is a virus; in the strict sense true viruses have become rare, and Kaspersky called KBOT, in 2020, the first living virus it had seen in the wild for years.
What the definitions say. Fred Cohen's 1984 paper defines a virus as a program that can infect other programs by modifying them to include a possibly evolved copy of itself, and the standards have kept that core. The glossary of the National Institute of Standards and Technology (NIST) carries the Committee on National Security Systems Instruction (CNSSI) 4009-2022 wording, taken from the ISO/IEC 2382:2015 vocabulary of the International Organization for Standardization and the International Electrotechnical Commission: software that propagates itself by modifying other programs to include a possibly changed copy of itself and that runs when the infected program is invoked, often causing damage and sometimes triggered by an event such as a predetermined date. RFC 4949, the Internet Security Glossary (Request for Comments), adds what separates it from a worm: a virus cannot run by itself and needs its host program to be run. NIST's 2005 malware guide, Special Publication (SP) 800-83, gives the anatomy: an infection mechanism, a payload that carries the virus's objective, and often a trigger, the condition that makes the payload run.
The word came from an experiment. Cohen conceived the first virus on 3 November 1983 for a weekly security seminar, Len Adleman suggested the name, and after eight hours of work on a heavily loaded VAX 11/750 running Unix it was demonstrated on 10 November. His account says the infection was planted in vd, a new program that drew Unix file structures, announced on the system bulletin board; every infection was made by hand, with traces and access controls, and nothing was damaged. In five attacks it obtained all system rights in under an hour, the fastest in under five minutes and the average under 30, and the half second it added to each run went unnoticed. The administrators then banned further experiments. In July 1984 a prototype on a Univac 1108 running a Bell-LaPadula system crossed user boundaries and moved up a security level after 18 hours of connect time, with five lines of assembly code, about 200 of Fortran and 50 of command files, and no bug involved: the model itself allowed the flow. His paper also proved that deciding whether a program is a virus is undecidable, both by looking at it and by watching it run, which is the formal reason no scanner can be complete. The Center for Education and Research in Information Assurance and Security (CERIAS) at Purdue University catalogues the paper as July 1984; a SANS Internet Storm Center diary dates it to February 1984 and notes that Gregory Benford's short story The Scarred Man had already used the word for a malicious program in 1970.
The kinds follow the host. NIST divides viruses into compiled ones, run by the operating system, and interpreted ones, run by an application. File infectors live in executables: Jerusalem, first seen at the Hebrew University in October 1987 (F-Secure dates a first version to as early as 1986), stayed in memory, infected .COM and .EXE programs and deleted the programs run on any Friday the 13th; NIST names it and Cascade as the best known. Boot sector viruses live in the code a machine runs before its operating system, the master boot record or the boot sector of a diskette, which need not even be bootable: an infected disk left in the drive at start-up is enough. Brain, Stoned and Ping-Pong were of this kind (see boot sector virus). Multipartite viruses use both, as Tequila did, infecting the master boot record and then executables from memory. Interpreted viruses live in documents and scripts (see macro virus), and polymorphic ones change their code with every copy (see polymorphic virus). NIST's 2013 revision notes that most modern samples blend virus, worm and trojan behaviour.
A file infector at its worst. Kaspersky describes CIH, also called Chernobyl, as a Windows 95 and 98 virus of about 1 KB that infected Portable Executable files, found in the wild in Taiwan in June 1998, released by its author while he was a student there; within a month infected files on United States game sites had made it global. Its time bomb went off on 26 April 1999 and, by Kaspersky's count, damaged about half a million computers: all lost the data on their hard drives, and many had their flash basic input/output system (BIOS) overwritten. The date marked the first version's release on 26 April 1998, not the 1986 disaster its nickname recalls.
How vendors name and test. Microsoft names detections by the Computer Antivirus Research Organization (CARO) scheme, type, platform, family, variant letter and suffix, and keeps Virus and Worm as separate types beside Trojan, Backdoor and Ransom; variant letters run in sequence, so .AF follows .AE. Kaspersky's classification says a virus does not use network services: a copy reaches another computer only when an infected object is carried there, on a network share, removable media or an email attachment. To check a scanner without a live sample, the European Institute for Computer Antivirus Research (EICAR) and CARO publish the EICAR test file, a 68-byte .COM file that products detect as if it were a virus.
The law treats spreading one as damage. The United States Computer Fraud and Abuse Act, in section 1030(a)(5)(A) of title 18 of the United States Code, punishes whoever knowingly causes the transmission of a program, information, code or command and thereby intentionally causes damage without authorization to a protected computer. In Brazil, Lei 12.737 of 30 November 2012 created article 154-A of the Penal Code, whose first paragraph gives the same penalty to whoever produces, offers, distributes, sells or spreads a program meant to allow the invasion; Lei 14.155 of 27 May 2021 raised the penalty from three months to a year of detention to one to four years of imprisonment, with a fine in both versions.
Rare in the strict sense, common in speech. A SANS diarist wrote in 2024 that calling any malicious code a virus is quite incorrect and that real viruses are mostly a thing of the past; the last to make an impact was KBOT, which Kaspersky described in February 2020 as arriving over the internet, a local network or infected external media, injecting its code into Windows executables and stealing banking data through web injects.
The defences grew from the same history: inoculation and scanners in the 1980s, integrity checking after the AIDS disk of 1989 showed that only checksums noticed a change, emulation against polymorphism, and today application control and least privilege, because a virus can only use the rights of the person who runs its host. Cohen's measurements of 1984 pointed the same way: a few highly connected users carried most of the sharing, and protecting them would slow a virus greatly. The history from the first experiments to today is in the Learn article on viruses and trojan horses.
Also known as: computer virus, file infector, file virus, multipartite virus, vírus de computador, vírus de arquivo
Sources
- Fred Cohen, Computer Viruses: Theory and Experiments, 1984, copy hosted by the University of Michigan (read 2026-11-23): a program that can infect other programs by modifying them to include a possibly evolved copy of itself, spreading with the authorizations of every user who runs it; conceived 3 November 1983, named by Len Adleman, demonstrated 10 November; all system rights in under an hour in five attacks; detection undecidable
- RFC 4949, Internet Security Glossary, Version 2, August 2007 (read 2026-11-23): a virus propagates by inserting a copy of itself into another program and cannot run by itself; it needs its host program to be run
- NIST SP 800-83 Revision 1, Souppaya and Scarfone, July 2013 (read 2026-11-23): viruses self-replicate by attaching to host programs or data files and usually need a user to run the host; compiled viruses (file infectors, boot sector, multipartite) and interpreted ones (macro, scripting); most modern instances blended
- F-Secure, virus description: Jerusalem (read 2026-11-23): a memory-resident file infector of .COM and .EXE files, first version as early as 1986; deletes programs run on Friday the 13th; dozens of variants
- F-Secure, virus description: Tequila (read 2026-11-23): written by two brothers in Switzerland; variable encryption; infects the master boot record, then .EXE files from memory
- Jan Kopriva, SANS Internet Storm Center diary, 6 February 2024 (read 2026-11-23): calling any malicious code a virus is quite incorrect; real viruses are mostly a thing of the past; KBOT as the last to make an impact
- Kaspersky, KBOT: sometimes they come back, 10 February 2020 (read 2026-11-23): the first living virus in recent years found in the wild, injecting its code into Windows executables and stealing banking data
- Fred Cohen, Computer Viruses, part 5, Experiments with Computer Viruses, 1984, Fred Cohen & Associates (read 2026-11-23): the first virus conceived on 3 November 1983, named by Len Adleman, written in 8 hours on a heavily loaded VAX 11/750 under Unix and demonstrated on 10 November; planted in the new program vd and announced on the system bulletin board; infections made by hand with traces and access controls, no damage; in five attacks all system rights in under an hour, the shortest under 5 minutes, the average under 30; under half a second of delay went unnoticed; administrators then banned further experiments; a Univac 1108 Bell-LaPadula prototype in July 1984 made its first infection after 18 hours of connect time, crossed user boundaries and moved to a higher security level, with 5 lines of assembly, about 200 of Fortran and about 50 of command files, no system bug involved; instrumentation from August 1984 found a few 'social' users accounting for most sharing
- CERIAS, Purdue University, Reports and Papers Archive, Computer Viruses: Theory and Experiments (read 2026-11-23): catalogues Fred Cohen's paper with the date 1984, July, a hard copy held in the CERIAS Library
- NIST Computer Security Resource Center, Glossary, virus (read 2026-11-23): CNSSI 4009-2022 from ISO/IEC 2382:2015, malicious software that propagates itself by modifying other programs to include a possibly changed copy of itself and is executed when the infected program is invoked, often causing damage and possibly triggered by an event such as a predetermined date; SP 800-28's 'replicates itself by attaching to other programs or files'; SP 800-82r3's RFC 4949-based 'cannot run by itself'
- Peter Mell, Karen Kent and Joseph Nusbaum, NIST SP 800-83, Guide to Malware Incident Prevention and Handling, November 2005, withdrawn July 2013 (read 2026-11-23): a virus has an infection mechanism, a payload and often a trigger; compiled viruses (file infector, boot sector, multipartite) and interpreted ones (macro, scripting); Jerusalem and Cascade as the best known file infectors; Form, Michelangelo and Stoned as boot sector viruses; Flip and Invader as multipartite; a diskette need not be bootable to infect at start-up; compiled viruses can stay resident in memory
- Kaspersky Threats, Virus.Win9x.CIH (read 2026-11-23): a Windows 95 and 98 parasitic virus of about 1 KB infecting Portable Executable files, also known as Chernobyl; found in the wild in Taiwan in June 1998, released by an author then studying at a local university; spread to US game distribution sites within about a month; its trigger damaged about half a million computers, all losing hard-drive data and many their flash BIOS; the first version released on 26 April 1998, hence the 26 April trigger; the class description says viruses do not use network services and reach other computers only when an infected object is carried there
- Microsoft Learn, Malware names (read 2026-11-23): Microsoft names detections by the CARO malware naming scheme (type, platform, family, variant letter, suffix); Virus and Worm are separate types beside Backdoor, Ransom, Trojan and others; variant letters are used sequentially, .AF after .AE; vendors sometimes name the same family differently
- EICAR, Anti Malware Testfile (read 2026-11-23): the EICAR test file, developed by EICAR and CARO and originally written by Paul Ducklin, lets people test anti-virus software without using a real virus; distributed as eicar.com, a 68-byte COM file
- Legal Information Institute, Cornell Law School, 18 U.S. Code 1030, Fraud and related activity in connection with computers (read 2026-11-23): subsection (a)(5)(A) punishes whoever knowingly causes the transmission of a program, information, code or command and as a result intentionally causes damage without authorization to a protected computer
- Presidência da República, Lei nº 12.737, de 30 de novembro de 2012 (read 2026-11-23): inserts article 154-A in the Penal Code, invasion of a computing device, detention of 3 months to 1 year and a fine; paragraph 1 applies the same penalty to whoever produces, offers, distributes, sells or spreads a device or computer program intended to allow the conduct; in force 120 days after publication
- Presidência da República, Lei nº 14.155, de 27 de maio de 2021 (read 2026-11-23): rewrites article 154-A of the Penal Code, invasion of a computing device, with imprisonment (reclusão) of 1 to 4 years and a fine; aggravation of one third to two thirds for economic loss; theft by fraud committed through an electronic or computing device, with or without a malicious program, 4 to 8 years