Fuzzing Dan Fleck CS 469: Security Engineering Sources:

Slides:



Advertisements
Similar presentations
Integrity & Malware Dan Fleck CS469 Security Engineering Some of the slides are modified with permission from Quan Jia. Coming up: Integrity – Who Cares?
Advertisements

TaintScope: A Checksum-Aware Directed Fuzzing Tool for Automatic Software Vulnerability Detection Tielei Wang 1, Tao Wei 1, Guofei Gu 2, Wei Zou 1 1 Peking.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
1 Automated Testing & Test Tools Apirada Thadadech.
Abhinn Kothari, 2009CS10172 Parth Jaiswal 2009CS10205 Group: 3 Supervisor : Huzur Saran.
T. E. Potok - University of Tennessee Software Engineering Dr. Thomas E. Potok Adjunct Professor UT Research Staff Member ORNL.
Introduction to InfoSec – Recitation 6 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
ReferencesReferences DiscussionDiscussion Vulnerability Example: SQL injection Auditing Tool for Eclipse LAPSE: a Security Auditing Tool for Eclipse IntroductionIntroductionResultsResults.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
(semi)Automatic Methods for Security Bug Detection Tal Garfinkel Stanford/VMware.
Maintaining and Updating Windows Server 2008
Leveraging User Interactions for In-Depth Testing of Web Application Sean McAllister Secure System Lab, Technical University Vienna, Austria Engin Kirda.
1 Joe Meehean. 2 Testing is the process of executing a program with the intent of finding errors. -Glenford Myers.
Test Design Techniques
CAP6135: Malware and Software Vulnerability Analysis Find Software Bugs Cliff Zou Spring 2011.
Terms: Test (Case) vs. Test Suite
Large-scale application security Charlie Eriksen.
MSDN Webcast - SDL Process. Agenda  Fuzzing & The SDL  Integration of fuzzing  Importance of fuzzing Michael Eddington Déjà vu Security
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
A New Fuzzing Technique for Software Vulnerability Testing IEEE CONSEG 2009 Zhiyong Wu 1 J. William Atwood 2 Xueyong Zhu 3 1,3 Network Information Center.
Vulnerability-Specific Execution Filtering (VSEF) for Exploit Prevention on Commodity Software Authors: James Newsome, James Newsome, David Brumley, David.
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Revolutionizing the Field of Grey-box Attack Surface Testing with Evolutionary Fuzzing Department of Computer Science & Engineering College of Engineering.
Approaches to Application Security – DSM
Software Testing Testing principles. Testing Testing involves operation of a system or application under controlled conditions & evaluating the results.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
16 October Reminder Types of Testing: Purpose  Functional testing  Usability testing  Conformance testing  Performance testing  Acceptance.
TaintScope Presented by: Hector M Lugo-Cordero, MS CAP 6135 April 12, 2011.
Software Quality and Testing CPS 109: Program Design and Construction October 28, 2003.
Automatic program generation for detecting vulnerabilities and errors in compilers and interpretersAutomatic program generation for detecting vulnerabilities.
PwC New Technologies New Risks. PricewaterhouseCoopers Technology and Security Evolution Mainframe Technology –Single host –Limited Trusted users Security.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
Software Quality Assurance and Testing Fazal Rehman Shamil.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Dynamic Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
CAP6135: Malware and Software Vulnerability Analysis Find Software Bugs Cliff Zou Spring 2015.
Lecture 15 Page 1 CS 236 Online Evaluating Running Systems Evaluating system security requires knowing what’s going on Many steps are necessary for a full.
Week 6 MondayTuesdayWednesdayThursdayFriday Testing III Reading due Group meetings Testing IVSection ZFR due ZFR demos Progress report due Readings out.
Maintaining and Updating Windows Server 2008 Lesson 8.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
CAP6135: Malware and Software Vulnerability Analysis Find Software Bugs Cliff Zou Spring 2016.
Fuzz Testing (Fuzzing) Eng. Hector M Lugo-Cordero, MS CIS 4361 Jan 27, 2012.
A Few Review Questions Dan Fleck Fall System Test Case Enter invalid username in the input box Able to enter text Enter invalid password in the.
Fuzzing Machine By Nikolaj Tolkačiov.
TOPIC: Web Application Firewall & Fuzzers
Input testing SQL Injections
Software Engineering (CSI 321)
Security Testing Methods
Black Box Testing PPT Sources: Code Complete, 2nd Ed., Steve McConnell
*Acknowledgements: Dawn Song, Kostya Serebryany,
^ About the.
Secure Software Development: Theory and Practice
Fuzzing fuzz testing == fuzzing
Introduction to Information Security
*Acknowledgements: Suman Jana, Dawn Song, Kostya Serebryany,
Lecture 09:Software Testing
Network Profiler: Towards Automatic Fingerprinting of Android Apps
CS240: Advanced Programming Concepts
CSE 303 Concepts and Tools for Software Development
VUzzer: Application-aware Evolutionary Fuzzing
Malware and Software Vulnerability Analysis Find Software Bugs Cliff Zou University of Central Florida.
Software coding/testing
VUzzer: Application-aware Evolutionary Fuzzing
CULLEN ACHESON Samuel Garcia Zachary Blum
Acknowledgement This lecture is modified based on the lecture notes from: Dr. Dawn Song: CS161: computer security.
CSE 1020:Software Development
Presentation transcript:

