Skip to content
Anexet
Abstract illustration for «Polymorphic Virus»

Polymorphic Virus

A polymorphic virus is malware that hides its code under an encryption layer with a new key in every copy, so the copies look different while the hidden code stays the same.

Anexet Team
November 12, 2026Read 3 min

What a polymorphic virus is

A polymorphic virus is a self-replicating program that changes its outward form without changing what it does. Each copy is wrapped in a new encryption layer, so two copies can share almost no bytes. A scanner that compares files byte by byte finds nothing in common between them, and that is the threat's main advantage.

The idea is simple: the visible form changes on every copy while the job stays the same. The job depends on the payload, which can be anything from file damage to a keylogger that records what users type.

How the encrypted wrapper works

The mechanism needs two parts that change and one that does not. The steps describe the idea at a high level, not how the code is built.

  1. 1

    Hide the body

    The main program is stored in encrypted form, so the file does not show its instructions.

  2. 2

    Choose a new key

    Each new copy is encrypted with a different key, so its bytes differ from every earlier copy.

  3. 3

    Attach a decryptor

    A short routine in readable form is added to the file to restore the body.

  4. 4

    Restore and run

    When the file starts, the decryptor rebuilds the body in memory and the program carries out its task.

Where the pattern still shows

The encrypted body gives away little, but the decryptor has to be readable, because the computer must be able to run it. Analysts therefore compare the layers, since each one changes in a different way between copies.

LayerChanges between copiesWhat it offers analysts
Encrypted bodyCompletely, with each keyAlmost nothing, it looks like random data
Decryptor routineRewritten for each copyA short routine whose instruction patterns can be matched
Decrypted bodyIdentical in every copyA stable target once it is in memory

How defenders catch it

The body appears only while the program runs, so detection has to catch that moment or match the part that never changes. Three approaches do this in practice.

  • Pattern matching on the decryptor, which is shorter than the body and can be checked against known samples.
  • Emulation, where the file runs for a short time in a controlled environment so the body is decrypted where it can be inspected.
  • Behavior monitoring, which flags self-copying, writes to other programs and unexpected network traffic whatever the code looks like.

Common mistakes

Most gaps come from treating the virus as the whole incident. Three habits make a polymorphic infection more costly than it needs to be.

A copy that never matches a known pattern can run unnoticed, so what it does and where data moves matter as much as the match.

  • Relying on a single signature scan, which can only find decryptors that were recorded before.
  • Ignoring removable media and email attachments, the usual routes a copy takes to a new machine.
  • Focusing on cleanup and forgetting the data exfiltration that may already have happened.

Where to start

Start with the machines that hold the most sensitive data, then list the routes that data uses to leave: email, web uploads and removable devices. A decryptor can change from copy to copy, but a file that leaves through a monitored route can be seen and limited.

Anexet DLP works at that layer. It watches the channels that data leaves through, as an endpoint data loss prevention control does, so a leak can be limited even when the infection itself goes unrecognized.

The code can change with every copy, but the data still has to leave the building.

Anexet Team

Frequently Asked Questions

Common questions about this term and how Anexet handles it.

The body has to run in readable form, so the virus carries a short routine that restores it in memory. The processor can only run readable instructions, which is why that routine is the part analysts most often match.

Often, but not with one fixed pattern. Scanners match the decryptor, emulate the file to see the body or watch behavior. Layered checks catch more variants than any single method.

Anexet is not an antivirus scanner. Anexet DLP limits which data can leave a computer through monitored channels, so a leak can be limited even when the infection is not recognized.

Protect your data with Anexet

See how Anexet stops data leaks, monitors employee activity, and keeps you compliant, in a quick live demo.

Request a demo