Computer and Network Security

Table of Contents

Lecture 12: advanced exploitation

Attacks so far have these steps:

  1. vulnerability: overflow, format, UAF, uninitialized read, type confusion
    • can be exploited
    • defense so far: e.g. stack canary preventing contiguous stack overflow
  2. control code pointer
    • runs shellcode or starts ROP
    • defense so far: e.g. W⊕X fully prevents, ASLR or CFI (control flow integrity) maybe prevents?
  3. arbitrary execution

Exploit mitigations

Examples:

All approaches have similarities:

Threat model:

ASLR:

Fine-Grained ASLR

XnR:

Information hiding:

Control flow integrity (CFI)

We don’t want attacker to run Turing complete program, but a more restrictive set. Allow only legitimate branches and calls (i.e. those that follow the control flow graph). Give valid targets a label, check that program doesn’t branch anywhere else (fine-grained CFI). May be combined with shadow stack that can be verified.

Problems:

Maybe do loose/coarse-grained CFI, which uses only few labels: common label for all call sites, common label for all entry points.

This eliminates 98% of gadgets, but can still do:

Context-sensitive CFI: