Binary and Malware Analysis

Table of Contents

Anti-analysis

Goal is to make analysis as difficult as possible.

Anti-static

Control flow obfuscation

Transformations that make it hard to analyze flow of control of program

Opaque predicate: expression whose value know to programmer but difficult for analyst

Control flow flattening: aims to obscure control flow logic

Return address patching: ret pops value from stack and jumps to place pointed by it, if function modifies return value then disassemblers get confused

Data obfuscation

i.e. convert variable to representation that’s hard for analyst to understand or is unexpected

Encryption:

Variable splitting:

Anti-dynamic

Anti-debugging

different flags (PEB, Heap flags, NtGlobalFlag)

detect breakpoints

exception traps

self debugging

time-based detection

How do you counter?

Anti-VM

Malware analysis often uses VMs to run samples, so samples refuse to run in VMs.

Look for VM-specific artifacts

Anti-monitoring in general