12.07.2015 Views

Advanced Polymorphic Techniques.pdf - adamas.ai

Advanced Polymorphic Techniques.pdf - adamas.ai

Advanced Polymorphic Techniques.pdf - adamas.ai

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 25 NOVEMBER 2007 ISSN 1307-6884return seed;}unsigned int xorshift128_next (void) {/* initialization with random values */static unsigned intues cannot exceed a minimal and a maximal threshold (thusthe associated probability never reaches 1 or 0)./*Returns 1 or 0, depending on the gene’s contents.x = 123456789, y = 362436069,*/z = 521288629, w = 88675123;int query_gene (int gene) {unsigned int t;int val = get_gene (gene);t = x ˆ (x > 19)) ˆ (t ˆ (t >> 8));if ((random () & 0xFF) >= val) {// return 1 and increase propension to 1}do {// minimal threshold reached?2) “Genetic” techniques: METAPHOR combines geneticif (val < 0x08) return 1;characteristics to its generator. Here is the principle. The virusif ((random () & 0x0F) > 0)cont<strong>ai</strong>ns some sort of genetic material which will have a// increase propension to 1:set_gene (gene, -- val);tendency to favour some behaviours rather than others. On} while ((random () & 0x0F) == 0);each replication, this genetic material is updated with a small // repeat with probability 1/16random variation from the preceding material.return 1;} else {For instance, a gene cont<strong>ai</strong>ns the current propension of the do {virus to encrypt its code or not: the virus initially encrypts// maximal threshold reached?its code with probability 1/16. Depending on its decision, theif (val >= 0xF8) return 0;if ((random () & 0x0F) > 0)gene will be altered in favour or in disfavour of encryption: if// increase propension to 0the virus encrypts its body, it will have next time a higher probabilityset_gene (gene, ++ val);to encrypt ag<strong>ai</strong>n its body, and conversely. Thus after a } while ((random () & 0x0F) == 0);// repeat with probability 1/16few generations, either the code will have a strong propension return 0;to encryption, or a strong propension to absence of encryption. }The propension strengh is related to the survival time (and to }the number of replications) of the virus. Thus, if the virus hasFor a more det<strong>ai</strong>lled analysis of genetic viruses, one maya strong propension to encryption, this means that most of therefer to M. Ludwig’s books [9], [8].previous generations chose encryption and survived: this iskind of an implementation of natural selection, where virusesare preys and antiviruses are predators. Thus, let’s imagine E. Detection of METAPHORthat the antivirus easily detects encrypted replications of the Analysis of METAPHORcomestoanend.Aswesaw,virus (using statistical entropy analysis for instance) but not several advanced techniques of polymorphism and of antiemulation/ anti-heuristic protection are implemented in thisunencrypted replications. In this case, encrypted replicationswill be detected before being able to replicate and increase virus. Nevertheless they’re not taken to their extremes and thustheir propension to encryption, and in the end, most of the this mutation model is still detectable, m<strong>ai</strong>nly because of thesurvivors will come from unencrypted ancestors, with a high following “weaknesses”:propension to no encryption.• The viral code’s encryption can always be identified byMETAPHOR cont<strong>ai</strong>ns a genetic material of 24 genes. Ina stastical analysis of the code [6]. Indeed, a programother words, 24 of its choices depend on its genetic historyusually has a predefined entropy profile, which showsand its survival abilities. These genes are used for instancefew variations when comparing miscellaneous executablefor:files. Encrypted data, however, have a specific entropy• Number of files to infect: initially, only 50% are infected. profile which is much more uniform, depending on the• Choice of the method of infection: position of the viral underlying encryption system, and thus is characteristiccode, EPO type, type of the system calls, etc.of an encrypted content. Same goes for compressed data.• Encryption of the viral code, or no encryption: initially, Any antivirus using this kind of analysis will most likelythe code is encrypted with probability 1/16.consider as suspect a program that cont<strong>ai</strong>ns a lot of encryptedcontent. However, several legitimate applications• Encryption method (ADD, XOR, SUB): initially, all methodshave the same probability of being chosen.use encrypted data, for the purpose of intellectual propertyprotection. This is the case of “packed” applications• Decryption routine’s code: form of the instructions, obfuscationtype, use of anti-heuristic methods, etc.(even though malware also uses packers on a regularGiven that the virus does not store any information in its basis), and this is also the case of Skype for instance.host other than its code, it must still be able to update itsgenetic material, from one generation to another. This is whereSET_WEIGHT macro-instructions come into play: they’re locatedon disassembly and, on reassembly, the “evolved” geneis used.Here is the algorithm used to update the genes (function• When the virus is executed, it compresses its code intoa form that is roughly the same from one generationto another, by conception: METAPHOR is thereforevulnerable to any form analysis that monitors memory. Aswe might have expected, this weakness can be correctedto some extent, using miscellaneous techniques that areCheckForBooleanWeight). We notice that the genes val-preferably not described here but easy to find out. AnotherPWASET VOLUME 25 NOVEMBER 2007 ISSN 1307-6884 410 © 2007 WASET.ORG

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!