Get fresh insights, pro tips, and thought starters–only the best of posts for you.
A companion virus is an older type of computer virus that disguises itself as a legitimate program by using the same file name but a different file extension. Instead of modifying the original file, it creates a separate malicious “companion” file that runs before the real program.
For example, if a real program is named accounts.exe, a companion virus may create a malicious file named accounts.com in the same location. When a user runs accounts, the system may execute the malicious file first, depending on how the operating system handles executable file priority.
A companion virus takes advantage of how some operating systems search for and run executable files. In older DOS-based systems, .com files often had execution priority over .exe files with the same name.
The attack usually works like this:
This made companion viruses harder to notice because the original program could still appear to work normally.
Companion viruses can execute malicious code without directly changing the original application. This can make them harder to detect using simple file-size or file-integrity checks.
Once active, a companion virus may spread, install additional malware, alter files, steal data, or disrupt system behavior. The risk increases when users run files from untrusted folders, removable drives, email attachments, or downloaded packages.
Classic companion viruses are mostly associated with older DOS and Windows environments. However, the general idea still matters. Modern malware may use similar tactics, such as masquerading as trusted files, abusing file paths, or placing malicious files where users or systems expect legitimate ones.
So, while the original technique is less common today, the lesson remains useful: file names alone do not prove that a program is trustworthy.
Organizations can reduce exposure by:
Companion viruses depend on users or systems running the wrong file. Hexnode helps reduce this risk by giving IT teams stronger control over what can run on managed endpoints.
With Hexnode UEM, organizations can manage approved apps, enforce device policies, restrict unauthorized applications, and monitor device compliance. For threat visibility, Hexnode XDR helps teams detect, investigate, and respond to suspicious endpoint activity that may indicate malware behavior.
Usually, no. It creates a separate malicious file with a similar name, then relies on execution order to run before the real program.
They often left the original file unchanged. Since they created a separate companion file, early security tools could miss them during basic file checks.