bending binary programs to your will rajeev barua

13
Bending Binary Programs to your Will Rajeev Barua

Upload: ramona-jacobs

Post on 31-Dec-2015

37 views

Category:

Documents


2 download

DESCRIPTION

Bending Binary Programs to your Will Rajeev Barua. What is a Binary Rewriter. Traditionally. Recently. High-level language program (C, C++, Java, SQL,……). Binary executable program. Compiler. Binary Rewriter. Binary executable program. Improved Binary executable program. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Bending Binary Programs to your Will Rajeev Barua

Bending Binary Programs to your Will

Rajeev Barua

Page 2: Bending Binary Programs to your Will Rajeev Barua

What is a Binary Rewriter

High-level language program (C, C++, Java, SQL,……)

Binary executable program

Binary executable program

ImprovedBinary executable program

Traditionally Recently

Binary RewriterCompiler

Page 3: Bending Binary Programs to your Will Rajeev Barua

• Allows optimizations missed by compiler– Including inter-procedural optimization

• Portable across any language– No need for repeated compiler implementation

• Applicable to legacy codes and assembly level programs

• Enhanced security of binaries

Advantages of Binary Rewriting

Page 4: Bending Binary Programs to your Will Rajeev Barua

Flow of Compiler

llvm-gccllvm-gfortran

C, C++Fortran

Code Improvement

LLVM IR

Machine CodeGenerator

Layout Modifications

Binary Reader

Flow of Binary Rewriter

LLVM IR

LLVM IR

Page 5: Bending Binary Programs to your Will Rajeev Barua

+

Existing Binary Rewriters

Commercial Binary Program

Rewritten Commercial Binary Program

Symbolic & Relocation Information

Existing Binary Rewriter

SecondWrite √

SecondWrite

Page 6: Bending Binary Programs to your Will Rajeev Barua

• Improvement in Execution Speed– Automatic Parallelization– Better memory management

• Improvement of security and reliability– Protection against malicious attacks– Access control

Applications of Binary Rewriting

Page 7: Bending Binary Programs to your Will Rajeev Barua

Security Policy Enforcement in Binaries

Security PolicyLibrary

Security PolicyLibrary

Binary Reader

Code Improvement

Layout ModificationsCode Generator

System CallDetector

Security check inserter

Page 8: Bending Binary Programs to your Will Rajeev Barua

+

Security Policy Enforcement

Input Binary Program Security Policy

SecondWrite

Output Binary

SecurityPolicy

Page 9: Bending Binary Programs to your Will Rajeev Barua

Enforcing a Policy on a Malicious Binary

Malicious binary thatdeletes files under the/c/important directory.

Run binary Deletes files!

(Binary runs under your permissions)

Page 10: Bending Binary Programs to your Will Rajeev Barua

Enforcing a Policy on a Malicious Binary

Malicious binary thatdeletes files under the/c/important directory.

SecondWrite

Malicious Binary

SecurityPolicy

+ Security policy for downloaded applications:

• Cannot delete files which the application did not itself create

Page 11: Bending Binary Programs to your Will Rajeev Barua

Enforcing a Policy on a Malicious Binary

MaliciousBinary

Run binary Kill application!

SecurityPolicy

Page 12: Bending Binary Programs to your Will Rajeev Barua

• Prevent network send after reading sensitive files

• Impose quota on resource usage (e.g. heap memory)

Examples of Other Policies

Page 13: Bending Binary Programs to your Will Rajeev Barua

• Customizable: Security checks customizable to application, source, user and site.

• Wide Scope: Completely enforce Confidentiality, Integrity, and Availability (CIA triad) in a binary

• Preventative: Ability to stop attacks before they succeed

• Portable: Approach is independent of operating system and programming language

Advantages of this Approach