5. DYNAMIC BINARY INSTRUMENTATION
➤ Inject instrumentation code into a
running binary.
➤ Instrumentation code executes as
normal instructions.
6. DYNAMIC BINARY INSTRUMENTATION
➤ Inject instrumentation code into a
running binary.
➤ Instrumentation code executes as
normal instructions.
➤ Instrumentation is transparent to
the application.
8. DBI FRAMEWORKS
➤ Intel PIN Framework
➤ Win, Lin, OS X
➤ No IL
➤ Valgrind
➤ Lin, OS X
➤ IL
9. DBI FRAMEWORKS
➤ Intel PIN Framework
➤ Win, Lin, OS X
➤ No IL
➤ Valgrind
➤ Lin, OS X
➤ IL
➤ DynamoRIO
➤ Win, Lin, Android
➤ No IL
10. DBI FRAMEWORKS
➤ Intel PIN Framework
➤ Win, Lin, OS X
➤ No IL
➤ Valgrind
➤ Lin, OS X
➤ IL
➤ DynamoRIO
➤ Win, Lin, Android
➤ No IL
➤ May be others like
➤ PEMU
➤ …
24. TAINT ANALYSIS
taint RAX
mov RCX, RAX
push RCX
…….
mov RCX, ptr [0x1234]
pop RBX
stop tainting
Which are the tainted regs?
25. TAINT ANALYSIS
taint RAX
mov RCX, RAX
push RCX
…….
mov RCX, ptr [0x1234]
pop RBX
stop tainting
Which are the tainted regs?
Which are the tainted mems?
26. TAINT ANALYSIS
taint RAX
mov RCX, RAX
push RCX
…….
mov RCX, ptr [0x1234]
pop RBX
stop tainting
Which are the tainted regs?
Which are the tainted mems?
RAX, RBX and 8 addresses
from the stack
38. TAINT ANALYSIS
➤ With the help of PIN’s Inspection API (TaintAll)
➤ With the help of Symbolic Execution (Triton Framework)
39. TAINT ANALYSIS
➤ With the help of PIN’s Inspection API (TaintAll)
➤ With the help of Symbolic Execution (Triton Framework)
➤ Using an Intermediate Language (TaintGrind)
40. TAINT ANALYSIS WITH TRITON
Triton/src/examples/pin/
runtime_memory_tainting.py
with a little modification
41. TAINT ANALYSIS WITH TRITON
Triton/src/examples/pin/
runtime_memory_tainting.py
with a little modification
42. A LITTLE BIT OF Z3
➤ “Z3 is a state-of-the art theorem prover from Microsoft
Research”
43. A LITTLE BIT OF Z3
➤ “Z3 is a state-of-the art theorem prover from Microsoft
Research”
➤ Input format is an extension of SMT-LIB 2.0 standard
44. A LITTLE BIT OF Z3
➤ “Z3 is a state-of-the art theorem prover from Microsoft
Research”
➤ Input format is an extension of SMT-LIB 2.0 standard
45. A LITTLE BIT OF Z3
➤ “Z3 is a state-of-the art theorem prover from Microsoft
Research”
➤ Input format is an extension of SMT-LIB 2.0 standard
➤ Or use Z3Py
46.
47. For a real world example
Search: “Reversing the petya
ransomware with constraint solvers”