A virus reproduces, usually without your permission or knowledge. In general terms they have an infection phase
where they reproduce widely and an attack phase where they do whatever damage they are
programmed to do (if any). There are a large number of virus types.
Viruses are a cause of much confusion and a target of considerable misinformation even from some virus "experts." Let's define
what we mean by virus: A virus is a program that reproduces its own code by attaching itself to other programs in such a way that the
virus code is executed when the infected program is executed.
You could probably also say that the virus must do this without the permission or knowledge of the user, but that's not a vital
distinction for purposes of our discussion here. We are using a broad definition of "program" and "attach" here. A program may be
a COM or EXE file, an overlay or library file used by an EXE file, the macro portion of what you might generally consider to be a
data file (e.g., a Microsoft Word document), or the system sectors on either a hard or floppy disk. To attach might mean physically
adding to the end of a file, inserting into the middle of a file, or simply placing a pointer to a different location on the disk
somewhere where the virus can find it.
Most viruses do their "job" by placing self-replicating code in other programs, so that when those other programs are executed, even more programs are "infected" with the self-replicating code. This self-replicating code, when triggered by some event, may do a potentially harmful act to your computer.
Another way of looking at viruses is to consider them to be programs written to create copies of themselves. These programs attach these copies onto other programs (infecting these programs). When one of these other programs is executed, the virus code (which was attached to that program) executes, and links copies of itself to even more programs.
General Virus Behavior
Viruses come in a great many different forms, but they all potentially have two phases to their execution, the infection phase and the attack phase:
1) Infection Phase:
When the virus executes it has the potential to infect other programs. What's often not clearly understood is precisely when it will infect the other programs. Some viruses infect other programs each time they are executed; other viruses infect only upon a certain trigger. This trigger could be anything; a day or time, an external event on your PC, a counter within the virus, etc. This brings up an important point which bears repeating: It is a serious mistake to execute a program a few times - find nothing infected and presume there are no viruses in the program. You can never be sure the virus simply hasn't yet triggered its infection phase!
2) Attack Phase:
Many viruses do unpleasant things such as deleting files or changing random data on your disk, simulating typos or merely slowing your PC down; some viruses do less harmful things such as playing music or creating messages or animation on your screen. Just as the infection phase can be triggered by some event, the attack phase also has its own trigger.
Does this mean a virus without an attack phase is benign? No. Most viruses have bugs in them and these bugs often cause unintended negative side effects. In addition, even if the virus is perfect, it still steals system resources.
There are several categories of viruses:
|System Sector Viruses||"Data" File Viruses||Cluster Viruses|
|File Viruses||Companion Viruses||Batch File Viruses|
Viruses are sometimes also categorized by how they infect:
|Polymorphic Viruses||Sparse Infectors||Cavity Viruses|
|Stealth Viruses||Armored Viruses||Tunnelling Viruses|
|Fast and Slow Infectors||Multipartite Viruses||Camouflage Viruses|
And, in a special category:
Viruses are one of many threats, but a serious one if you are infected. Take precautions!
A virus is a program that reproduces its own code.
Generally, the first thing a virus does is to reproduce (i.e., infect). The reproduction may be immediate and rapid or delayed and slow. On some defined trigger, some viruses will then activate; but even if they did not, they still take up system resources.
The categories of viruses are many and diverse. There have been many made and if you get one it should be taken seriously. Don't be fooled by claims of a good virus; there is no reason at the moment to create one.