A virus represents the oldest form of malware and is by far the best known to the public. But what is a virus? What separates a virus from other forms of malware? How is a virus created, and how does it target its victim? This section explores these questions and how they affect you, the ethical hacker.

The Life and Times of a Virus

Let’s explore what it means to be a virus before we get too far along. Simply put, a virus is a self-replicating application that attaches itself to other executable programs. Many viruses affect the host as soon as they are executed; others lie in wait, dormant, until a predetermined event or time, before carrying out their instructions. What does the virus do then? Many potential actions can take place, such as these:
■ Altering data
■ Infecting other programs
■ Replicating
■ Encrypting itself
■ Transforming itself into another form
■ Altering configuration settings
■ Destroying data
■ Corrupting or destroying hardware