Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh

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

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.
Computer Security: Principles and Practice First Edition by William Stallings and Lawrie Brown Lecture slides by Lawrie Brown Chapter 11 – Buffer Overflow.
Lecture 16 Buffer Overflow modified from slides of Lawrie Brown.
University of VirginiaDARPA SRS - 27 Jan Effectiveness of Instruction Set Randomization Ana Nora Sovarel and David Evans DARPA SRS – Genesis Project.
Part III Counter measures The best defense is proper bounds checking but there are many C/C++ programmers and some are bound to forget  Are there any.
Review: Software Security David Brumley Carnegie Mellon University.
Foundations of Network and Computer Security J J ohn Black Lecture #30 Nov 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
Framing Signals— A Return to Portable Shellcode
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
CS 153 Design of Operating Systems Spring 2015 Lecture 19: Page Replacement and Memory War.
Netprog: Buffer Overflow1 Buffer Overflow Exploits Taken shamelessly from: netprog/overflow.ppt.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
Address Space Layout Permutation
On the Effectiveness of Address-Space Randomization CS6V Brian Ricks and Vasundhara Chimmad.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Buffer overflows.
Exploiting Buffer Overflows on AIX/PowerPC HP-UX/PA-RISC Solaris/SPARC.
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”.
CNIT 127: Exploit Development Ch 4: Introduction to Format String Bugs.
Buffer Overflow CS461/ECE422 Spring Reading Material Based on Chapter 11 of the text.
Exploit Defenses: ASLR, W X, TaintCheck Brad Karp UCL Computer Science CS GZ03 / th December, 2007.
Overflows & Exploits. In the beginning 11/02/1988 Robert Morris, Jr., a graduate student in Computer Science at Cornell, wrote an experimental, self-replicating,
Lecture 9: Buffer Ovefflows and ROP EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
Introduction to Information Security ROP – Recitation 5.
Information Leaks Without Memory Disclosures: Remote Side Channel Attacks on Diversified Code Jeff Seibert, Hamed Okhravi, and Eric Söderström Presented.
1 Understanding Pointers Buffer Overflow. 2 Outline Understanding Pointers Buffer Overflow Suggested reading –Chap 3.10, 3.12.
Lecture 13 Page 1 CS 236 Online Major Problem Areas for Secure Programming Certain areas of programming have proven to be particularly prone to problems.
Where’s the FEEB?: Effectiveness of Instruction Set Randomization Nora Sovarel, David Evans, Nate Paul University of Virginia Computer Science USENIX Security.
Carnegie Mellon 1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Machine-Level Programming V: Buffer overflow Slides.
On the Effectiveness of Address-Space Randomization Hovav Shacham, Matthew Page, Ben Pfaff, Eu-Jin Goh, Nagendra Modadugu, Dan Boneh.
Reminder Bomb lab is due tomorrow! Attack lab is released tomorrow!!
Information Security - 2. A Stack Frame. Pushed to stack on function CALL The return address is copied to the CPU Instruction Pointer when the function.
Group 9. Exploiting Software The exploitation of software is one of the main ways that a users computer can be broken into. It involves exploiting the.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2013.
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.
CNIT 127: Exploit Development Ch 8: Windows Overflows Part 1.
Introduction to InfoSec – Recitation 3 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (infosec15 at modprobe.net)
ROP Exploit. ROP Return Oriented Programming (ROP): is a hacking exploit technique where you exploit buffer overflow to inject a chain of gadgets. Each.
Introduction to Information Security
Secure Programming Dr. X
Shellcode COSC 480 Presentation Alison Buben.
Mitigation against Buffer Overflow Attacks
Remix: On-demand Live Randomization
Buffer Overflow Buffer overflows are possible because C doesn’t check array boundaries Buffer overflows are dangerous because buffers for user input are.
Return Oriented Programming
Jump-Oriented Programming
The Hardware/Software Interface CSE351 Winter 2013
Secure Programming Dr. X
Recitation: Attack Lab
Introduction to Information Security
Jump Over ASLR: Attacking Branch Predictors to Bypass ASLR
CSC 495/583 Topics of Software Security Stack Overflows (2)
CSC 495/583 Topics of Software Security Return-oriented programming
Recitation: Attack Lab
Summary by - Bo Zhang and Shuang Guo [Date: 03/31/2014]
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Recitation: Attack Lab
Smashing the Stack for Fun and Profit
CSC 495/583 Topics of Software Security StackGuard & Format String Bug
Machine Level Representation of Programs (IV)
Week 2: Buffer Overflow Part 1.
CTF Class 2018 By: Shawn Stone
Week 2: Buffer Overflow Part 2.
Format String Vulnerability
Return-to-libc Attacks
Presentation transcript:

Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh Hacking Blind Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh

