DICOTS and StackGuard: Two current approaches to tolerating malicious code Carl Landwehr Mitretek Systems, Inc. 7525 Colshire Dr. McLean, VA 22102

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

Exploring Security Vulnerabilities by Exploiting Buffer Overflow using the MIPS ISA Andrew T. Phillips Jack S. E. Tan Department of Computer Science University.
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.
Master/Slave Architecture Pattern Source: Pattern-Oriented Software Architecture, Vol. 1, Buschmann, et al.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
K. Salah1 Buffer Overflow The crown jewel of attacks.
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.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Slide 1 Client / Server Paradigm. Slide 2 Outline: Client / Server Paradigm Client / Server Model of Interaction Server Design Issues C/ S Points of Interaction.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Buffer Overflow By: John Quach and Napoleon N. Valdez.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Chapter 9 : Distributed Database.
Achieving Trusted Systems by Providing Security and Reliability Ravishankar K. Iyer, Zbigniew Kalbarczyk, Jun Xu, Shuo Chen, Nithin Nakka and Karthik Pattabiraman.
Address Obfuscation: An Efficient Approach to Combat a Broad Range of Memory Error Exploits Sandeep Bhatkar, Daniel C. DuVarney, and R. Sekar Stony Brook.
CS252: Systems Programming Ninghui Li Final Exam Review.
Shuo Chen, Jun Xu, Emre C. Sezer, Prachi Gauriar, and Ravishankar K. Iyer Brett Hodges April 8, 2010.
Address Space Layout Permutation
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
Michael Ernst, page 1 Collaborative Learning for Security and Repair in Application Communities Performers: MIT and Determina Michael Ernst MIT Computer.
Computer Security and Penetration Testing
Carnegie Mellon Selected Topics in Automated Diversity Stephanie Forrest University of New Mexico Mike Reiter Dawn Song Carnegie Mellon University.
Buffer Overflow Detection Stuart Pickard CSCI 297 June 14, 2005.
Mitigation of Buffer Overflow Attacks
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Automatic Diagnosis and Response to Memory Corruption Vulnerabilities Presenter: Jianyong Dai Jun Xu, Peng Ning, Chongkyung Kil, Yan Zhai, Chris Bookhot.
Buffer Overflow Attack-proofing by Transforming Code Binary Gopal Gupta Parag Doshi, R. Reghuramalingam The University of Texas at Dallas 11/15/2004.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
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.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Buffer overflow and stack smashing attacks Principles of application software security.
A Survey on Runtime Smashed Stack Detection 坂井研究室 M 豊島隆志.
Buffer Overflows Taught by Scott Coté.-. _ _.-. / \.-. ((___)).-. / \ /.ooM \ / \.-. [ x x ].-. / \ /.ooM \ -/ \ /-----\-----/---\--\ /--/---\-----/-----\ / \-
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.
May07-02: Parking Meter Clint Hertz: Team Leader Austyn Trace: Communications Nick Hollander Christian Baldus.
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.
Testing Exploits and Malware in an isolated environment Luca Allodi – Fabio Massacci – Vadim Kotov
CACI Proprietary Information | Date 1 PD² v4.2 Increment 2 SR13 and FPDS Engine v3.5 Database Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead.
@Yuan Xue Worm Attack Yuan Xue Fall 2012.
Memory Protection through Dynamic Access Control Kun Zhang, Tao Zhang and Santosh Pande College of Computing Georgia Institute of Technology.
Teaching slides Chapter 6. Chapter 6 Software user interface design & construction Contents Introduction Graphical user interface – Rich window based.
Database and Cloud Security
Secure Programming Dr. X
Mitigation against Buffer Overflow Attacks
Protecting Memory What is there to protect in memory?
JDBC Database Management Database connectivity
Protecting Memory What is there to protect in memory?
Secure Programming Dr. X
Protecting Memory What is there to protect in memory?
CSC 495/583 Topics of Software Security Stack Overflows (2)
Secure Software Development: Theory and Practice
CMSC 414 Computer and Network Security Lecture 21
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Defending against Stack Smashing attacks
Software Security Lesson Introduction
Format String.
CSC 495/583 Topics of Software Security StackGuard & Format String Bug
Understanding and Preventing Buffer Overflow Attacks in Unix
Return-to-libc Attacks
Presentation transcript:

DICOTS and StackGuard: Two current approaches to tolerating malicious code Carl Landwehr Mitretek Systems, Inc Colshire Dr. McLean, VA (703)

2 DICOTS: Data Integrity for COTS Databases Research project at Naval Research Lab Based on Integrity Cluster concept (J. McDermott) Developed and prototyped by B. Montrose and L. Day

3 What is the Threat? Malicious code embedded in COTS products may compromise the integrity of this data. Select About from help menu Ctrl-drag “e” graphic onto Earth Release Ctrl Key Ctrl-drag “e” again to push text out of the way Press “unlock” button Return “e” to Earth Type X97:L97 Press Enter then Tab Hold Ctrl-Shift while you click on the Chart Wizard Button in the toolbar Open a New Sheet Press the F5 key

4 Majority Vote Technical Approach Diverse & Redundant Databases with a Trustworthy Voter

5 Supporting Research Integrity Clusters Integrity Cluster: diverse, redundant data-storing components accessed and controlled exclusively by an Integrity Controller. The Integrity Controller replicates transactions to all of its attached data storages in a one-copy serializable fashion. Data integrity is verified by comparing replicas. Integrity Cluster Criticisms Maintaining at least three redundant replicas at one site is impractical. Remedy: DICOTS can be made to work with existing distributed databases. Performance cost (from serialization) is intuitively high. Remedy: measure the actual performance, assess, seek speed-ups

