Summary by - Bo Zhang and Shuang Guo [Date: 03/31/2014]

Slides:



Advertisements
Similar presentations
ROP is Still Dangerous: Breaking Modern Defenses Nicholas Carlini et. al University of California, Berkeley USENIX Security 2014 Presenter: Yue Li Part.
Advertisements

Smashing the Stack for Fun and Profit
David Brumley Carnegie Mellon University Credit: Some slides from Ed Schwartz.
Introduction to Information Security ROP – Recitation 5 nirkrako at post.tau.ac.il itamarg at post.tau.ac.il.
C Programming and Assembly Language Janakiraman V – NITK Surathkal 2 nd August 2014.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
PC hardware and x86 3/3/08 Frans Kaashoek MIT
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Assembly תרגול 8 פונקציות והתקפת buffer.. Procedures (Functions) A procedure call involves passing both data and control from one part of the code to.
Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh
A survey of Buffer overflow exploitation on HTC touch mobile phone Advanced Defense Lab CSIE NCU Chih-Wen Ou.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 2: IA-32 Processor Architecture (c) Pearson Education, All rights reserved. You.
6.828: PC hardware and x86 Frans Kaashoek
Carnegie Mellon Introduction to Computer Systems /18-243, spring 2009 Recitation, Jan. 14 th.
Hello ASM World: A Painless and Contextual Introduction to x86 Assembly rogueclown DerbyCon 3.0 September 28, 2013.
Buffer Overflows : An In-depth Analysis. Introduction Buffer overflows were understood as early as 1972 The legendary Morris Worm made use of a Buffer.
Introduction: Exploiting Linux. Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend,
Mitigation of Buffer Overflow Attacks
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
Exploitation possibilities of memory related vulnerabilities
Lecture 8: Buffer Overflow CS 436/636/736 Spring 2013 Nitesh Saxena *Adopted from a previous lecture by Aleph One (Smashing the Stack for Fun and Profit)
CNIT 127: Exploit Development Ch 1: Before you begin.
Introduction to Information Security ROP – Recitation 5.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
Introduction to Assembly II Abed Asi Extended System Programming Laboratory (ESPL) CS BGU Fall 2013/2014.
Buffer Overflow Attack- proofing of Code Binaries Ramya Reguramalingam Gopal Gupta Gopal Gupta Department of Computer Science University of Texas at Dallas.
Compiler Construction Code Generation Activation Records
X86 Assembly Language We will be using the nasm assembler (other assemblers: MASM, as, gas)
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
1 Assembly Language: Function Calls Jennifer Rexford.
CNIT 127: Exploit Development Ch 8: Windows Overflows Part 1.
Beyond Stack Smashing: Recent Advances In Exploiting Buffer Overruns Jonathan Pincus and Brandon Baker Microsoft Researchers IEEE Security and.
ROP Exploit. ROP Return Oriented Programming (ROP): is a hacking exploit technique where you exploit buffer overflow to inject a chain of gadgets. Each.
Chapter Overview General Concepts IA-32 Processor Architecture
Exploiting & Defense Day 1 Recap
Introduction to Information Security
Shellcode COSC 480 Presentation Alison Buben.
Mitigation against Buffer Overflow Attacks
CS 177 Computer Security Lecture 9
Return Oriented Programming
Jump-Oriented Programming
Instruction Set Architectures
Introduction to Information Security
Assembly language.
x86 Processor Architecture
ISA's, Compilers, and Assembly
Introduction to Information Security
Exploiting & Defense Day 2 Recap
Introduction to Compilers Tim Teitelbaum
Basic Microprocessor Architecture
CSC 495/583 Topics of Software Security Return-oriented programming
Recitation: Attack Lab
CMSC 414 Computer and Network Security Lecture 21
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures
MIPS Procedure Calls CSE 378 – Section 3.
Lecture 9: Buffer Overflow*
Week 2: Buffer Overflow Part 1.
Week 2: Buffer Overflow Part 2.
Computer Architecture CST 250
X86 Assembly Review.
CSC 497/583 Advanced Topics in Computer Security
Computer Organization and Assembly Language
Understanding and Preventing Buffer Overflow Attacks in Unix
System and Cyber Security
Computer Architecture and System Programming Laboratory
Return-to-libc Attacks
Presentation transcript:

Summary by - Bo Zhang and Shuang Guo [Date: 03/31/2014] Return-Oriented Programming: Systems, Languages, and Applications -- Ryan Roemer, Erik Buchanan, Hovav Shacham, and Stefan Savage, UCSD Summary by - Bo Zhang and Shuang Guo [Date: 03/31/2014]

