Buffer Overflow Attacks. Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother.

Slides:



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

Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
CSc 352 Programming Hygiene Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
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.
CMSC 414 Computer and Network Security Lecture 22 Jonathan Katz.
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.
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.
Gabe Kanzelmeyer CS 450 4/14/10.  What is buffer overflow?  How memory is processed and the stack  The threat  Stack overrun attack  Dangers  Prevention.
Teaching Buffer Overflow Ken Williams NC A&T State University.
Teaching Buffer Overflow Ken Williams NC A&T State University.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Lecture 16 Buffer Overflow
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
Secure Embedded Processing through Hardware-assisted Run-time Monitoring Zubin Kumar.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
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.
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)
chap13 Chapter 13 Programming in the Large.
Chapter 6 Buffer Overflow. Buffer Overflow occurs when the program overwrites data outside the bounds of allocated memory It was one of the first exploited.
Computer Security and Penetration Testing
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Buffer Overflows Lesson 14. Example of poor programming/errors Buffer Overflows result of poor programming practice use of functions such as gets and.
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”.
1 Application Security: Electronic Commerce and Chapter 9 Copyright 2003 Prentice-Hall.
Buffer Overflow CS461/ECE422 Spring Reading Material Based on Chapter 11 of the text.
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 Group 7Group 8 Nathaniel CrowellDerek Edwards Punna ChalasaniAxel Abellard Steven Studniarz.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Operating Systems Security
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Buffer overflow and stack smashing attacks Principles of application software security.
Exploiting Instruction Streams To Prevent Intrusion Milena Milenkovic.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
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.
Sem 2v2 Chapter 5 Router Startup and Setup. A router initializes by loading the bootstrap, the operating system, and a configuration file. If the router.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
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.
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.
Unit 2 Personal Cyber Security and Social Engineering Part 2.
Buffer Overflow By Collin Donaldson.
Mitigation against Buffer Overflow Attacks
Sabrina Wilkes-Morris CSCE 548 Student Presentation
Introduction to Operating Systems
Pointers & Dynamic Memory
Protection of System Resources
Text Book: Security in Computing
Introduction to Operating Systems
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
CS5123 Software Validation and Quality Assurance
Understanding and Preventing Buffer Overflow Attacks in Unix
System and Cyber Security
Presentation transcript:

Buffer Overflow Attacks

Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother board operations, to monitor and I/O devices. If the software that manages these systems can be corrupted. If could give the attacker key access to many computer functions.

Using unsafe C functions without any protection code. The program does not validate the input. The return address is adjacent to the program’s code and data. There is a suitable program to exploit the vulnerability.

Unsafe C functions are functions that do not check for bounds when copying or moving data Will not explicitly terminate a string in memory where it should be terminated This problem is mostly related to string and character manipulation such as gets() and strcpy(). Programmers need to check boundaries to have effective garbage collection in code.

#include int main(int argc, char **argv) { /* declare a buffer with max 512 bytes in size*/ char mybuff[512]; /* verify the input */ if(argc < 2) { printf("Usage: %s \n", argv[0]); exit (0); } if (strlen(argv[1]) > 512) exit (1); /* else if there is an input, copy the string into the buffer */ strcpy(mybuff, argv[1]); /* display the buffer's content */ printf("Buffer's content: %s\n", mybuff); return 0; } Simply adding extra code to check the boundary. If the boundary is violated, the program will just exit.

Input validation also can be implemented in the program to stop the buffer overflows Problem is, not all the input combinations can be tested Based on the types of interfaces the application will use? Enhancing validating inputs with something like this shown on the next page.

The previous code can be enhanced further by validating inputs of common characters people might input. if (strlen(argv[1]) > 512) if(element_of_argv[1] == NOP && element_of_argv[1] == "sh" &&...) if(last_argv[1]_element != '\0') exit (1); In addition, if its a web form, check the controls validation rules for default settings.

Depending how you compile your code some compliers will place return address adjacent to the program’s data and code. Moreover, based on what environment your program will run in. Unix, Window….etc. Each environment will have setup options that will help you stop Buffer Overflow problems. So during the analysis phase of development, know what you can and cannot do based on the environment your program will live in.

Test your code for suitable exploits and have built in termination protocols. Know what types of shell-scripts one might create to start a Buffer Overflow incident within your environment. In addition, how might these scripts be used to overwrite return addresses? What tools does the environment offer to protect your software, and what might you have to built into your program.

The following Figure shows a block diagram for computer system detection and prevention at various stages Secure coding practices, using secure library, simple check list, etc /GS options, canary, warning messages, encrypt the return address, storing return add as different locations, etc Kernel patch – SE-Linux (Role Based and Code Based Security Access, Exec-Shield – address space randomization. Patch-Guard, etc NX/XD bit flag. Control Registers (CR) Memory Management Unit (MMU), etc. Non- executable flag, etc Intrusion Detection System (IDS), firewall, etc

Part A, The programmer role. Programmers must know and practice secure coding Part B, The compiler, OS, memory and processor roles to detect and/or prevent buffer overflow Part C, Memory management, processor and OS play a roles to help prevent the buffer overflow Part A Part B Part C

Part A, This diagram shows best practices for training and editing code Part A, Also is where Secure code and testing should take place before compiling. Part A Part B Part C

The last diagram incorporates secure coding knowledge and enhancing the editor for best practices. The buffer overflow vulnerability and exploit are best taught by example using unsafe C code. Some of the newer compliers like Visual Studio have intellisense installed and will point out coding problems relating to Buffer Overflows. Others will not have advance features like this, so training will be key for programmers.

The End