Fuzzing for logic and state issues

Slides:



Advertisements
Similar presentations
Webgoat.
Advertisements

Distributed System Services Prepared By:- Monika Patel.
© 2008 Security Compass inc. 1 Firefox Plug-ins for Application Penetration Testing Exploit-Me.
Network Security Attack Analysis. cs490ns - cotter2 Outline Types of Attacks Vulnerabilities Exploited Network Attack Phases Attack Detection Tools.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike.
By Skyler Onken.  Who am I?  What is Fuzzing?  Usual Targets  Techniques  Results  Limitations  Why Fuzz?  “Fuzzing the Web”?  Desired Solution.
©2006 Microsoft Corporation. All rights reserved. Windows Vista Security Tidbits Steve Riley Senior Security Strategist Microsoft Corporation
Failure to handle errors correctly
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Security in.NET Framework Sergey Baidachni MCT, MCSD, MCDBA.
Introduction to Web Application Security
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Penetration testing – W3AF Tool
Dec 13 th CS555 presentation1 Yiwen Wang --“Securing the DB may be the single biggest action an organization can take to protect its assets” David C. Knox.
Leveraging User Interactions for In-Depth Testing of Web Application Sean McAllister Secure System Lab, Technical University Vienna, Austria Engin Kirda.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Web-based Document Management System By Group 3 Xinyi Dong Matthew Downs Joshua Ferguson Sriram Gopinath Sayan Kole.
OWASP Mobile Top 10 Why They Matter and What We Can Do
MSDN Webcast - SDL Process. Agenda  Fuzzing & The SDL  Integration of fuzzing  Importance of fuzzing Michael Eddington Déjà vu Security
MICHAEL EDDINGTON Advanced Fuzzing with Peach 2.
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Introduction to Application Penetration Testing
Introduction to SQL Server 2000 Security Dave Watts CTO, Fig Leaf Software
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
Lecture 0 Appendix on Implementation Threats Material from Warren Page & Chpt 11, Information Security by Mark Stamp.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Attacks Against Database By: Behnam Hossein Ami RNRN i { }
BLENDED ATTACKS EXPLOITS, VULNERABILITIES AND BUFFER-OVERFLOW TECHNIQUES IN COMPUTER VIRUSES By: Eric Chien and Peter Szor Presented by: Jesus Morales.
Web Application Security Testing Automation.. Copyright © 2008 Deloitte Touche Tohmatsu. All rights reserved.1 What types of automated testing are there?
Attacking Applications: SQL Injection & Buffer Overflows.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Varun Sharma Application Consulting and Engineering (ACE) Team, Microsoft India.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
SQL injection Figure 1 By Kaveri Bhasin. Motive of SQL Injection Obtain data from database Modify system functions Insert data in the backend database.
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.
BA372 Stored Procedures and Triggers Lab. What needs to be done to change a customer’s credit limit? Who am I? May I? Do it Log it Display A database.
Effective Security in ASP.Net Applications Jatin Sharma: Summer 2005.
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.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
Sumanth M Ganesh B CPSC 620.  SQL Injection attacks allow a malicious individual to execute arbitrary SQL code on your server  The attack could involve.
nd Joint Workshop between Security Research Labs in JAPAN and KOREA Marking Scheme for Semantic- aware Web Application Security HPC.
Building Secure Web Applications With ASP.Net MVC.
Security Considerations Steve Perry
M. Alexander Helen J. Wang Yunxin Liu Microsoft Research 1 Presented by Zhaoliang Duan.
ADO.NET AND STORED PROCEDURES - Swetha Kulkarni. RDBMS ADO.NET Provider  SqlClient  OracleClient  OleDb  ODBC  SqlServerCE System.Data.SqlClient.
Chapter 1 The Software Security Problem. Goals of this course Become aware of common pitfalls. Static Analysis and tools.
Sairajiv Burugapalli. This chapter covers three main categories of classic software vulnerability: Buffer overflows Integer vulnerabilities Format string.
Slides by Kent Seamons and Tim van der Horst Last Updated: Nov 11, 2011.
Introduction to Microsoft Windows 2000 Security Microsoft Windows 2000 Security Services Overview Security subsystem components Local security authority.
Fuzzing And Oracles By: Thomas Sidoti. Overview Introduction Motivation Fuzzable Exploits Oracles Implementation Fuzzing Results.
Non Functional Testing. Contents Introduction – Security Testing Why Security Test ? Security Testing Basic Concepts Security requirements - Top 5 Non-Functional.
Zac Fenigshtien  Introduction: 3 Tier Architecture  SQL Injection ◦ Parameter Sandboxing ◦ Blacklisting, Whitelisting.
SECURE DEVELOPMENT. SEI CERT TOP 10 SECURE CODING PRACTICES Validate input Use strict compiler settings and resolve warnings Architect and design for.
Content Coverity Static Analysis Use cases of Coverity Examples
Logging Into Windows XP for first time (labs only!)
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Chapter 7: Identifying Advanced Attacks
Introduction to SQL Server 2000 Security
Pass4itsure Cisco Dumps
Marking Scheme for Semantic-aware Web Application Security
Web Applications Security INTRO
HTML Level II (CyberAdvantage)
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Introduction to Static Analyzer
CS5123 Software Validation and Quality Assurance
Presentation transcript:

