How viruses work

It is not necessary to know how viruses work to take adequate precautions against them, but a broad understanding of three main types of virus helps understand the recommended preventative precautions. The help systems of recommended anti-virus software give more detailed information about how particular viruses work.

Partition sector and boot sector viruses

These viruses copy themselves into special hidden system areas of disks; the boot sector or the partition sector. All disks have a boot sector but only hard disks have a partition sector; viruses that infect the partition sector on the PC infect the boot sector of floppy disks. In effect such viruses infect disks rather than files. They are transferred from PC to PC on floppy disk, including floppy disks that do not have any files on them. If such a virus is on a floppy disk it will infect a PC only if the PC is booted (switched on, reset) with the infected disk in drive A. Once a PC is infected the virus is likely to infect all floppy disks used in it.

A good precaution against boot sector viruses is not to boot the PC with a floppy disk in the drive.

Back to top

File viruses

These viruses attach themselves to software (program files). Most vulnerable are files with extensions EXE, COM, DOS, BIN and SYS, but it is possible for any file containing executable (program) code to be infected. Such viruses are transferred from PC to PC in software, regardless of the means by which the software is distributed (for example floppy disk, CD-ROM, downloaded over networks, file-shuttled from another PC or restored from infected backup copies). When an infected program file is run the virus attempts to infect other program files.

A good precaution against file viruses is to obtain software only from reputable sources and to avoid downloading novelty software from the Internet (that is, download only those programs that are likely to be genuinely useful to you).

Back to top

Macro viruses and logic bombs

These infect files, but files normally considered to be data files rather than software. A macro virus or logic bomb may be present in a Word-for-Windows document (DOC file) or template (DOT file), or Excel spreadsheets (XLS file).  Less commonly, but possibly, they may also be present in Access databases (MDB files) and PowerPoint presentations (PPT files).  These files may contain 'autoexec macros'; that is, a sequence of instructions that are run automatically when the document or spreadsheet is opened. The macro may be designed to cause damage and to infect other documents, templates, or spreadsheets. Macro viruses and logic bombs are often distributed as attachments to electronic mail messages.

A good precaution against macro viruses and logic bombs is not to open files created by Office programs if these are from a source you do not trust (eg attachments to mail messages sent to you by people you do not know, or files downloaded from questionable web sites).

Back to top

Internet nuisances

As well as the viruses above, widespread use of the Internet has increased the hazards of computing. For further information see Data Safety and the Internet.

Back to top