Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

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

Defenses. Preventing hijacking attacks 1. Fix bugs: – Audit software Automated tools: Coverity, Prefast/Prefix. – Rewrite software in a type safe languange.
CS457 – Introduction to Information Systems Security Software 4 Elias Athanasopoulos
Computer Security: Principles and Practice EECS710: Information Security Professor Hossein Saiedian Fall 2014 Chapter 10: Buffer Overflow.
Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Causes Author: Jedidiah.
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.
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.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
Software and Software Vulnerabilities. Synopsis Array overflows Stack overflows String problems Pointer clobbering. Dynamic memory management Integer.
Chapter 9 Security Authentication Insider Attacks Exploiting Code Bugs.
SQL Injection and Buffer overflow
Andrea Bittau, Adam Belay, Ali Mashtizadeh, David Maziéres, Dan Boneh
Buffer Overflow Attacks Figure (a) Situation when the main program is running. (b) After the procedure A has been called. (c) Buffer overflow shown.
1 RISE: Randomization Techniques for Software Security Dawn Song CMU Joint work with Monica Chew (UC Berkeley)
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.
Buffer Overflow Attacks. Memory plays a key part in many computer system functions. It’s a critical component to many internal operations. From mother.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Computer Security and Penetration Testing
Mitigation of Buffer Overflow Attacks
Brian E. Brzezicki. This tutorial just illustrates the underlying concepts of buffer overflows by way of an extremely simple stack overflow  Most buffer.
CNIT 127: Exploit Development Ch 4: Introduction to Format String Bugs.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
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.
Part I The Basic Idea software sequence of instructions in memory logically divided in functions that call each other – function ‘IE’ calls function.
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.
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.
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.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Embedding Assembly Code in C Programs תרגול 7 שילוב קוד אסמבלי בקוד C.
CNIT 127: Exploit Development Ch 8: Windows Overflows Part 1.
Week-14 (Lecture-1) Malicious software and antivirus: 1. Malware A user can be tricked or forced into downloading malware comes in many forms, Ex. viruses,
Secure Programming Dr. X
Major Problem Areas for Secure Programming
Mitigation against Buffer Overflow Attacks
Last week: We talked about: History of C Compiler for C programming
Protecting Memory What is there to protect in memory?
Protecting Memory What is there to protect in memory?
Secure Programming Dr. X
Module 30 (Unix/Linux Security Issues II)
Protecting Memory What is there to protect in memory?
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
System Calls Richard Newman University of Florida.
CMSC 414 Computer and Network Security Lecture 21
Summary by - Bo Zhang and Shuang Guo [Date: 03/31/2014]
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Software Security Lesson Introduction
Format String.
CSC 495/583 Topics of Software Security Format String Bug (2) & Heap
CS703 - Advanced Operating Systems
The Assembly Language Level
Week 2: Buffer Overflow Part 2.
Understanding and Preventing Buffer Overflow Attacks in Unix
Format String Vulnerability
Return-to-libc Attacks
Presentation transcript:

Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

What we are covering Exploiting Software Insider Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Exploiting Software – Buffer overflow attacks Control Flow Attacks Non-Control Flow Attacks – Memory Corruption Attacks Format String Attack Dangling pointers – Null Pointer Dereference Attacks – Integer Overflow attacks – Command Injection Attacks – Time of Check to Tome of Use Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Insider Attacks – Logic Bomb – Back Doors – Login Spoofing Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Buffer Overflow Attacks (a) Situation when the main program is running. (b) After the procedure A has been called. (c) Buffer overflow shown in gray. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Defense: Stack Canaries Modern computers use digital ‘canaries’ as an early warning system, detecting possible buffer overflow attack. In the code, at places where the program makes a function call, the compiler inserts code to save a random ‘canary’ value on the stack, just below the return address. The compiler inserts code at the return to check the canary value. If the canary has changed… trouble! Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Defense: Data Execution Prevention Redefine the ‘real’ problem: The fact that the attacker can inject code and have it executed in the heap or stack! Defense: prevent the bytes provided by the attacker from being executed as legitimate code. Modern CPUs have a feature NX bit (No-eXecute bit). It distinguishes between data segments and the code segments. This ensures data segments are writable, but not executable. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Code Reuse Attacks Attacker constructs the necessary functions out of existing functions and instructions in the existing binaries and libraries Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Code Reuse Attacks: return to libc Almost all c (C++) programs are linked with a shared library containing the function system. System takes a string containing a command and passes it to the shell for execution. Attack: Place a string containing commands to be executed and divert control the system function via the return address. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reservesd.

Code Reuse Attacks Return-Oriented Programming (ROP) Return-oriented programming: linking gadgets Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Defense: Address Space Layout Randomization (ASLR) Randomize the address of functions and data between every run of the program Supported with varying granularity. Few apply it to the system kernel Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Non-Control Flow Attacks Change the data instead of the return addresses!! Possible use: change the security credentials granting more or less protection on objects. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Format String Attacks In a C functions that perform formatting, (printf), when the application doesn’t properly validate the input, the attacker can causes the submitted data to be compromised. EX: By using exactly the right number of %08x, the attacker can use the first four characters of the format string as an address. Tanenbaum & Bo, Modern Operating Sy stems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Dangling Pointers Attack User frees memory. But later tries to access it with the pointer. Attacker places a specific heap object in the memory location the user frees and re-uses Techniques like heap feng shui help attackers pull this off. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Null Pointer Derefence Attacks In linux, the kernel space is mapped to every process’ address space… and whenever the kernel executes it runs in a process’s address space. If a buggy kernel dereferences a NULL pointer, it usually leads to a crash. Or attacker triggers a NULL pointer dereference from the user process. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Null Pointer Derefence Attacks Crash occurs because there is no code at page 0. Using a tool like mmap (Posix function that maps files into memory) attacker can map bad code at that location. Defense: mmap no longer makes it possible to map to page 0. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Integer Overflow Attack Integer errors can happen when mathematical operations, and external input lead to a result that is too large to fit within the range of values that can be stored in variables of a given data type. Can be expoited to corrupt applications. Integer overflow attacks are possible largely due to incorrectly defining numerical data. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Command Injection Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. The execution of arbitrary commands on the host operating system via a vulnerable application. Command injection attacks are possible largely due to insufficient input validation.

Command Injection Attacks Command injection attacks are possible largely due to insufficient input validation. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Suppose user enters for the destination file: ‘file2.txt; rm –rf Command excited is then: system(“cp file1 file 2; rm –rf”)

Time of Check to Time of Use Attack Exploits a race condition Example: if (access(“./myPasswordFile”, W_OK) != 0) {return;} fd = open(“./ myPasswordFile, W_WRONLY) …. Between the statements, attacker creates a symbolic link with the same file name to the password file Then user writes password information to attackers file. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Insider Attacks Executed by programmers from within the company. Attackers have specialized knowledge Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Logic Bomb Code secretly inserted into system Waits for a specific date or time….. ….. or until employee is fired and no longer feeds it the ‘wait’ command Then execute the bad behavior. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.

Back Doors (a) Normal code. b) Code with a back door inserted. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Defense: Code reviews

Login Spoofing (a)Correct login screen. (b) Phony login screen. Defense: have a login sequence start with a key combination the user programs can’t catch: CTLR-ALT-DEL in Windows cause the current user to log out and system login program started. Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved. Legitimate user attempting to collect other people’s passwords.

End of Part 2 Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.