Fuzzing for logic and state issues Gödel's Gourd Fuzzing for logic and state issues

Introductions Michael Eddington CTO and Principal Consultant @ Déjà vu Security 12+ years in security consulting Senior developer/architect in prior life Author of Peach, an open source fuzzer Device, Kernel, User, Web, Network

DARPA Cyber Fast track Thanks Mudge!

Defining the Problem Fuzzers are good at findings implementation issues …that crash the target …that are generically detectable (sqli, xss) Not good at finding design, logic, and state issues …that do not crash the target …that are not generically detectable

Examples Buffer Overflows Memory Corruption Resource Usage Easy Hard Buffer Overflows Memory Corruption Resource Usage SQL Injection Missing authentication State corruption Incorrect logic

Authentication Examples Out of 100 admin pages, 5 are missing authentication Microsoft SSPI skip a step auth bypass OpenBSD IPSEC incorrect if/then logic

Authentication – Detect Web – Missing Auth Trigger Request page w/o logging in MS SSPI/OBSD IPSEC Skip a step Status Code (200/403) What pages require auth Result (Pass) Did we complete all steps

Logic Example Windows 95 SMB Flaw Logic error in password checking code Length of loop determined by client input Modified SMB client, ~32 attemps always wins We never throw an exception or crash Typical generic fuzzer will never find this

Logic – Win95 SMB bool CheckPw( int userdata_len, char* userdata, int sysdata_len, char* sysdata ) { for(int i=0; i<userdata_len; i++) if(userdata[i] != sysdata[i]) return false; return true; }

Logic – Detect Win 95 SMB Trigger Result Does password match Try all chars Remove NULL Result Does password match

State Example Device (phone/tablet/laptop) with theft system Agent “heartbeats” to server Server can trigger “stolen” mode in laptop Laptop will trigger if unable to “heartbeat” Timer/counter runs down

State – Detect System Server Trigger Can we perform state flow? Cause exception Flow locked Unable to heartbeat Can we perform state flow? Check result of each step

How to detect? Goal – Modify existing fuzzer to detect these issues We already produce triggers How do we add detection?

How to detect? What do we need to detect these issues? Provide system constraints If not authenticated result is 402 If steps 1, 2, and 3 not performed step 4 is error Result is never 500 Verify we are still working Perform state flow w/o mutations

Proposed Solution Gödel's Gourd Re-use Peach fuzzing engine Mutation engine Fault detection/reporting Constraint language Control iterations (non mutation iterations) Mutate state model (skip, order, etc.)

Control Iterations Goal: Verify target is working correctly No mutations Constraints pass State model is followed Matches recorded control iteration

How it works R – Record iteration 1 – Fuzzing iteration C – Control iteration 2 – Fuzzing Iteration 3 – Fuzzing iteration … Remember all states/actions from record iteration Verify on control iterations Control iterations every N fuzzing iterations

Outcome If control does not match record – throw fault Identify conditions that stop normal operation

Constraints Verify logic via simple constraint expressions Apply constraints to state model State Action Does not modify fuzzer state

Language Options Existing Traditional Languages Pro Cons Well known JavaScript Python Ruby etc. Pro Well known Available via .NET scripting interface Cons Allows modification of fuzzer state.

