+ VIRUS TECHNIQUES +
"Let's talk Stealth."
WriTTeN By SToMaCH CoNTenTS


Hello Kiddies.. Stomach has something tasty for you to chew on, but first:

DISCLAIMER:

I take absolutely no responsibility for the use/misuse of the information and/or source code in this document. By using the information/source code in this document YOU are agreeing to take full responsibility for any consequence of using this information.

IET - Interleaved Encryption Technique.

The concept is so simple, it's really not much to shout about, however, it's potential for dodging AV's is enormous.

Basically the idea is not to replace XOR encryption or the like, but to compliment it. The purpose of IET in fact, is to protect the decryption code. It's a mutualistic relationship.

So the IET code serves the purpose of encoding the decoding code, and the decoded code serves the purpose of re-IET-encoding the decryption algorithm.

"You encode my back, I'll encode yours" so too speak.

So what does the common AV have to go on now? NOTHING. It won't be able to find a single string of bytes in the IET code longer than perhaps 1 instruction, so it's useless there, and it won't be able to find a single string of bytes in the encrypted portion, because the encryption key will always change.

Ok, so how do we do it? Well the method simply interleaves each instruction with another randomly chosen instruction. Take your standard XOR decryption code..

Now, create a list of instructions which do nothing, or use registers not used in the decryption code, and their lengths.

Also insert a copy of the decryption code, also with instruction lengths interleaved in the code..

Now it's simply a bit of coding to scan through the DecryptionCodeTemplate, copy 1 instruction to the new IET code block, then selected a random instruction from the InstructionList and inserting it, then fetching another instruction from the DecryptionCodeTemplate and then fetching another one from the the InstructionList.. and so on and so on.

Once the code is "rendered" you will have something that may look like:

As you can see, this is just 1 of 2,097,152 variations (7 insertion points, 8 different instructions). You could even write code which dumps a random number of instructions at each insertion point. It might be a good idea to make the decryption algorithm a little more complicated as well.

Remember that the InstructionList and the DecryptionCodeTemplate is safely tucked away in the encrypted portion of the virus, which means there is nothing an AV can get it's hands on.

THE PROBLEM WITH IET

Ok, by now you might have noticed a slight snag in the concept. The relative jump or LOOP should I say at the end, and the reference to the EncryptedCode label. Due to the undetermined size of the decryption code, the LOOP will be out, and so will the EncryptedCode label, but that hardly poses a problem. A wee bit of self editing code will sort that out, and is definitely not going to vex a hardened virus coder.

TECHNIQUES - GETTING A WEE BIT MORE DEVIOUS

Ok, so you've written your first IET-utilizing virus, now what? Well to make things a little more interesting, and a lot more aggrevating to the general AV croud, you might want to try one of the following:

+ Use polymorphic code in the form of DecryptionTemplateCode. Have a variety of different decryption/encryption algorithms. Screw XOR. Let's get original people!!!

+ Write a Single Step handler which actually executes code in the interleaved form. ie. with instruction lengths still embedded. This will provide some protection for your code, as trying to trace will crash it. You can also leave the memory image encrypted, and actually execute the encrypted code.

OK, SO YOU WAN'T SOME SOURCE CODE

This is a wee .COM file infector that I whipped together to test IET. It works. I have modified it from a bigger version to make things easier to understand for you learners out there. If you see funny things like "Padding end of file", just bare with me.. ignore it.

There is no payload, as I don't believe in malicious virii. There's no challenge in being destructive. Anyway.. here we go..

Ok.. I assembled this with:

    TASM IETV.ASM
    TLINK -T IETV

The .COM created need not be modified to run. It's run-ready. All you have to do is infect a file with it, reset your PC, go in with a debugger and take a look at the code it creates.

ANOTHER DISCLAIMER:

Assemble this code at your own risk. I won't be held liable for any damage caused to your or any other PC or constituents thereof.

I would recommend only assembling this and executing it if you feel experienced enough to control the situation.

CHEERIO FELLOW CODERS

Well that's it for now, I'm hungry! Hope this inspires you to incorporate IET into your own NON-MALICIOUS FRIENDLY creations. Anyone got any other kuhl ideas?

<burp!>

(Where'd The Analyst Go?)