6 Technical Approach Consistency Among Replicas

7 Sybase Host Sybase DB Client Host Sybase ODBC Driver COTS ODBC Software Open Database Connectivity Technical Solution Vendor provides ODBC driver designed to run directly on DBMS Practical implementation of DICOTS requires network between client and database server

8 COTS ODBC Software Client Host DICOTS Operation Sybase Host Sybase DB Oracle Host Oracle DB Informix Host Informix DB Sybase ODBC Driver Oracle ODBC Driver Informix ODBC Driver Custom ODBC Driver ODBC Proxy Interface DICOTS implements custom ODBC driver as DLL Application generates std database calls; DLL packages data, initiates TCP/IP connection, and transfers to proxy Proxy polls incoming links round robin When transaction found, it accepts and initiates it at all three back ends Proxy waits for all backends to finish If data returned, proxy votes it and reports failure if appropriate (note format issues) Then accept another transaction COTS ODBC Software Client Host Custom ODBC Driver COTS ODBC Software Client Host Custom ODBC Driver

9 DICOTS preliminary results Feasible to construct the architecture Partial set of ODBC API implemented Some compatibility issues encountered Benchmarking in progress Initial evidence: retrieval times considerably longer than update Current implementation represents baseline, near worst case

10 StackGuard: Tolerating Stack Smashing Attacks Stack Smashing Attacks are Legion Vulnerabilities attributable to buffer overflow/stack smashing attacks in CERT advisories since 1997: –1997: 14 of 28 –1998: 7 of 12 –1999: 5 of 12 (to Oct 1) Effective countermeasure to stack smashing could eliminate many actual attacks

11 Problem: Buffer Overflow Attack Attacker feeds a big string to an input routine that does not do bounds checking String over-writes return address String injects code Function return jumps to injected code Program Text [write protected] Data (static) Stack [read/write OK] Low address High address Buffer Return Address … Other local varioable... Stack frame Normal Stack Execution point Calling stack frame

12 After a Successful Attack Return address points into buffer Buffer contains attack code Executing return invokes attack code Program Text [write protected] Data (static) Stack [read/write OK] Low address High address Attack code Return Address … Other variable... Stack frame Smashed Stack

13 Problems for the attacker Hacker must find: program that runs with system privileges (e.g., root privilege) and fails to check the length of its input Hacker needs to know: –Address of the start of the buffer within the stack, to set up return address properly –Distance between start of buffer and the return address in the stack, to write a string long enough to rewrite the return address –The actual attack code (binary instructions) to create a new process [exec(“sh”)] Hacker must be able to enter entire attack string as single string input (typically, no embedded nulls) –May have to specialize machine instruction to avoid nulls in attack code

14 Attacker tricks By starting the attack code with NOPs, the rewritten return address only need be approximate By writing the guessed return address several times, the guessed displacement from buffer start to return address need only be approximate Low address High address NOP... NOP Attack Code Return Address

15 StackGuard Solution: Detect Stack Smashing As it Happens Crispin Cowan, Calton Pu, Oregon Grad Inst. StackGuard is a compiler that emits robust bug tolerant code –Stack smashing vulnerabilities are not repaired, nor are the attacks prevented Instead, program detects attack in progress –Stack smash corrupts running function’s activation record –StackGuard code generator detects corruption before return, preventing attacker from getting control

16 StackGuard 1: Defend Programs with a Stack Integrity Check Stack smash goes through –Attack code injected –Return address altered But Stack smash also smashes the Canary –Function checks for Canary before returning –If Canary smashed, program halts instead of yielding control to the attacker Low address High address Buffer Return Address Canary Stack frame Normal Stack Calling stack frame Other local variables...

17 Canary Integrity Problem: –attacker customizes attack string so that string over-write replaces proper canary word Original solution: random canaries –Choose random canary values at exec() time Requires lookup on each function call and return –Slow –Can’t be used with shared libraries

18 Faster, Better Canary Integrity: StackGuard 1.1 New solution: “terminator” canary –canary word is Null, CR, LF, and -1 –I.e. the common termination symbols for C string functions Hard for attacker to embed a termination symbol in the attack string Improvement: static canary lookup –Faster –Can be used with shared libraries

19 What this solution requires Recompile vulnerable programs with StackGuard compiler –Changes call sequence to add canary to stack –Changes return sequence to check canary before returning If canary intact, return normally If canary not intact, abort the process Programs not recompiled by Stackguard are not protected, but not affected (no compatibility issue)

20 How good is the protection? Possible to rewrite return address randomly in some situations, but much more difficult; virtually impossible for this kind of attack Overhead for StackGuard 1.1 (fixed canary) is barely measurable (time and space)

21 References McDermott, J. and Froscher, J. “Practical Defenses Against Storage Jamming,” in Proceedings of the 20th National Information Systems Security Conference, Baltimore, MD, October 1997, pp McDermott, J. Integrity Clusters. Submitted for publication, Journal of Computer Security, 1999 Aleph One. Smashing Stacks for Fun and Profit. Phrack V. 7, issue Cowan, Crispin, Calton Pu, et. Al. StackGuard Automatic Adaptive Detection and Prevention of Buffer Overflow Attacks. Proceedings 7th USENIX Conf. Available at