Other Options Domain Specific Language (DSL) Use existing Create our own Pros Meet all requirements Cons Must implement Not well known

DSL Selection Object Constraint Language (OCL) Specification language, no side effects Developed as part of new UML standards Familiar syntax Relatively easy to implement

Object Constraint Language (OCL) Expression types Invariant (inv) Always true Pre (pre) Evaluated before [ something ] Post (post) Evaluated after [ something ] Can access state from Pre. (@pre)

OCL Examples “Car owner must be at least 18 years old” context Car inv: self.owner.age >= 18 “If passwords match result is true” context Login post: result = true implies pass1 = pass2

OCL Context Groups sets of constraints Constraints for a context are run together Association based on context

Normal Fuzzing Iteration Enter State Model State 1 Action 1.1 Send Data Action 1.2 Receive Data State N …

Fuzzing Iteration With Constraints Enter State Model State 1 Action 1.1 Send Data Action 1.2 Receive Data State N … Inv(pre) Pre EVENT Inv(post) Post

Applying (Authentication) Web Authentication # Verify authentication occurred post: (reply = 200 && url.indexOf(‘/admin’) > -1) implies auth.reply = 200

Applying (Authentication) Windows SSPI # Verify all steps completed post: reply = true implies ( auth.step1.reply = true && auth.step2.reply = true && auth.step3.reply = true)

Applying (Logic) Windows 95 Bug post: reply = true implies userpw = ‘password’

Applying (State) Antitheft System Perform control iteration

Implementation

Technologies Used Microsoft .NET Framework – C# Peach Fuzzer 3 Cross platform using Mono OS X Linux

Implementation Diagram

OCL Implementation Irony .NET Language Toolkit LINQ Expressions Many differences from traditional Grammar is code Easy AST hookups LINQ Expressions From IronPython work Last mile is already done

LINQ Expressions Exposes language constructs for use in AST classes. Does all the heavy lifting. return Expression.Condition( (Expression)ifNode.Evaluate(thread), (Expression)thenNode.Evaluate(thread), (Expression)elseNode.Evaluate(thread));

Gödel Usage All the things that do the stuff

Peach Pit vs. Gödel Gourd Data Model State Model Agents Test Data Model OCL Definitions State Model OCL Associations Agents Test

Gödel: Define Constraints <Ocl> <![CDATA[ context StatusCodeOk post: context.test.publishers[self.publisher].Result = 'OK' ]]> </Ocl>

Gödel: Associate Constraints <Action type="call" method="Logout"> <Ocl context="StatusCodeOk" /> </Action> Constraints will now run with this Action.

Gödel: Control Iterations <Test name=“Default” controlIteration=“1”> <Agent … /> <StateModel … /> <Publisher … /> <Logger … /> </Test> Define how often control iterations occur.

Usage Feasibility Time and Cost

Adding Gödel Process: Not recreating full application logic Existing Peach PIT Add OCL Constraints Test and Verify Definition Not recreating full application logic Just our “view of the world”

Time per Protocol Based on current experience of limited protocol set Decent in 1 – 2 days Complete in 1 week or less

Performance What performance impact does Gödel incur? Constraint evaluation Control iterations No performance optimizations…yet

Performance of Constraints

Performance Control Iterations Depends on how often, worst case half speed Never longer than mutation iterations

Performance Conclusions Performance impact dependent on speed of fuzzing Ability to scale fuzzing lowers impact For fast fuzzers, acceptable impact For slower fuzzers, adjust control iterations to occur less often

Conclusions Pentesting/Quick fuzzing General definition building Reasonable for “basics” (verify state’s work, critical logic flows) General definition building Reasonable to implement decent coverage 1-2 days “good enough”

Wrapping it up…

Lessons Learned Constraints applied only to control iterations Writing good constraints that apply to all mutation cases is challenging A few constraints can go along ways Performance overhead needs to be lowered when many constraints used. Optimize access to most used variables/objects

Looking towards next rev… Can we “learn” basic constraints? Performance optimizations Shorted “name” of common objects context.test.publishers[self.publisher].Result self.Result

Thanks for all the fish! Michael Eddington mike@dejavusecurity.com http://dejavusecurity.com http://peachfuzzer.com