Antivirus bypass using encryption
Encrypting code is one of the most common ways to succeed with a bypass and one of the most efficient ways to hide the source code.
Using encryption, the malicious functionality of the malware will appear as a harmless piece of code and sometimes seem to be completely irrelevant, meaning the antivirus software will treat it as such and will allow the malware to successfully run on the system.
But before malware starts to execute its malicious functionality, it needs to decrypt its code within runtime memory. Only after the malware decrypts itself will the code be ready to begin its malicious actions.
The following diagram shows the difference between an EXE file with and without encryption:
In order to use code encryption techniques correctly, there are a few basic sub-techniques to be familiar with that we used while writing this book. Here are these...