Skip to content

Polymorphic & Metamorphic Malware

Risk Level

Polymorphic malware automatically changes its code signature on each replication while maintaining its core function, evading signature-based antivirus. Metamorphic malware goes further — rewriting its entire code structure so that each copy is functionally equivalent but structurally completely different, defeating even heuristic detection.

AspectPolymorphicMetamorphic
MechanismEncrypted payload + variable decryptorFull code rewrite
SignatureChanges each replicationChanges each replication
DecryptorMutated each generationNo decryptor (no encryption)
Code StructureSame, just encryptedCompletely rewritten
Detection DifficultyHigh (signatures fail)Very High (heuristics fail)
ComplexityModerateVery High
MilestoneYearDetails
1260 Virus1990First true polymorphic (Mark Washburn)
DAME1992Dark Avenger Mutation Engine; toolkit
Tremor1993Polymorphic engine toolkit
SMEG1994Simulated Metamorphic Encryption Generator
W32/Simile200290%+ code change per generation
MetaPHOR2002Metamorphic engine
Virut2006Polymorphic file infector + botnet
Sality2003+Polymorphic file infector + worm
1. ENCRYPTION LAYER
└─ Payload encrypted with variable key
└─ Only decryption stub visible
2. MUTATION ENGINE
└─ Rewrite decryption stub differently each replication
└─ Junk instructions, register swapping, instruction substitution
3. EXECUTION
└─ Decryptor runs → decrypts payload → executes payload
└─ Payload infects new files with new mutation
1. DISASSEMBLY
└─ Analyse own code into instruction stream
2. TRANSFORMATION
├─ Instruction substitution (ADD ↔ SUB + NEG)
├─ Register renaming (EAX ↔ EBX)
├─ Instruction reordering (independent blocks)
├─ Dead code insertion (NOP, JMP, junk)
├─ Control flow flattening
└─ Loop unrolling/rolling
3. REASSEMBLY
└─ Emit functionally equivalent but structurally different code
MalwareYearTypeMutation Rate
1260 Virus1990PolymorphicFirst true
DAME1992PolymorphicToolkit
W32/Simile2002Metamorphic90%+ change
Virut2006PolymorphicFile infector + botnet
Sality2003+PolymorphicFile infector + worm
MethodPolymorphicMetamorphic
Signatures❌ Fail❌ Fail
Heuristics⚠️ Partial❌ Often fail
Emulation✅ Decrypt in sandbox⚠️ Timeout risk
Behavioural✅ Runtime behaviour✅ Runtime behaviour
Memory Scanning✅ Decrypted in memory✅ Decrypted in memory
ML/ML-based✅ Pattern recognition✅ Pattern recognition
  • Heuristic/behavioural detection — Not signatures alone
  • Sandboxing — Observe in isolation
  • Application whitelisting — Only known-good executables
  • Memory scanning — Detect at runtime regardless of disk form
  • ML-based detection — Train on behavioural patterns
  • Keep AV updated — Modern engines use multiple methods
TechniqueIDDescription
Obfuscated FilesT1027Polymorphic encryption
Software PackingT1027.002Runtime packing
Binary PaddingT1027.001Size manipulation