CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz.

Slides:



Advertisements
Similar presentations
Buffer Overflows Nick Feamster CS 6262 Spring 2009 (credit to Vitaly S. from UT for slides)
Advertisements

Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
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.
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
K. Salah1 Buffer Overflow The crown jewel of attacks.
Chapter 3 (Part 1) Network 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.
SCSC 555 Computer Security Chapter 10 Malicious software Part B.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
CMSC 414 Computer and Network Security Lecture 23 Jonathan Katz.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
CS426Fall 2010/Lecture 111 Computer Security CS 426 Lecture 11 Software Vulnerabilities: Input Validation Issues & Buffer Overflows.
SQL Injection and Buffer overflow
Computer Security and Penetration Testing
Chap 3: Program Security.  Programming errors with security implications: buffer overflows, incomplete access control  Malicious code: viruses, worms,
Control hijacking attacks Attacker’s goal: – Take over target machine (e.g. web server) Execute arbitrary code on target by hijacking application control.
CMSC 414 Computer and Network Security Lecture 20 Jonathan Katz.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
2-1 Last time What is our goal in this course? What is security? What is privacy? Who are the adversaries? Assets, vulnerabilities, threats, attacks and.
Lecture 12 Overview.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
The OWASP Top 10 and Buffer Overflow Attacks
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.
A Security Review Process for Existing Software Applications
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2011.
Lecture 0 Appendix on Implementation Threats Material from Warren Page & Chpt 11, Information Security by Mark Stamp.
Lecture 6: Buffer Overflow CS 436/636/736 Spring 2014 Nitesh Saxena *Adopted from a previous lecture by Aleph One (Smashing the Stack for Fun and Profit)
Computer Security and Penetration Testing
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Cosc 4010 Sandboxing. Last lecture Last time, we covered chroot, which is a method to "sandbox" a problem. –Not full proof by any means. Many simple mistakes.
Attacking Applications: SQL Injection & Buffer Overflows.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
CSCE 548 Secure Software Development Taxonomy of Coding Errors.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
Overflow Examples 01/13/2012. ACKNOWLEDGEMENTS These slides where compiled from the Malware and Software Vulnerabilities class taught by Dr Cliff Zou.
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.
CPSC 6126 Computer Security Information Assurance.
Operating Systems Security
Shellcode Development -Femi Oloyede -Pallavi Murudkar.
Information Leaks Without Memory Disclosures: Remote Side Channel Attacks on Diversified Code Jeff Seibert, Hamed Okhravi, and Eric Söderström Presented.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Lecture 4 Page 1 CS 111 Online Modularity and Virtualization CS 111 On-Line MS Program Operating Systems Peter Reiher.
Web Security Firewalls, Buffer overflows and proxy servers.
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.
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.
CAP6135: Malware and Software Vulnerability Analysis Buffer Overflow : Example of Using GDB to Check Stack Memory Cliff Zou Spring 2014.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
CS703 - Advanced Operating Systems By Mr. Farhan Zaidi.
Software Security Q: What does it mean to say that a program is secure? A: There is a sufficient amount of trust that the program maintains _____________,
Buffer Overflows Incomplete Access Control
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Module 30 (Unix/Linux Security Issues II)
Protecting Memory What is there to protect in memory?
Secure Software Development: Theory and Practice
CMSC 414 Computer and Network Security Lecture 21
Text Book: Security in Computing
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
CS703 - Advanced Operating Systems
CS5123 Software Validation and Quality Assurance
Presentation transcript:

CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz

Application-level security

 I.e., programming-language security  Previous focus was on protocols and algorithms to prevent attacks –Are they implemented correctly?  Here, focus is on programming errors and how to deal with them –Reducing/eliminating/finding errors –Containing damage resulting from errors

Classifying flaws  Intentional flaws –E.g., “backdoors”  Unintentional flaws –E.g., programmer errors

Buffer overflows  50% of reported vulnerabilities  Overflowing a buffer results in data written elsewhere: –User’s data space/program area –System data/program code Including the stack, or memory heap  Can also occur in other contexts –E.g., parameters passed via URL

Example  Suppose a web server contains a function: void func(char *str) { char buf[128]; strcpy(buf, str); do-something(buf); }  When the function is invoked the stack looks like:  What if *str is 136 bytes long? strret-addrsfpbuf top of stack str top of stack *str ret

Basic exploit  Suppose stack looks like:  When func() exits, user will be given a shell !!  Note: attack code runs in stack top of stack *str ret Code for P Program P: exec( “/bin/sh” ) (exact shell code by Aleph One)

Finding buffer overflows  Hackers find buffer overflows as follows: –Run web server on local machine –Issue requests with long tags. All long tags end with “$$$$$” –If web server crashes: search core dump for “$$$$$” to find overflow location.

Incomplete mediation  E.g., changing symbolic link between checking and use  E.g., parameters passed via URL –Parameters may be checked at client-side… –…but checking still necessary server-side  E.g., changing prices in URL…

Cross-site scripting  Violation of privacy…  General rule: always check inputs from untrusted source!

Time-to-check vs. time-of-use  “Serialization/synchronization” flaw  E.g., presenting command; then changing command while it is being verified

Covert channels  Intentionally inserted by programmers into software, to later leak information…  Examples in book…e.g., spacing information in printed page, formats, etc.  Other examples: “file lock” channel, existence/non-existence of file, etc.

Analysis of covert channels  “Shared resource matrix” –Tabulates subjects and the resources thave have access to  Information flow analysis (in source code) –E.g., “B = A” supports info. flow from A to B –“If (D == 1) then B = A” supports info. flow from D to B also! –Trace information flow throughout program…

Timing attacks  Password checking routines…  Web caching

Finding/preventing flaws

Penetration testing?  Limited to finding/patching existing flaws –Cannot be used to guarantee that software is free of all flaws  Patching flaws in this way has its own problems –Narrows focus to fixing a specific flaw, rather than addressing issues more broadly –May introduce new flaws

Automated testing  Successful to some extent  Hard to catch all flaws –Traditional program verification/testing focuses on what a program should do –Here, we are concerned with things a program should not do

Techniques for preventing flaws  Secure programming –Developmental controls –Better techniques –Secure programming languages –Static analysis  Secure compilation –Dynamic analysis –Software fault isolation

Techniques…  Inferring trust –Source authentication/code signing –Proof-carrying code  OS controls –Sandboxing –System-call interposition techniques –Secure boot of OS

Developmental controls…  Modularity –Improves ability to locate flaws –Easier to verify/fix code  Encapsulation/information hiding  Peer review/testing/analysis  Automated code testing

Secure programming techniques (Based on: “Programming Secure Applications for Unix-Like Systems,” David Wheeler)

Overview  Validate all input  Avoid buffer overflows  Program internals…  Careful calls to other resources  Send info back intelligently