GRC Careers

HomeResourcesComputer Viruses

CS-011 · Malware

Computer Viruses

Malicious code that attaches to a host file and spreads when that file is run.

Executive Summary

A computer virus is malicious code that inserts itself into a legitimate host file or program and runs when that host is executed. Unlike a worm, a virus needs a user or process to launch the infected file before it can spread. Once active, it can copy itself into other files and deliver a payload that ranges from harmless to destructive.

What It Is

A computer virus is a type of malware that cannot exist on its own. It embeds its code inside a host, such as an executable program, a document with macros, or a boot sector, and it activates only when that host is opened or run. This dependence on a host and on user action is what distinguishes a virus from other malware families. Viruses are usually organized around three parts: an infection mechanism that finds and attaches to new hosts, a trigger that decides when the payload fires, and the payload itself, which is the action the virus performs. Common historical types include file infectors that attach to programs, macro viruses that live inside office documents, and boot sector viruses that load before the operating system.

Why It Matters

Even though pure self-replicating viruses are less common today than blended threats, the concept remains central to how professionals think about malware. Understanding infection, triggering, and payload delivery is the foundation for analyzing modern threats, most of which reuse these ideas. A single infected file shared across a network can disrupt operations, corrupt data, and open a path for further compromise. For anyone building a security career, being able to explain how a virus attaches to a host and why user execution matters is a baseline expectation in interviews and on the job.

How It Works

A virus begins when a user runs or opens an infected host, such as launching a program or enabling macros in a document. The infection routine then searches for other suitable hosts and writes copies of the virus into them, so the infection can spread each time one of those files is used. Many viruses try to avoid detection by encrypting or rearranging their own code, a technique broadly described as polymorphism or metamorphism, so that each copy looks different to simple signature scanners. The payload may fire immediately or wait for a trigger such as a specific date, a number of executions, or a particular condition. Because the virus rides inside legitimate files, it can travel through email attachments, shared drives, and removable media wherever those files go.

Architecture Diagram

User runs infected host fileInfection routine finds new hostsVirus copies itself into themTrigger condition is checkedPayload executes
A virus spreads only after an infected host is executed, then attaches copies to new hosts before or after firing its payload.

Visual Workflow

An infected host file arrives by email, download, shared drive, or removable media.A user or process executes the host, activating the virus code.The infection routine locates other suitable files to infect.The virus writes copies of itself into those new hosts.The trigger is evaluated and, when met, the payload runs.Infected files continue to spread the virus wherever they are shared.

Common Attacks

Common Mistakes

Best Practices

Quick Checklist

Recommended Tools

Endpoint protection or antivirus
Detects and blocks known and suspicious file-based malware
Endpoint Detection and Response (EDR)
Watches for malicious behavior and enables containment and response
Sandbox or detonation service
Runs a suspicious file safely to observe what it does
File hashing and reputation lookup
Checks whether a file is known good or known malicious

Industry Standards

NIST SP 800-83
Guidance on preventing and handling malware incidents on endpoints
NIST SP 800-61
Computer security incident handling, including malware containment and recovery
CIS Critical Security Controls
Malware defenses and secure configuration as practical safeguards

Career Relevance

Understanding viruses is foundational for SOC analysts, incident responders, and malware analysts who must recognize infection, triggering, and payload behavior. Security engineers apply this knowledge when configuring endpoint defenses and hardening systems, and GRC and audit professionals rely on it to assess whether malware controls are in place. For the AI-Governance-Jobs.com audience, malware literacy is a common expectation across security and technology roles.

Interview Questions

Related Certifications

CompTIA Security+ ISC2 Certified in Cybersecurity (CC) GIAC Reverse Engineering Malware (GREM)

Further Reading

Key Takeaways

Download PDFDownload PNG

FAQ

Is a virus the same as malware?

No. Malware is the umbrella term for all malicious software. A virus is one specific type of malware defined by the way it attaches to a host file and spreads when that file is run.

Why do viruses need a host file?

A virus is not a standalone program. It relies on a legitimate host, such as an executable or a document with macros, to carry and launch its code. This is a key difference from a worm, which can spread on its own.

Does antivirus stop every virus?

It stops many, especially known ones, but no single product is perfect. Layering endpoint protection with patching, least privilege, macro controls, and tested backups gives much stronger coverage than any one tool.

Get all 116 reference sheets
The complete AGJ Cybersecurity Professional Reference Library, print-ready PDFs and PNGs.
Browse the library

Related Careers

Related certifications

CompTIA Security+ISC2 Certified in Cybersecurity (CC)GIAC Reverse Engineering Malware (GREM)

Current openings

Live openings appear on the web version. Browse the job board for current GRC and security roles.
Browse all jobs

Suggested learning path

  1. Ground the basics with CS-001 Cybersecurity
  2. Study this sheet: Computer Viruses
  3. Go deeper: Trojans
  4. Go deeper: Worms
  5. Validate it: work toward CompTIA Security+
  6. Find the role: browse current openings

Related sheets

More in Malware

Share this LinkedIn Facebook X Email