Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Metamorphic malware rewrites its own instructions for every new copy. Two samples of the same family can share no code at all and still do precisely the same thing.

What Is Metamorphic Malware?
Metamorphic malware rewrites its own body each time it propagates, so that every copy is a different sequence of instructions with identical behaviour. There is no encrypted payload sitting underneath, no key, and no decryption routine to catch. The code is in plain view and still matches nothing, because the version on this machine was never the version on the last one.
It is the most technically ambitious form of evasion ever built into malware, and in commercial terms it lost. Understanding why is more instructive than the technique itself.
A metamorphic engine carries a miniature compiler toolchain: it disassembles its own body, transforms the resulting representation, and reassembles working machine code with all offsets corrected. The transformations are individually simple.
The engine must also rewrite itself, which is the hard part. A bug that corrupts one generation propagates into every descendant, and the family dies quietly.
W32/Simile, also called Etap, appeared in 2002 and remains the reference implementation. Roughly 90 per cent of its 14,000 lines of assembly were engine rather than payload, and it could expand, shrink, and relocate its own code across generations. Zmist, released a year earlier, went further still: it disassembled the host program it infected and inserted its own instructions throughout the legitimate code, so the malicious body was not a contiguous block anywhere in the file. W32/Evol and a handful of others followed, then the lineage effectively stopped.
It stopped because the economics changed. Writing a correct metamorphic engine takes months of specialist assembly work. Renting a crypter that produces an equally unique file costs a few pounds per build and requires no skill at all. Server-side generation, where a fresh sample is compiled for every download, achieves the same result as metamorphism with none of the engineering risk. Attackers are rational about cost, and metamorphism never paid.
Polymorphic malware encrypts a constant body and mutates only the decryption stub. The original code is recoverable in full as soon as the stub has run, which is why emulation defeats it: let the sample decrypt itself in a controlled environment, then match the plaintext. Metamorphic malware has no such moment. There is no plaintext body to wait for, because the body genuinely differs. Detection has to work on what the code means rather than what it contains.
In practice, a defender today is far more likely to meet server-side polymorphism than a genuine metamorphic engine. The lesson carries across regardless: detection anchored to file content is fragile, detection anchored to what the code does is durable, and that distinction shapes how an endpoint estate should be configured and measured. At Privia Security, our endpoint security solutions prioritise behavioural coverage for exactly this reason.
Polymorphic malware keeps one constant body, encrypted, and varies only the decryption routine that unwraps it. Metamorphic malware has no encrypted body at all; it rewrites its own instructions so that each generation differs structurally while behaving identically. Polymorphic code can be recovered by letting it decrypt itself, whereas metamorphic code never reduces to a single recoverable form.
Very rarely as a full self-rewriting engine. The engineering cost is high, bugs are fatal to the family, and cheaper methods achieve the same evasion. Attackers now generate unique builds on the server for each download, or run payloads through commercial crypters. The outcome for a defender is the same, which is why detection must not depend on matching file contents.
Not through byte signatures, which is the whole point of the technique. Detection comes from emulating the sample and observing behaviour, comparing control flow structure rather than content, and applying machine learning models to structural features. Endpoint detection platforms that alert on actions such as persistence creation and credential access are effective regardless of how the code was arranged.
No, and that constraint is what makes detection possible. Every variant must perform the same operations to achieve the same objective, so the observable behaviour stays constant even when no two files share a byte. Rewriting is an evasion technique applied to the representation of the code, not a change to its purpose or its effects on a system.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.