Contents 1. Introduction 2. Background: Attacks and Defenses 3. The X86 And SPARC Architectures 4. Return-Oriented Programming 5. X86 Gadget Catalog 6. Conclusion

1.Introduction The problem of malicious code is one that has long troubled the security community. Since we cannot accurately predict whether a particular execution will be benign or not, most work over the past two decades has focused on preventing the introduction and execution of new malicious code. Most of this activity falls into two categories: Efforts attempting to guarantee the integrity of control flow in existing programs. Efforts attempting to isolate “bad” code that has been introduced into the system.

1.Introduction In this article, we present a new form of attack, return-oriented programming. Each snippet ends in a ret instruction, which allows an attacker who controls the stack to chain them together. The organizational unit of a return-oriented attack is the gadget. Each gadget is an arrangement of words on the stack

2.Background: Attacks and Defenses Traditional way of attacker : injecting code in the memory Example of Defense: W⊕X protections W⊕X, ensures that no memory location in a process image is marked both writable (W) and executable (X). With W⊕X, there is no location in memory into which the attacker can inject code to execute.

2.Background: Attacks and Defenses With return-oriented programming An attacker who has diverted a program’s control flow can induce it to undertake arbitrary behavior without introducing any new code.

2.Background: Attacks and Defenses The most familiar vulnerability class is the stack buffer overflow Other classes have been considered: buffer overflows on the heap integer overflows format string vulnerabilities

2.Background: Attacks and Defenses Consider an attacker who has discovered a vulnerability in some program and wishes to exploit it. To achieve his goal, the attacker must (1) subvert the program’s control flow from its normal course stack-smashing(stack buffer overflow ) (2) redirect the program’s execution. injecting code into the stack using shellcode;

3. The X86 And SPARC Architectures The two architectures (1) variable-length instructions vs. fixed-length instructions (2) complex instructions (CISC) vs. a concise set of simple instructions(RISC) (3) very few general-purpose registers vs. so many general-purpose registers

3.1 The x86 Architecture Eight general-purpose integer registers: %eax, %ebx, %ecx, %edx, %esi, %edi,%ebp, %esp Six segment registers: %ES、%CS、%SS、%DS、%FS and %GS An instruction pointer register : %eip An flag register : %eflags

3.1 The x86 Architecture

3.2 The x86 and Return-Oriented Programming x86 is suitble for return-oriented programming 1. Few general-purpose registers coordinate dataflow 2. Use of stack attacker can often overwrite instruction sequences ending in %ret can generally be chained together

4.Return Oriented Programming Program Layout : ordinary program program’s text segment return-oriented program stack segment

4.1 Ordinary Execution inst inst inst inst inst inst %eip %eip %eip %eip %eip EIP points after the current instruction to the next one to be executed.

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.2 Return-Oriented Programming pop %edx; ret mov %eax, (%edx); ret more code; ret data %esp

4.3 Ordinary and return-oriented immediates

4.4 Ordinary and return-oriented direct jumps

4.5 A memory-load gadget

4.6 Return-Oriented Exploitation A return-oriented program is one or more gadgets arranged. When they are executed, they will effect the behavior the attacker intends.

5. X86 Gadget Catalog Catalog of gadgets on the --------x86 platform. Load Store

5.1 Loading a Constant

5.2 Loading from Memory

5.3 Storing to Memory

5.4 Control Flow----Unconditional Jump

5.5 Control Flow----Conditional Jumps

5.5 Control Flow----Conditional Jumps (1) Undertake some operation that sets (or clears) flags of interest. (2) Transfer the flag of interest from %eflags to a general-purpose register. (3) Use the flag of interest to perturb %esp conditionally by the desired jump amount.

6. Conclusion We have introduced return-oriented programming, a technique by which an attacker who subverts a program’s control flow can induce it to take arbitrary computation, without injecting any new code.

References 1. Difference between AT&T and Intel instructions: http://blog.sina.com.cn/s/blog_51e9c0ab010099ow.html 2. Return-Oriented Programming:http://en.wikipedia.org/wiki/Return-oriented_programming 3. Assembly Language:http://en.wikipedia.org/wiki/Assembly_language 4. Return-Oriented Programming: Exploitation Without Code Injection https://www.blackhat.com/presentations/bh-usa-08/Shacham/BH_US_08_Shacham_Return_Oriented_Programming.pdf

Questions & Feedback? Thanks!