Fuzzing Dan Fleck CS 469: Security Engineering Sources: Coming up: What is Fuzzing? 11 1

What is Fuzzing? A form of vulnerability analysis Process: Many slightly anomalous test cases are input into the application Application is monitored for any sign of error Coming up: What is Fuzzing? 22 2

Example Standard HTTP GET request § GET /index.html HTTP/1.1 Anomalous requests § AAAAAA...AAAA /index.html HTTP/1.1 § GET ///////index.html HTTP/1.1 § GET %n%n%n%n%n%n.html HTTP/1.1 § GET /AAAAAAAAAAAAA.html HTTP/1.1 § GET /index.html HTTTTTTTTTTTTTP/1.1 § GET /index.html HTTP/ § etc... Coming up: What is Fuzzing? 33 3

User Testing vs Fuzzing User testing Run program on many normal inputs, look for bad things to happen Goal: Prevent normal users from encountering errors Fuzzing Run program on many abnormal inputs, look for bad things to happen Goal: Prevent attackers from encountering exploitable errors Coming up: What is Fuzzing? 44 4

Types of Fuzzers Mutation Based – “Dumb Fuzzing” mutate existing data samples to create test data Generation Based – “Smart Fuzzing” define new tests based on models of the input Evolutionary Generate inputs based on response from program Coming up: What is Fuzzing? 55 5

Fuzzing Automatically generate random test cases Application is monitored for errors Inputs are generally either files (.pdf, png,.wav,.mpg) network based (http, SOAP, SNMP) Coming up: What is Fuzzing? 66 6

Mutation Based Fuzzing Little or no knowledge of the structure of the inputs is assumed Anomalies are added to existing valid inputs Anomalies may be completely random or follow some heuristics Requires little to no set up time Dependent on the inputs being modified May fail for protocols with checksums, those which depend on challenge response, etc. Example Tools: Taof, GPF, ProxyFuzz, Peach Fuzzer, etc. Coming up: What is Fuzzing? 77 7

Mutation Based Example: PDF Fuzzing Google.pdf (lots of results) Crawl the results and download lots of PDFs Use a mutation fuzzer: 1.Grab the PDF file 2.Mutate the file 3.Send the file to the PDF viewer 4.Record if it crashed (and the input that crashed it) Mutation- based Super easy to setup and automate Little to no protocol knowledge required Limited by initial corpus May fail for protocols with checksums, or other complexity Coming up: What is Fuzzing? 88 8

