Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.

Slides:



Advertisements
Similar presentations
Evaluating Indirect Branch Handling Mechanisms in Software Dynamic Translation Systems Jason D. Hiser, Daniel Williams, Wei Hu, Jack W. Davidson, Jason.
Advertisements

Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Integrity & Malware Dan Fleck CS469 Security Engineering Some of the slides are modified with permission from Quan Jia. Coming up: Integrity – Who Cares?
Program Development Tools The GNU (GNU’s Not Unix) Toolchain The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Comprehensive Kernel Instrumentation via Dynamic Binary Translation Peter Feiner, Angela Demke Brown, Ashvin Goel University of Toronto Presenter: Chuong.
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
Moving Target Defense in Cyber Security
Dec 5, 2007University of Virginia1 Efficient Dynamic Tainting using Multiple Cores Yan Huang University of Virginia Dec
University of VirginiaDARPA SRS - 27 Jan Effectiveness of Instruction Set Randomization Ana Nora Sovarel and David Evans DARPA SRS – Genesis Project.
Buffer Overflow Prevention ”\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e \x89\xe3\x50\x53\x50\x54\x53\xb0\x3b\x50\xcd\x80” Presented to CRAB April.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Instruction-Set Randomization “Countering Code-Injection Attacks With Instruction-Set Randomization” G. Kc, A. Keromytis, and V. Prevelakis CCS October.
Security Protection and Checking in Embedded System Integration Against Buffer Overflow Attacks Zili Shao, Chun Xue, Qingfeng Zhuge, Edwin H.-M. Sha International.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
Lecture 16 Buffer Overflow
COP4020 Programming Languages
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
Efficient Software-Based Fault Isolation—sandboxing Presented by Carl Yao.
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
F13 Forensic tool analysis Dr. John P. Abraham Professor UTPA.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
System Calls 1.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Address Space Layout Permutation
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
CS533 Concepts of Operating Systems Jonathan Walpole.
Computer Science Detecting Memory Access Errors via Illegal Write Monitoring Ongoing Research by Emre Can Sezer.
Mitigation of Buffer Overflow Attacks
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 10 “Buffer Overflow”.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
University of Virginia Department of Computer Science1 Applications of Software Dynamic Translation Jack Davidson University of Virginia February 27, 2002.
Christopher Kruegel University of California Engin Kirda Institute Eurecom Clemens Kolbitsch Thorsten Holz Secure Systems Lab Vienna University of Technology.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Chapter 4 Memory Management Virtual Memory.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
G ENESIS : A Framework For Achieving Component Diversity John C. Knight, Jack W. Davidson, David Evans, Anh Nguyen-Tuong University of Virginia Chenxi.
Full and Para Virtualization
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Memory Management Overview.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
G ENESIS: Security Through Software Diversity John C. Knight, Jack W. Davidson, David Evans, Anh Nguyen-Tuong University of Virginia Chenxi Wang Carnegie.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Presentation subtitle: 20pt Arial Regular, green R223 | G255 | B102 Recommended maximum length: 2 lines Confidentiality/date line: 13pt Arial Regular,
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Lecture 3 Translation.
Mitigation against Buffer Overflow Attacks
Why to use the assembly and why we need this course at all?
Chapter 9 – Real Memory Organization and Management
Machine Independent Features
Memory Management Overview
Introduction to Computer Systems
Lecture 4: Instruction Set Design/Pipelining
Understanding and Preventing Buffer Overflow Attacks in Unix
Dynamic Binary Translators and Instrumenters
Presentation transcript:

Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu

Outline Introduction  Code injection, ISR Problem  Inefficiency of ISR Tools  Diablo, Strata Solution  Efficient ISR using Strata Conclusion

Introduction Most exploits involve some kind of code injection  Stack overflows  Heap overflows  etc Several defenses proposed  StackGuard  Address Space Randomization  ISR

