Polymorphism: New Code, the Same Harmful Job
Two harmful programs can perform the same job while their files contain different bytes. A detector looking for one exact version may recognize the first and miss the second. Changing the form while keeping the harmful function is the idea behind malware polymorphism.
Polymorphism, in this security context, changes the code or representation of malware in an effort to hinder detection. Malware is software intended to carry out harmful activity. Bytes are the units of data that make up its files.
The Australian Signals Directorate's definition of polymorphic malware focuses on that attempt to avoid security tools. The attempt can make detection harder; it doesn't guarantee success.
- Stop ransomware and malware before they reach your files.
- Bank and shop in a browser built to keep transactions private.
- Cover five devices, from Windows and Mac to phones.
The recognizable pattern keeps changing
A security tool can recognize a known harmful file by looking for a particular pattern. That pattern is sometimes called a signature. If the relevant parts of the file change, a rule expecting the old pattern may no longer match.
This is about what the detector can recognize in the file, not necessarily what the program will do when it runs. Different representations can preserve the same harmful function.
One way to vary a file is to change how its contents are encrypted or compressed. The resulting files can look different to inspection while retaining the underlying code's job. Those are possible methods, not requirements for every form of polymorphism.
A whole-file fingerprint and an antivirus detection signature aren't interchangeable terms. Security tools can look for patterns broader than one exact file, and a changed file doesn't automatically defeat every such rule.
The changes needn't happen on the victim's computer
Variants can be made before delivery. A distributing server can supply differently packaged copies to different downloads. The receiving computers then get files that differ even though the intended behavior is the same.
Microsoft described this server-side polymorphism in its 2010 report on botnets. That historical explanation also distinguishes variants created as malware replicates.
Other changes can happen during execution, while a program is running. MITRE's polymorphic-code description covers changes to the running program's appearance while its objective remains the same.
The term doesn't require a transformation at every restart or every infection. It also doesn't, on its own, mean the program can spread to another computer. Changing form and making new infections are separate capabilities.
A Virus, a Worm, or a Trojan? The Difference Matters
The activity still leaves something to examine
A changed representation can break a particular pattern match. Defenders can still examine other patterns, the program's behavior and changes it makes in memory. MITRE's guidance describes such evidence as part of detection.
Antivirus software may detect a changed file through a different rule or suspicious behavior, even when a match for an earlier version fails.
For a program that changes during execution, code in memory no longer matches what was there before. Investigators can compare those memory changes with the program's activity to work out whether they are suspicious.
Attack Signatures: What Security Software Recognizes

Behavior Monitoring: What Software Does Can Give It Away

Sandboxing: Deciding What a Program Can Reach

QUOTE:
"Amateurs hack systems, professionals hack people."
