Like HowStuffWorks on Facebook!

How Computer Viruses Work

Virus Evolution

Virus creators have added new tricks to their bag throughout the years. One such trick is the ability to load viruses into memory so they can keep running in the background as long as the computer remains on. This gives viruses a much more effective way to replicate themselves. Another trick is the ability to infect the boot sector on floppy disks and hard disks. The boot sector is a small program that is the first part of the operating system that the computer loads. It contains a tiny program that tells the computer how to load the rest of the operating system. By putting its code in the boot sector, a virus can guarantee it's executed. It can load itself into memory immediately, and run whenever the computer is on. Boot sector viruses can infect the boot sector of any floppy disk inserted in the machine, and in places like college campuses, where lots of people share machines, they can spread like wildfire.

In general, neither executable nor boot sector viruses are very threatening today. The first reason for their decline has been the huge size of today's programs. Most programs you buy today come on compact discs. Commercially distributed compact discs (CDs) cannot be modified, and that makes viral infection of a CD unlikely, unless the manufacturer permits a virus to be burned onto the CD during production. People certainly can't carry applications around on floppy disks like they did in the 1980s, when floppies full of programs were traded like baseball cards. Boot sector viruses have also declined, because operating systems now routinely protect the boot sector.

Infection from boot sector viruses and executable viruses is still possible. Even so, it's a lot less likely than it once was. Call it "shrinking habitat," if you want to use a biological analogy. The environment of floppy disks, small programs and weak operating systems made these viruses possible in the 1980s, but that environmental niche has been largely eliminated by huge executables, unchangeable CDs and better operating system safeguards.

E-mail viruses are probably the most familiar to you. We'll look at those in the next section.

More to Explore