Malware & Antivirus Evasion
Antivirus Detection Methods
Signature Based
Files scanned for malware signatures (Blacklist type)
Cons: Changing or obfuscating contents (byte sequences)
Heuristics Based
rules and algorithms to determine maliciousness
Look through instruction set of binary & decompile source code
Patterns and program calls
Behavior Based
executing file in emulated environment --> actions that are malicious
Types of Malware
Multipartite (multi ways of propagation)
Stealth virus (overwrite MBR but modify the OS access function to cover tracks)
Polymorphic (changes signature by adding random code block)
Encrypted virus (short decryption routine – changes each infection + main code)
Logic bomb (Triggers on a certain date, event, action)
Service injection virus
MBR virus (Master boot record has pointer to run stored virus code somewhere else)
File infector + companion virus(.exe to .com with same name)
Malware Analysis
Tools: Decompiler, hex editor, debugger (IDA Pro , Ghidra)
Static Analysis
Disassembly to identify malicious infra, libraries and files
However, might have runtime behaviour that goes undetected (file generates a string that downloads a malicious file based on a dynamic string)
Dynamic Analysis
Executes file in sandbox
File might have conditions that lay dormant until certain conditions met
Memory forensics – see how it uses memory + behavioural analysis
Bypassing AV Detection
1. On-Disk Evasion
Packers --> Compression of file size, signature changes
Obfuscators --> reorganise, mutate code, insert irrelevant instructions, split and reorder functions
Crypters --> Decrypting stub that decodes exe code on execution, decryption happens in memory (encrypted code on disk)
Software Protectors --> VM emulaion detection, anti-debugging, anti-reversing
2. In-Memory Evasion (PE - Portable Executable injection)
Manipulation of volatile memory; does not write any files to disk (Here we cover only in-memory injection using POWERSHELL
Remote Process Memory Injection
inject payload into legitimate PE (.exe)
Leveraging Set of Windows APIs
Reflective DLL Injection
Regular DLL Injection loads a malicious DLL from disk using LoadLibrary API, reflective DLL loads a DLL stored by an attacker in the process memory
Process Hollowing
Inline Hooking
Last updated