An Empirical Study of the Reliability in UNIX Utilities Barton Miller Lars Fredriksen Brysn So Presented by Liping Cai.

Slides:



Advertisements
Similar presentations
More about Ruby Maciej Mensfeld Presented by: Maciej Mensfeld More about Ruby dev.mensfeld.pl github.com/mensfeld.
Advertisements

CS 450 Module R1. R1 Introduction In Module R1, you will implement a user interface (command handler). There are a couple of options: ▫Command Line: interface.
Computer Science 2212a/b - UWO1 Structural Testing Motivation The gcov Tool An example using gcov How does gcov do it gcov subtleties Further structural.
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.
Buffer Overflow Causes. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Buffer Overflow Causes Author: Jedidiah.
Jerry Lebowitz. Topics  Provides a facility for a systematic object oriented approach to handling runtime errors ◦ Can also handle runtime errors.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
Stack-Based Buffer Overflows Attacker – Can take over a system remotely across a network. local malicious users – To elevate their privileges and gain.
Software and Software Vulnerabilities. Synopsis Array overflows Stack overflows String problems Pointer clobbering. Dynamic memory management Integer.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Chapter 7. 2 Objectives You should be able to describe: The string Class Character Manipulation Methods Exception Handling Input Data Validation Namespaces.
AFID: An Automated Fault Identification Tool Alex Edwards Sean Tucker Sébastien Worms Rahul Vaidya Brian Demsky.
CSE 332: C++ program structure and development environment C++ Program Structure (and tools) Today we’ll talk generally about C++ development (plus a few.
Systems Software Operating Systems.
1 Joe Meehean. 2 Testing is the process of executing a program with the intent of finding errors. -Glenford Myers.
Fundamentals of Python: From First Programs Through Data Structures
CSCI 5801: Software Engineering
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Fundamentals of Python: First Programs
A Visual Comparison Approach to Automated Regression Testing (PDF to PDF Compare)
June 14, 2001Exception Handling in Java1 Richard S. Huntrods June 14, 2001 University of Calgary.
Pragmatic Projects Prepared by Doug Glidden. Pragmatic Projects Pragmatic Teams Ubiquitous Automation Ruthless Testing It’s All Writing Great Expectations.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Computer Security and Penetration Testing
CNG 140 C Programming (Lecture set 9) Spring Chapter 9 Character Strings.
CIS 218 Advanced UNIX1 CIS 218 – Advanced UNIX (g)awk.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Making a great Project 2 OCR 1994/2360. Design Some candidates dive in, make a database or spreadsheet, then try and make a design afterwards. This won’t.
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
16 October Reminder Types of Testing: Purpose  Functional testing  Usability testing  Conformance testing  Performance testing  Acceptance.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Chapter 3: Formatted Input/Output Copyright © 2008 W. W. Norton & Company. All rights reserved. 1 Chapter 3 Formatted Input/Output.
Chapter 0 Getting Started. Objectives Understand the basic structure of a C++ program including: – Comments – Preprocessor instructions – Main function.
QA and Testing. QA Activity Processes monitoring Standards compliance monitoring Software testing Infrastructure testing Documentation testing Usability.
BMTRY 789 Lecture 11: Debugging Readings – Chapter 10 (3 rd Ed) from “The Little SAS Book” Lab Problems – None Homework Due – None Final Project Presentations.
Buffer Overflow Group 7Group 8 Nathaniel CrowellDerek Edwards Punna ChalasaniAxel Abellard Steven Studniarz.
A Tool for Pro-active Defense Against the Buffer Overrun Attack D. Bruschi, E. Rosti, R. Banfi Presented By: Warshavsky Alex.
Exceptions Chapter 16 This chapter explains: What as exception is Why they are useful Java exception facilities.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Lecture 14 Page 1 CS 236 Online Variable Initialization Some languages let you declare variables without specifying their initial values And let you use.
PHP Error Handling Section :I Source: 1.
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.
ICS3U_FileIO.ppt File Input/Output (I/O)‏ ICS3U_FileIO.ppt File I/O Declare a file object File myFile = new File("billy.txt"); a file object whose name.
Sairajiv Burugapalli. This chapter covers three main categories of classic software vulnerability: Buffer overflows Integer vulnerabilities Format string.
Chapter 9: Completing the Basics. In this chapter, you will learn about: – Exception handling – Exceptions and file checking – The string class – Character.
Security Attacks Tanenbaum & Bo, Modern Operating Systems:4th ed., (c) 2013 Prentice-Hall, Inc. All rights reserved.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
Fuzzing And Oracles By: Thomas Sidoti. Overview Introduction Motivation Fuzzable Exploits Oracles Implementation Fuzzing Results.
CHARACTER INPUT / OUTPUT AND INPUT VALIDATION. Introduction Input and output devices: keyboards, disk drives, mouse, monitors, printers. I/O functions.
Chapter Nine Strings. Char vs String Literals Size of data types: Size of data types: –sizeof(“hello\n”)7 bytes –sizeof(“hello”)6 bytes –sizeof(“X”)2.
CSC 4630 Perl 3 adapted from R. E. Beck. Problem But we worked on it first: Input: Read from a text file named in a command line argument Output: List.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
Chapter 3: Formatted Input/Output 1 Chapter 3 Formatted Input/Output.
Tool Support for Testing Classify different types of test tools according to their purpose Explain the benefits of using test tools.
1 ENERGY 211 / CME 211 Lecture 14 October 22, 2008.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Eighth Lecture Exception Handling in Java
Major Problem Areas for Secure Programming
Excel Tutorial 8 Developing an Excel Application
Module 30 (Unix/Linux Security Issues II)
Guide To UNIX Using Linux Third Edition
A First Book of ANSI C Fourth Edition
Topics Introduction to File Input and Output
CSE 403 Lecture 17 Coding.
File Input and Output.
An Overview of C.
Topics Introduction to File Input and Output
Presentation transcript:

An Empirical Study of the Reliability in UNIX Utilities Barton Miller Lars Fredriksen Brysn So Presented by Liping Cai

Overview Introduction Tools Tests Results and Analysis Conclusions

Introduction Why the study is important Contributes to the testing community a large list of real bugs; Finds the bugs that might indicate future security holes; Finds that crashes might be caused by carelessly typing; Would like some meaningful and predictable response when inadvertently feeding programs noisy input; Major utilities should not crash because of noisy phone lines; Would like to see the interactions between random testing and more traditional industrial software testing;

Introduction The project proceeded in four steps: Construct programs to generate random characters and to help test interactive utilities; Use these programs to test a large number of utilities; Identify the strings that crash the programs; Identify the cause of the program crashes and categorize the common mistakes;

The Tools Fuzz: generating random Input Strings fuzz –o outfile | deqn -- capable of producing both printable and control characters, only printable characters, or either of these groups along with the NULL character. -- can specify a delay between each character. -- allows you to specify the seed for the random number generators, to provide for repeatable test. -- can record its output stream in a file, in addition to printing to its standard output. -- there are options to randomly insert newline characters in the output stream, and to limit the length of the output stream.

The Tools Ptyjig: Testing Interactive Utilities -- allocates a pseudo-terminal files -- starts the specified utility program. -- ptyjig passes characters that are sent to its input through the pseudo- terminal to be read by the utility -- example: fuzz –o outfile | ptyjig vi

The Tools The scripts: automating the tests Executes all the utilities for a given set of input characteristics Checks for the existence of a “core” file after each utility terminates; indicating the crash of that utility The core file and offending input data file are saved for later analysis

The tests 7 versions of UNIX 88 utility programs such as the mail program, screen editors, compilers and document formatting packages Each utility program was subjected to several different types of input streams. The major variations in test data were including control characters, NULL, and maximum length of the input stream. The input streams for interactive utilities have slightly different characteristics. To avoid overflowing the input buffers on the terminal device, the input was split into random length lines with a mean length of 128 characters.

The results and analysis Were able to crash or hang a significant number of utility programs on each system(from 24-33%); Detected 2 types of error results, crashing and hanging. Considered crashed if the program terminated producing a core file Considered hung if the program continued executing producing no output while having available input or continued to produce output after its input had stopped. A utility might crash on one system but not on another; Grouped the causes of the crashes into different categories;

The results and analysis (Crash causes) Pointer/Arrays Not checking for exceeding the range of the array. References through a null pointer. Not Checking Return code Sign of careless programming Input Functions gets(), scanf() – no means of bounds checking are possible. Sub-Process Access to sub-process should be carefully controlled or you should insure that the program input to the sub-process is first checked. Alternatively, the utility should be programmed to tolerate with the failure of a sub-process

The results and analysis (Crash causes) Interaction Effects !o%8f causes the VAX version of csh to crash and !o% f hung most versions of csh Bad Error Handler The error recovery routine only increments a count of the number of errors detected, did not exit the code. Signed Characters Can be considered sub-case of pointer/array error Race Conditions Undetermined Errors

Conclusions (Comments on the Results) All Arrays reference should be checked for valid bounds All input fields should be bounded Check all system call return values Pointer values should often be checked before being used. Judiciously extend your trust to others If you redefine something to look too much like something else, you may eventually forget about the redefinition Error handlers should handle errors Goto statements are generally a bad idea

Conclusions (Comments on Lurking Bugs) Bugs often be ignored It is often difficult to isolate exactly what activity caused the program to crash. It quicker to try a slightly different method to get the current job done than it is to find and report a bug. The number of bugs in UNIX might also be explained by its evolution. UNIX should not be singled out as a buggy operating system

FUZZ-Revisited First, the continued prevalence of bugs in the basic UNIX utilities seems a bit disturbing. Second, the reliability of network services and X- Window servers is good news. Third, X-Window applications are no less prone to failure (and seem to be more so) than the basic utilities. Fourth, the reliability of the freely-distributed GNU and Linux software was surprisingly good, and noticeably better than the commercially produced software.

References ftp://grilled.cs.wisc.edu/fuzz ftp://ftp.cs.wisc.edu/paradyn/technical_ papers/fuzz-revisited.pdf ftp://ftp.cs.wisc.edu/paradyn/technical_ papers/fuzz-revisited.pdf ftp://ftp.cs.wisc.edu/paradyn/technical_ papers/fuzz-nt.pdf ftp://ftp.cs.wisc.edu/paradyn/technical_ papers/fuzz-nt.pdf