Skip to content

Prevent Return Oriented Programming (ROP) Between Dynamic Text Segments

Notifications You must be signed in to change notification settings

jlevymyers/text-isolation

Repository files navigation

text-isolation

Project which prevents execution across dynamic code sections.

Making Project

make inst # generates instrumentation file make test # generates open_test, a working example

Making Wrapper Project

./instrument [target] # this will output instrumentation code in a file called dyn_sym.s

make wrap # compiles wrapper into a dynamic object (.so)

Running Linker with Hooks

make run SOURCE=main_executable # run the program with the LD_PRELOAD flag set

Structure of Project

Static Hook Generation

  1. find_syms() identifies all dynamic symbols in binary and dependencies
  2. generate_asm() generates hook file

Runtime

  1. LD_PRELOAD variable set to file containing dynamic symbol hooks
  2. When a function is hooked, find_dyn_addr() resolves the dynamic symbol
  3. Code region containing function symbol is marked executable, other code regions are marked read only
  4. Execution is redirected to dynamic function
  5. TODO: On return from dynamic call, calling code region is again marked executable