Buffer Overflows Attacker sends data bigger than the buffer, the excess data overwrites memory beyond the buffer Stack buffer overflows are the easiest attack to succeed with because return addresses are implicitly close in memory Code Injection Attack - the attacker includes malicious code as a part of the payload  then simply sets the return address to the code that was injected as part of the payload Modern OS’s though mark data memory pages as non-executable (NX on X86)

Address Space Layout Randomization Randomizes the location of code and data memory segments in the process address space Makes it hard to predict the location of code or even the stack in advance On 32 bit platforms usually only 16 bits for randomization Easy to Brute force attack it 64-bit systems have too many random bits to effectively brute force

Canaries – A secret value is determined in advance and placed before each saved frame pointer and return address When a function is returned the canaries are checked, if it has changed an attacked has been detected and the program terminates Canaries are guessed one byte at a time If canaries rerandom after every crash then ROP attacks are impossible

Return-Oriented Programming (ROP) Developed to defeat NX memory Relies on collecting gadgets Gadgets are machine instruction sequences already on the machine Return into Library – A high level library function such as system() is set as the return address 64 bit systems arguments are passed in registers so gadgets are need to populate registers

To defeat NX the attacker must know of where gadgets reside in the program executable To defeat ASLR the attacker must derandomize the location at which the executable’s text segment is actually loaded into memory The first requirement generally means you need to have a binary available for 64 bit If Position Independent Executables (PIE) is enabled on a linux device the entire address space is randomized

Registers rdi and rsi control the first 2 arguments of to systems calls Register rax controls controls the system call number Registers can be controlled by using pop gadgets and placing the value to load on the stack

Blind Remote Oriented Programming (BROP) We assume a stack vulnerability and knowledge of how to trigger it A server application that restarts after a crash Phases of a BROP attack Stack Reading: read the stack to leak canaries and a return address to defeat ASLR Blind ROP: Find enough gadgets to invoke write and control its arguments  you can now transfer the binary Build the exploit: Dump enough of the binary to find enough gadgets to build a shellcode, and launch the exploit

Finding Gadgets Remotely scan the applications text segment bye overwriting the saved return address The program will either crash or continue running, if it continues running you have found a gadget A stop gadget is a gadget which suspends program execution but keeps the connection running – like sleep or an infinite loop Stop gadgets are placed after the adress you are scanning, 2 are needed to keep pop from crashing

Probe – the address being scanned Stop – The address of a stop gadget that will not crash Trap – The address of non-executable memory that will cause a crash The idea is to vary the position of stops and traps on the stack to deduce what the gadget being probed is Probe, stop, trap, trap ….. Will find gadgets that do not pop the stack like ret or xor Probe, trap, stop, trap, trap…. Will find gadgets that pop exactly one thing off the stack like pop rax; ret or pop rdi; ret

Finding the PLT Each entry is 16 bytes apart Most PLT entries will not cause a crash since they are system calls The PLT is found by scanning from the programs origin The PLT can be verified by setting a prode stop trap and also by using offsets of six bytes to use the PLT slowpath

To control the third argument one needs to find a call to strcmp which sets rdx to the length of the string compared To identify PLT entries we control the first two arguments using the gadgets we found earlier and we see how the function responds Strcmp(bad, bad): Crash Strcmp(bad, readable): Crash Strcmp(readable, bad): Crash Strcmp(readable, readable): No Crash Now that we can control the first three arguments finding write is trivial because we just scan through the PLT entries and force a write to the socket, if a write occurs the location has been found

Summary Find where the executable is loaded. Either 0x400000 for non-PIE executables or stack read a saved return address Find a stop gadget. Like sleep or read. The attacker also finds the PLT at this point Find the BROP gadget. Find strcmp in the PLT. Find write in the PLT. Dump the binary to find more gadgets Build a shell code and exploit the server

If there is no BROP gadget or PLT the attack instead goes: Find all pop x; ret gadgets Find a syscall gadget Identify the pop gadgets