Instruction Set Randomization A general defense against code injection  Any application code must be decoded before execution  Code that has been injected will not be encoded with the proper key, and will fail  This approach works regardless of how or where code is injected However, it does not address other exploits that do not inject code  i.e. return-to-libc attacks

Disadvantage of ISR High overhead  Every instruction must be decoded at run-time  Most implementations use an emulator i.e. bochs or Valgrind  Emulators can be times slower than native execution, depending on the application Our goal is to use Strata, a software dynamic translation tool, to overcome this overheard

Our Approach Randomize a binary statically before run-time  We are using a binary rewriting tool called Diablo  Instructions are XORed with a key Derandomize the program at run-time using software dynamic translation  We are using a SDT system called Strata  All instructions are XORed with the same key

Diablo A retargetable link-time binary rewriting framework. Only works on statically linked programs. Its inputs are the object files and libraries from which the program is built, instead of just the program executable.

How Diablo Works Merges code sections of each object file Disassembles the binary text Builds a control flow graph Does some optimizations Reassembles the assembly code Write to a binary file

How We Can Use Diablo Diablo does a lot of work for us  Disassembles binaries  Builds control graph  Writes binaries Modify Diablo to randomize the codes

Strata A software dynamic translation infrastructure, written in C and assembly Main design by Kevin Scott, Jack Davidson’s PhD student here at UVa So far it has been targeted to SPARC, MIPS, and x86

Strata Imposes a translation layer between the executable and the processor Code fragments are fetched from the binary, optionally translated, and then placed into a fragment cache Processor control is switched to the fragment for direct execution

Software Dynamic Translation

Using Strata Application Linker Strata New Application

Apache Under Strata We can successfully run Apache under Strata with no randomization Performance was tested with a tool called Flood that generates HTTP requests  Native execution requests/second  Under Strata requests/second  1.39x slowdown

How We Can Use Strata Implement a custom fetch routine Any time an instruction is fetched from the binary, XOR it with the key before placing it into the fragment cache

Implementation Application Diablo Strata key Randomized Application

Issues with Our Approach Strata is designed to be linked in directly with the application  Strata must share the process space with the randomized application This introduces several problems  Selective randomization  Shared libraries  Program start up and shut down

Selective Randomization We have to distinguish the code of the application from that of Strata, and only randomize the code of the application. We modified Diablo so that:  it remembers the source object file of every code section  it checks the source object file before randomization and does nothing if the code is from Strata

Shared Libraries Functions in glibc are called both by the application and by Strata What’s wrong?  Everything outside Strata should be randomized  If the shared function is randomized, the program will crash when Strata calls it

Shared Libraries Solution Create a separate copy of glibc functions Use objcopy to rename all the names of glibc functions called by Strata The code bloat incurred by separate copy of glibc for Strata is about 400Kb (Strata doesn’t use too much)

Current Status We can run real server applications (Apache) under Strata without randomization We can successfully randomize and derandomize a simple program There are still some sharing issues with real programs

Things Left To Do Get Apache working with ISR Verify that ISR will protect against a buffer overflow attack Collect performance numbers

Insider Attack Our current implementation assumes a remote attack, where the attacker does not have access to the randomized binary  The encryption scheme is simple  The key is stored in the binary itself We must address these issues in order to protect against an insider attack

How Effective is ISR? Our primary goal was to show an efficient implementation of ISR Strata can also be modified to check the current PC and reject execution of any code on the stack or other illegal location Does this accomplish the same thing at a much lower cost?

ISR vs. Non-Executable Stack There are legitimate uses for an executable stack [Cowan 1998]  gcc uses executable stacks for function trampolines for nested functions  Linux uses executable user stacks for signal handling  Functional programming languages, and some other programs, rely on executable stacks for run-time code generation In these cases, ISR can help us differentiate between injected code and legitimate code on the stack

Conclusions Implementing ISR using emulation is very inefficient Software dynamic translation can be used for a more efficient approach However, implementation can be very tricky due to sharing problems

Questions?