CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.

Slides:



Advertisements
Similar presentations
Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
Advertisements

Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
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.
Moving Target Defense in Cyber Security
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.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
NECESSARY BACKGROUND ON MEMORY EXPLOITS AND WEB APPLICATION VULNERABILITIES 1.
CS 153 Design of Operating Systems Spring 2015 Lecture 19: Page Replacement and Memory War.
CMSC 414 Computer and Network Security Lecture 25 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 18 Jonathan Katz.
Lecture 16 Buffer Overflow
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2012.
CMSC 414 Computer and Network Security Lecture 20 Jonathan Katz.
Buffer Overflow Attacks. Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2013.
Static Analysis for Security Amir Bazine Per Rehnberg.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
Address Space Layout Permutation
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Exploitation: Buffer Overflow, SQL injection, Adobe files Source:
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Attacking Applications: SQL Injection & Buffer Overflows.
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.
COMPUTER SECURITY MIDTERM REVIEW CS161 University of California BerkeleyApril 4, 2012.
Buffer Overflow CS461/ECE422 Spring Reading Material Based on Chapter 11 of the text.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
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 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)
Buffer Overflow Proofing of Code Binaries By Ramya Reguramalingam Graduate Student, Computer Science Advisor: Dr. Gopal Gupta.
Buffer Overflow Group 7Group 8 Nathaniel CrowellDerek Edwards Punna ChalasaniAxel Abellard Steven Studniarz.
Buffer Overflow Attack Proofing of Code Binary Gopal Gupta, Parag Doshi, R. Reghuramalingam, Doug Harris The University of Texas at Dallas.
What is exactly Exploit writing?  Writing a piece of code which is capable of exploit the vulnerability in the target software.
Introduction to Information Security ROP – Recitation 5.
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.
Buffer overflow and stack smashing attacks Principles of application software security.
On the Effectiveness of Address-Space Randomization Hovav Shacham, Matthew Page, Ben Pfaff, Eu-Jin Goh, Nagendra Modadugu, Dan Boneh.
Buffer Overflows Taught by Scott Coté.-. _ _.-. / \.-. ((___)).-. / \ /.ooM \ / \.-. [ x x ].-. / \ /.ooM \ -/ \ /-----\-----/---\--\ /--/---\-----/-----\ / \-
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.
VM: Chapter 7 Buffer Overflows. csci5233 computer security & integrity (VM: Ch. 7) 2 Outline Impact of buffer overflows What is a buffer overflow? Types.
Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade Crispin Cowan SANS 2000.
Chapter 10 Buffer Overflow 1. A very common attack mechanism o First used by the Morris Worm in 1988 Still of major concern o Legacy of buggy code in.
1 Introduction to Information Security , Spring 2016 Lecture 2: Control Hijacking (2/2) Avishai Wool.
CS703 - Advanced Operating Systems By Mr. Farhan Zaidi.
Secure Programming Dr. X
Shellcode COSC 480 Presentation Alison Buben.
Mitigation against Buffer Overflow Attacks
Sabrina Wilkes-Morris CSCE 548 Student Presentation
Secure Programming Dr. X
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2016.
Introduction to Information Security
CSC 495/583 Topics of Software Security Stack Overflows (2)
CSC 495/583 Topics of Software Security Return-oriented programming
CMSC 414 Computer and Network Security Lecture 21
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2011.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow II: Defense Techniques Cliff Zou Spring 2009.
Buffer Overflows.
CS5123 Software Validation and Quality Assurance
Understanding and Preventing Buffer Overflow Attacks in Unix
CNT4704: Analysis of Computer Communication Network Special Topic: Buffer Overflow II: Defense Techniques Cliff Zou Fall 2011.
Return-to-libc Attacks
Presentation transcript:

CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz

Defenses (overview)  Prevent overflows from existing –Safe programming techniques/languages –Input validation –Static/dynamic analysis  Prevent overflows from being exploited –Intercept function calls (e.g., Libsafe) –Canaries (StackGuard) –Non-executable stack, data execution prevention (DEP) –Address space layout randomization/ASLR Development/ compile time O/S

Static analysis  Static analysis: analyze source code (or object code) without actually running the program  Can vary in complexity –flawfinder – checks code for instances of problematic functions (gets, strcpy, etc.) –Fortify –SPLINT – programmer annotates their code with pre-/post- conditions that are verified by the tool E.g., buf[i]=x  (Provably) impossible to be perfect –False positives/negatives, with the usual tradeoffs… Too many false negatives will make programmers less likely to use the tool

Dynamic analysis  “Run” program (actually or symbolically) in an attempt to find security holes –Fuzzing can also be viewed as a type of dynamic analysis  Comparison? –Static analysis may require annotation of source –Dynamic analysis can be better, but slower

Libsafe  Linked to code at compilation time  Intercepts all calls to unsafe functions, and replaces them with safe versions –e.g., gets (dest) changed to fgets(dest, maxSize, stdin), where maxSize is computed from dest  Drawbacks –Adds overhead –Only protects against a limited class of exploits –Requires linking to it at compile time –Only available for x86 processors –Incompatible with other techniques (e.g., StackGuard)

StackGuard  Embed random “canaries” in stack frames and verify their integrity prior to function return  Some possibilities: –NULL canaries –Random canaries eipebplocalcanaryeipebp local canary Frame 1Frame 2

Drawbacks of StackGuard  Adds overhead  Only addresses stack overflows  NULL canaries can potentially be overwritten  Random canary values can potentially be learned (e.g., using format string vulnerabilities)

Non-executable stack  A.K.A. data execution prevention (DEP) –Separate memory space for instructions from memory space allocated to the stack  Drawbacks –Does not address general buffer/heap overflows, just execution of injected code from the stack –Does not address `return-to-libc’ exploits Overflow sets ret-addr to address of libc function E.g, system(“/bin/sh”);

ASLR  Address-space layout randomization (ASLR)  Idea: randomize the location of the stack –Prevents setting the EIP to point to the stack  Countermeasures –Inject shellcode below the stored EIP; set EIP to point to a ‘JMP ESP’ instruction –Use huge NOP sled and try several times; stack randomization uses relatively little entropy –Use other vulnerabilities (e.g., format string vulnerabilities) to learn stack layout

Further reading

More input validation flaws

Input validation  Buffer overflows can be viewed as an example of problems caused by improper input validation  There are many other important examples as well

Validating input  Filenames –Disallow *,.., etc.  Command-line arguments –Even argv[0]…  Commands –E.g., SQL  Integer values –Check for negative inputs –Check for large inputs that might cause overflow!  Web attacks –E.g., cross site scripting, more