Generation Based Fuzzing Test cases are generated from some description of the format: RFC, documentation, etc. Anomalies are added to each possible spot in the inputs Knowledge of protocol should give better results than random fuzzing Can take significant time to set up Examples SPIKE, Sulley, Mu-4000, Codenomicon, Peach Fuzzer, etc… Coming up: What is Fuzzing? 99 9

Example Specification for ZIP file Src: Coming up: What is Fuzzing? 10

Mutation vs Generation Mutation- based Super easy to setup and automate Little to no protocol knowledge required Limited by initial corpus May fail for protocols with checksums, or other complexity Generation- based Writing generator is labor intesive for complext protocols have to have spec of protocol (frequently not a problem for common ones http, snmp, etc…) CompletenessCan deal with complex checksums and dependencies Coming up: What is Fuzzing? 11

White box vs. black box fuzzing Black box fuzzing: sending the malformed input without any verification of the code paths traversed White box fuzzing: sending the malformed input and verifying the code paths traversed. Modifying the inputs to attempt to cover all code paths. TechniqueEffortCode coverageDefects Found black box + mutation10 min50%25% black box + generation30 min80%50% white box + mutation2 hours80%50% white box + generation2.5 hours99%100% Source: Coming up: What is Fuzzing? 12

Evolutionary Fuzzing Attempts to generate inputs based on the response of the program Autodafe Prioritizes test cases based on which inputs have reached dangerous API functions EFS Generates test cases based on code coverage metrics This technique is still in the alpha stage :) Coming up: What is Fuzzing? 13

Challenges Mutation based – can run forever. When do we stop? Generation based – stop eventually. Is it enough? How to determine if the program did something “bad”? These are the standard problems we face in most automated testing. Coming up: What is Fuzzing? 14

Code Coverage Some of the answers to our problems are found in code coverage To determine how well your code was tested, code coverage can give you a metric. But it’s not perfect (is anything?) Code coverage types: Statement coverage – which statements have been executed Branch coverage – which branches have been taken Path coverage – which paths were taken. Coming up: What is Fuzzing? 15

Code Coverage - Example if (a > 2) a = 2; if (b > 2) b = 2 How many test cases for 100% line coverage? How many test cases for 100% branch coverage? How many test cases for 100% paths? How many test cases for 100% line coverage? How many test cases for 100% branch coverage? How many test cases for 100% paths? Coming up: What is Fuzzing? 16

Code Coverage Tools If you have source: gcov, Bullseye, Emma If you don’t: Binary instrumentation: PIN, DynamoRIO Valgrind : instrumentation framework for building dynamic analysis tools Pai Mei : a reverse engineering framework consisting of multiple extensible components. Lots more to discuss on Code Coverage in a Software Engineering class.. but lets move on. Coming up: What is Fuzzing? 17

Why does Code Coverage help? Lets jump to an example on Page 27 of : cs161/readings/toorcon.pdf cs161/readings/toorcon.pdf Coming up: What is Fuzzing? 18

The Attacker Plan Obtain product Protocol Analysis Manual Network Vulnerability analysis Fuzzing Source/Binary Analysis Weaponization (exploit development) Weaponization (exploit development) Open source research Closed source research But… why do it? Coming up: What is Fuzzing? 19

Last step…Sell it! Market for 0-Days ~$10K-100K Coming up: What is Fuzzing? 20

How hard is it to Fuzz? Lets try it On Win 7 Full Master Run Savant (webserver) Run TAOF Collect index.html Fuzz it starting at the HTTP/1.1 string Coming up: What is Fuzzing? 21

Lessons about Fuzzing Protocol knowledge is helpful Generational beats random, better specification make better fuzzers Using more fuzzers is better Each one will vary and find different bugs The longer you run (typically) the more bugs you’ll find Guide the process, fix it when it break or fails to reach where you need it to go Code coverage can serve as a useful guide Coming up: What is Fuzzing? 21 22