Polymorphic code

Polymorphic code

In computer terminology, polymorphic code is code that mutates while keeping the original algorithm intact. This technique is sometimes used by computer viruses, shellcodes and computer worms to hide their presence.

Most anti-virus software and intrusion detection systems attempt to locate malicious code by searching through computer files and data packets sent over a computer network. If the security software finds patterns that correspond to known computer viruses or worms, it takes appropriate steps to neutralize the threat. Polymorphic algorithms make it difficult for such software to locate the offending code as it constantly mutates.

Encryption is the most commonly used method of achieving polymorphism in code.

Malicious programmers have sought to protect their polymorphic code from this virus-scanning strategy by rewriting the unencrypted decryption engine each time the virus or worm is propagated. Anti-virus software uses sophisticated pattern analysis to find underlying patterns within the different mutations of the decryption engine, in hopes of reliably detecting such malware.

The first known polymorphic virus was written by Mark Washburn. The virus, called 1260, was written in 1990. A more well-known polymorphic virus was invented in 1992 by the Bulgarian cracker Dark Avenger (a pseudonym) as a means of avoiding pattern recognition from antivirus-software. Other computer cracks like the young antoinejebara1 and Schneiding red wrote polymorphic codes that bypassed entire systems.

Example

An algorithm that uses, for example, the variables A and B but not the variable C could stay intact even if you added lots of code that changed the contents of the variable C.

The original algorithm:

Start: GOTO Decryption_Code Encrypted: ... lots of encrypted code ... Decryption_Code: A = Encrypted Loop: B = *A B = B XOR CryptoKey *A = B A = A + 1 GOTO Loop IF NOT A = Decryption_Code GOTO Encrypted CryptoKey: some_random_number

The same algorithm, but with lots of unnecessary C-altering code:

Start: GOTO Decryption_Code Encrypted: ... lots of encrypted code ... Decryption_Code: C = C + 1 A = Encrypted Loop: B = *A C = 3214 * A B = B XOR CryptoKey *A = B C = 1 C = A + B A = A + 1 GOTO Loop IF NOT A = Decryption_Code C = C^2 GOTO Encrypted CryptoKey: some_random_number

The code inside "Encrypted" ("lots of encrypted code") could then search the code between Decryption_Code and CryptoKey and remove all the code that alters the variable C. Before the next time the encryption engine is used, it could input new unnecessary code that alters C, or even exchange the code in the algorithm for new code that does the same thing. Usually the coder uses a zero key (for example; A xor 0 = A) for the first generation of the virus, making it easier for him because with this key the code is not encrypted. He then implements an incremental key algorithm or a random one.

Another polymorphism technique is to autoinject NOP (No Operation) or other opcodes that don't alter the algorithm.

See also

* Timeline of notable computer viruses and worms
* Metamorphic code
* Self-modifying code
* Alphanumeric code
* Shellcode
* Software cracking
* Security cracking

References

* Diomidis Spinellis. [http://www.spinellis.gr/pubs/jrnl/2002-ieeetit-npvirus/html/npvirus.html Reliable identification of bounded-length viruses is NP-complete] . "IEEE Transactions on Information Theory", 49(1):280–284, January 2003. [http://dx.doi.org/10.1109/TIT.2002.806137 doi:10.1109/TIT.2002.806137]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Polymorphic engine — A polymorphic engine (sometimes called mutation engine or mutating engine) is a computer program that can be used to transform another program into a version that consists of different code with the same functionality. A typical polymorphic… …   Wikipedia

  • Code Age Brawls — Developer(s) Square Enix Publisher(s) Square Enix Writer(s) Miwa Shoda Composer(s) …   Wikipedia

  • Polymorphic Inline Cache — is when you cache more than one object >method lookup pair per location in the code.Ex from the Ruby language:def go(a) a.goendIf you call this with different a parameters then the VM would remember which one goes with which and cache and reuse… …   Wikipedia

  • Metamorphic code — In computer virus terms, metamorphic code is code that can reprogram itself. Often, it does this by translating its own code into a temporary representation, editing the temporary representation of itself, and then writing itself back to normal… …   Wikipedia

  • Self-modifying code — In computer science, self modifying code is code that alters its own instructions, intentionally or otherwise, while it is executing.Self modifying code is quite straightforward to write when using assembly language (taking into account the CPU… …   Wikipedia

  • Oligomorphic code — An oligomorphic engine is generally used by a computer virus to generate a decryptor for itself in a way comparable to a simple polymorphic engine. It does this by randomly selecting each piece of the decryptor from several predefined… …   Wikipedia

  • Obfuscated code — Obfuscated code is source or machine code that has been made difficult to understand for humans. Programmers may deliberately obfuscate code to conceal its purpose (security through obscurity) or its logic to prevent… …   Wikipedia

  • List of monsters in Code Lyoko — This is a list of monsters in the French animated television series Code Lyoko . For the most part, the monsters are created by Xana to fight the Lyoko warriors on his behalf. Xana s monsters To defend his towers and to battle the group in Lyoko …   Wikipedia

  • List of Code Lyoko episodes — This is a list of episodes for the French animated television series, Code Lyoko. The first season has no set viewing order save for the last two episodes, so it is listed by the order in which it aired. The following seasons have their episodes… …   Wikipedia

  • List of Code Lyoko characters — This is a list of characters in the French animated television series Code Lyoko. It covers the protagonists, the antagonist, and supporting characters. Contents 1 Main Characters 1.1 Aelita 1.2 Jeremy Belpois …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”