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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PROCEEDINGS OF WORLD ACADEMY OF SCIENCE, ENGINEERING AND TECHNOLOGY VOLUME 25 NOVEMBER 2007 ISSN 1307-6884PREDICTABLE ANARCHIC RELENTLESS ENCRYPTION GEN-ERATOR) and that he describes in another issue of 29A’smagazine [13], [12]. This engine combined most notably twonovel techniques, with an anti-heuristic purpose, which alsotook part in the mutation of the decryption routine. Bothtechniques, the branching technique and the PRIDE technique,are used in METAPHOR. Finally, an EPO technique is used togive control to the decryption routine: METAPHOR changesall calls to the exit function into calls to this routine.Thus, the virus only g<strong>ai</strong>ns control after execution of theprogram, which contributes to its stealth and protects it fromthe detection by emulation.2) Branching technique: A basic decryption method has astructure that often follows a common template which willtrigger an alarm in any heuristic engine, as one can see withthe examples from last section. Thus the branching techniqueallows to simulate as much as possible the behaviour of aninnocuous program. Such programs will usually sequentiallytest several conditions and, depending on the result, finallybranch on distinct paths. This technique therefore createsseveral random tests, until a given recursivity level, that willdefine an execution tree with leaves representing distinct waysto decrypt the code. Figure 4 describes the execution tree for amaximum depth of recursivity equal to 2: each terminal branchhas its own decryption code, though the final result is the same,whatever branch is taken. Thus for a depth of recursivity equalto n, 2 n decryption branches are generated.int jmp;if (recLevel >= maxLevel) { // maximum depth?insert_code ();// decryption codebuild_instr (OP_CMP, REG_ECX, code_len);// CMP ecx, code_lenjmp = insert_partial_jump (OP_JNZ); // JNZ partial_jumps [cnt_partial_jumps ++] = jmp;// update the target in the end... // call the decrypted codereturn;}recLevel ++;add_node (insert_label ()); // save the new branchif (random_boolean ()) { // test CMP or TEST?int reg, val, op;reg = get_random_register ();val = 0x80000000 | (random () & 0x3fffffff);// 0x8XYYYYYY (X < 4)build_instr (OP_CMP, reg, val); // CMP reg, valop = OP_JB + (random () & 0x5); // JB/JA/JBE/JAEjmp = build_partial_jump (op); // partial jump} else {int reg, val, op;reg = get_random_register ();val = 0x1

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

Saved successfully!

Ooh no, something went wrong!