SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
Fuzzing in Microsoft and
             FuzzGuru framework


                           John Neystadt
OWASP-IL
                           jney@microsoft.com
May-2007
                           Lead Program Manager
                           Forefront Edge, Microsoft
Agenda
• Overview
  – Introduction to Fuzzing
  – FuzzGuru Architecture
  – Demo
• Testing
  –   Designing Fuzzing Test
  –   Preparation for Fuzz Testing
  –   Performing Fuzz Testing
  –   Completing Fuzzing Coverage
  –   Fuzzing in ISA

                                     2
Introduction to Fuzzing
• Tired of Code Reviews?
   – Fuzz testing is about automatic testing of
     malformed input handling
   – Fuzzing Target is code, not data. Its white
     box testing - no need to exhaust all data
     combinations, that code doesn’t
     distinguish
   – In the past dumb fuzzing was made to
     randomly corrupt bits of data., This
     penetrates only top data handling layers,
     since something basic (checksum, first
     fields) would be broken and inner code
     paths wouldn’t be reached
   – Smart is about systematic testing of all
     code paths that process data. Corrupt
     fields one by one, preserving general
     validity of the packet (Content-Length,
     Checksums, Base64 encoding, etc)

                                                   3
Case for Fuzzing
• Over 70% of security vulnerabilities Microsoft
  patched in 2006 were found by fuzzing
• Many open-source tools and some commercial
  products that do fuzzing of specific protocols or
  formats are available

• SDL - Microsoft Security Development Lifecycle
   – Internal “security” bible mandatory for all Microsoft
     teams
   – Mandates fuzzing for Files, RPC, DCOM, Network,
     ActiveXs as part of product development lifecycle

                                                             4
What I wanted to know about
Fuzzing, but didn’t dare to ask
• Fuzzing finds Access Violations and Buffer Overruns, not
  functional problems
• Fuzzing requests usually fail, since they are malformed
• Often fuzzing bugs are in clean-up code paths: leaks,
  synchronization and timing issues.
• Fuzz both client and server code – simulating malicious
  server has high chance of finding bugs!
• If a bug happens when two independently fields are
  malformed, FuzzGuru will not find it
• Both C++ and C# (or Java) code should be fuzzed if it
  processes data from untrusted source

                                                        5
FuzzGuru Architecture
                          FuzzGuru Development Framework
        Development Guide                  Schema Editor                                 Simulator
    +Getting Started              +Define Data Schema()                     +Validate Schema Correctness()
    +SDK                          +Define Fuzzing Test Cases()              +Validate Template Parsing()
    +Samples                      +Import XML XSDs()                        +Simulate Fuzzing()
                                                                                                                                Fuzzing Stress Framework
                                      1. learn        2. define schema     4. simulate                                              Fuzzing Experiment Configuration Editor

                                                                            5. create fuzzing experiment configuration +Define Fuzzing Experiments()
      Input Templates
                                     3. prepare templates
+Valid files
                                                                                                                   6. run manual test
+Network captures
+Generated by test tool
                                  2.1 reuse existing schemas
                                                                                                                       Command Line (fgcmd.exe)        Fuzzing Experiment Runner GUI
Ready Fuzzing Schemas
                                                                                                                      +Run Experiment()                +Run in GUI()
                                                                            7. develop automation
            HTTP                                                                                                      +Trace to DBMON()                +View Traces in GUI()
            GZIP
                                                                Test Owner                                                                  «datatype»
            SMTP
                                                                                                                                       Fuzzing Experiments
             FTP                                                                            use as command line
                                   8. investigate the results
            DNS                                                                                                 +File Fuzzer (using fuzzing schema)
           SOCKS                                                                                                +XML Fuzzer (using XSD schema)
                                          9. extend the framework
            MIME                                                                                                +TCP/UDP Clients/Servers
                                                                                                                +TCP / UDP Man-in-the-middle (Redirector)
                                                            Test Automation                                     +Custom (implemented by user)
                                                                                                                +Run Fuzzing Stress()
                                                             Scripts or Test Harness
                                                                                                                +Repro Bugs()
                                                                                   implement custom experiments +Provide Traces()
   Investigate the results
+Fuzzing Traces
                                                                                                                                                                      «uses»
                                                                 Custom Test Tools
+Code Coverage Analysis
+Update Test Coverage                                                                                         use fuzzing API from test code



                                                                         Data Fuzzing Framework
      Extensibility Interfaces                                                                                                          Fuzzing API
                                                                                                                                                                  «datatype»
                 «datatype»                                      «datatype»                                        «datatype»
                                                                                                                                                                   Fuzzers
               Data Elements                                     Encoders                                          Relations
                                                                                                                                                        +String
  +String (ANSI, Unicode)                        +Unicode (UTF*) / Windows Char Set                 +Presence
                                                                                                                                                        +Numeric
  +Binary Data                                   +Base 64                                           +Buffer / Length
                                                                                                                                                        +Numeric String
  +Grouping Elements                             +Special XML Encoder                               +Group / Count
                                                                                                                                                        +Unicode-specific
  +XML                                           +Custom (implemented by user)                      +Custom (implemented by user)
                                                                                                                                                        +XML
  +Custom (implemented by user)
                                                                                                                                                        +Group Fuzzers
                                                                                                                                                        +Custom Fuzzers


                                                                                                                                                                                  6
Designing Fuzzing Test
•   Fuzzing a protocol - create schema or customize a ready one
     –   Define schema for parts of the protocol, need to be fuzzed
     –   More later
•   Defining fuzzing Test Cases
     –   Fuzzing Test Cases choose a subset of schema (elements and fuzzers) to be applied for
         relevant scenario
     –   FuzzGuru command line tool gets test case id as parameter
     –   FuzzGuru API requires test case id to generate malformed packets
     –   Test Case can be used for focused fuzzing to test specific fixes
•   Create fuzzing Templates
     –   Obtain real world data captures or generated by test programmatically
     –   Templates are “equivalence classes”, choose minimum number to cover all your scenarios
     –   Template must adhere to schema, you can use placeholder elements in schema to skip
         irrelevant parts
•   Use FuzzGuru GUI Simulator to verify test cases and templates
     –   Verify template is parsed correctly
     –   See which fuzzers are chosen (simulator trace)
     –   Inspect output to inspect malformed requests



                                                                                                  7
Manual or Automated
Fuzz Testing
•   FuzzGuru Experiments – ready tools for common fuzzing scenarios
     –   Gets schema, mutation template and test case name
     –   Ready tcp/udp server/client, man-in-the middle redirector, file, xml modes
     –   Extensive - can develop custom experiments
     –   Generates “stress” of upto 500 tcp cps or 11,000 udp packets
     –   Supports recording/playback of repro buffer
     –   Generates perf counters
     –   Writes fuzzing traces to dbmon

•   Manual Test Running (GUI)
     –   Define Experiment Configuration (FuzzGuru GUI, Tools | Experiment Configuration Editor)
     –   Run experiments interactively (FuzzGuru GUI, Tools | Experiment Runner)

•   Scriptable Automation
     –   Define Experiment Configuration (FuzzGuru GUI, Tools | Experiment Configuration Editor)
     –   Call experiments from command line interface (fgcmd.exe)

•   Integrate into your own test tools
     –   Call DataFuzzer APIs from your own test tool, providing it schema, mutation template and
         test case name

                                                                                                    8
Demo
• Run BinUrt2DemoApp.exe
• Run HTTP Server Attack Demo
     – See DemoReadme.mhtml => Part2 for instructions
• Results (5 minutes each run):
                                   Iterations
Scenario                                         Bugs found              Test Cases
                                                                         coverage
                                   6500                                  24%
Dumb Fuzzing without template                    0 out of 4
Dumb Fuzzing with template         11000         2 from 4                56%
                                                 (hits: 0, 0, 2, 10)
                                   700 (slow ) 2 from 4
Fuzzing with HTTP Demo                                                   80%
Schema without template                          (hits: 0, 0, 4, 8)
                                   10200
Fuzzing with HTTP Demo                           4 from 4                100%
Schema with one template (valid)                 (hits: 1, 7, 64, 143)

                                                                                  9
Completing Fuzzing Coverage
(Code Coverage)
 •   After running a fuzzing test for a first round it is important to inspect whether all code
     paths were covered
 •   Magellan Code Coverage tool set is recommended
 •   You should not hunt the numbers, rather review all uncovered code paths
      –   Fuzzing should traverse to all branches that depend on untrusted data
      –   All parsing code should be covered
      –   All error handling and cleanup code should be covered
 •   Note: If there is no code to handle malformed data exist, Code Coverage will not help
     you!
 •   To add coverage, you may need:
      –   Extend test matrix and fuzzing tests additional configurations of the feature
      –   Add additional fuzzing templates
      –   Extend FuzzGuru with custom fuzzers or elements
 •   Metrics
      –   Expected to reach 75-85% code coverage of parsers code blocks
      –   Per fuzzed DLL: fuzzing usually adds 3%-6% blocks and 3%-8% arcs additional coverage to
          compared to stress
      –   Per fuzzed source file: fuzzing usually significantly adds the coverage of ~13%.
      –   Per fuzzed function: fuzzing usually significantly adds the coverage of over 17%.


                                                                                              10

Más contenido relacionado

La actualidad más candente

Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3Oliver Klee
 
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DETest-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DEOliver Klee
 
JSR-303 Bean Validation API
JSR-303 Bean Validation APIJSR-303 Bean Validation API
JSR-303 Bean Validation APIHeiko Scherrer
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Oliver Klee
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldYura Nosenko
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsYura Nosenko
 
xUnit Style Database Testing
xUnit Style Database TestingxUnit Style Database Testing
xUnit Style Database TestingChris Oldwood
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Akshay Nagpurkar
 

La actualidad más candente (10)

Test-driven Development for TYPO3
Test-driven Development for TYPO3Test-driven Development for TYPO3
Test-driven Development for TYPO3
 
Test-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DETest-Driven Development for TYPO3 @ T3CON12DE
Test-Driven Development for TYPO3 @ T3CON12DE
 
JSR-303 Bean Validation API
JSR-303 Bean Validation APIJSR-303 Bean Validation API
JSR-303 Bean Validation API
 
Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)Test-driven development for TYPO3 (T3DD11)
Test-driven development for TYPO3 (T3DD11)
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
 
Whitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applicationsWhitebox testing of Spring Boot applications
Whitebox testing of Spring Boot applications
 
xUnit Style Database Testing
xUnit Style Database TestingxUnit Style Database Testing
xUnit Style Database Testing
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
Test driven development
Test driven developmentTest driven development
Test driven development
 

Similar a Microsoft Fuzzing and FuzzGuru Framework

Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseEmanuele Quinto
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionCloudera, Inc.
 
Fuzzing: The New Unit Testing
Fuzzing: The New Unit TestingFuzzing: The New Unit Testing
Fuzzing: The New Unit TestingDmitry Vyukov
 
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"ITGinGer
 
FUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGFUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGMuH4f1Z
 
Alm 4 Azure with screenshots
Alm 4 Azure with screenshotsAlm 4 Azure with screenshots
Alm 4 Azure with screenshotsClemens Reijnen
 
Increase testability with code seams
Increase testability with code seamsIncrease testability with code seams
Increase testability with code seamsLlewellyn Falco
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testingpleeps
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaChristopher Bartling
 
Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Ophir Cohen
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++TestEngineering Software Lab
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoveragemlilley
 
In search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingIn search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingAnna Khabibullina
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Analysis of Testability of a Flight Software Product Line
Analysis of Testability of a Flight Software Product LineAnalysis of Testability of a Flight Software Product Line
Analysis of Testability of a Flight Software Product LineDharmalingam Ganesan
 

Similar a Microsoft Fuzzing and FuzzGuru Framework (20)

Drupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study CaseDrupal & Continous Integration - SF State Study Case
Drupal & Continous Integration - SF State Study Case
 
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Software Testing wit...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Software Testing wit...Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Software Testing wit...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Software Testing wit...
 
Hadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault InjectionHadoop: Code Injection, Distributed Fault Injection
Hadoop: Code Injection, Distributed Fault Injection
 
Fuzzing: The New Unit Testing
Fuzzing: The New Unit TestingFuzzing: The New Unit Testing
Fuzzing: The New Unit Testing
 
Gallio Crafting A Toolchain
Gallio Crafting A ToolchainGallio Crafting A Toolchain
Gallio Crafting A Toolchain
 
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
MPD2011 | Александр Додатко "Процесс непрерывной интеграции для iOS проектов"
 
FUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGFUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTING
 
Alm 4 Azure with screenshots
Alm 4 Azure with screenshotsAlm 4 Azure with screenshots
Alm 4 Azure with screenshots
 
Increase testability with code seams
Increase testability with code seamsIncrease testability with code seams
Increase testability with code seams
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
 
Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013Hadoop testing workshop - july 2013
Hadoop testing workshop - july 2013
 
Unit testing on embedded target with C++Test
Unit testing on embedded  target with C++TestUnit testing on embedded  target with C++Test
Unit testing on embedded target with C++Test
 
Docker meetup
Docker meetupDocker meetup
Docker meetup
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
 
In search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingIn search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testing
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Analysis of Testability of a Flight Software Product Line
Analysis of Testability of a Flight Software Product LineAnalysis of Testability of a Flight Software Product Line
Analysis of Testability of a Flight Software Product Line
 
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Application Lifecycl...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Application Lifecycl...Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Application Lifecycl...
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: Application Lifecycl...
 
Testing 101
Testing 101Testing 101
Testing 101
 

Último

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Último (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Microsoft Fuzzing and FuzzGuru Framework

  • 1. Fuzzing in Microsoft and FuzzGuru framework John Neystadt OWASP-IL jney@microsoft.com May-2007 Lead Program Manager Forefront Edge, Microsoft
  • 2. Agenda • Overview – Introduction to Fuzzing – FuzzGuru Architecture – Demo • Testing – Designing Fuzzing Test – Preparation for Fuzz Testing – Performing Fuzz Testing – Completing Fuzzing Coverage – Fuzzing in ISA 2
  • 3. Introduction to Fuzzing • Tired of Code Reviews? – Fuzz testing is about automatic testing of malformed input handling – Fuzzing Target is code, not data. Its white box testing - no need to exhaust all data combinations, that code doesn’t distinguish – In the past dumb fuzzing was made to randomly corrupt bits of data., This penetrates only top data handling layers, since something basic (checksum, first fields) would be broken and inner code paths wouldn’t be reached – Smart is about systematic testing of all code paths that process data. Corrupt fields one by one, preserving general validity of the packet (Content-Length, Checksums, Base64 encoding, etc) 3
  • 4. Case for Fuzzing • Over 70% of security vulnerabilities Microsoft patched in 2006 were found by fuzzing • Many open-source tools and some commercial products that do fuzzing of specific protocols or formats are available • SDL - Microsoft Security Development Lifecycle – Internal “security” bible mandatory for all Microsoft teams – Mandates fuzzing for Files, RPC, DCOM, Network, ActiveXs as part of product development lifecycle 4
  • 5. What I wanted to know about Fuzzing, but didn’t dare to ask • Fuzzing finds Access Violations and Buffer Overruns, not functional problems • Fuzzing requests usually fail, since they are malformed • Often fuzzing bugs are in clean-up code paths: leaks, synchronization and timing issues. • Fuzz both client and server code – simulating malicious server has high chance of finding bugs! • If a bug happens when two independently fields are malformed, FuzzGuru will not find it • Both C++ and C# (or Java) code should be fuzzed if it processes data from untrusted source 5
  • 6. FuzzGuru Architecture FuzzGuru Development Framework Development Guide Schema Editor Simulator +Getting Started +Define Data Schema() +Validate Schema Correctness() +SDK +Define Fuzzing Test Cases() +Validate Template Parsing() +Samples +Import XML XSDs() +Simulate Fuzzing() Fuzzing Stress Framework 1. learn 2. define schema 4. simulate Fuzzing Experiment Configuration Editor 5. create fuzzing experiment configuration +Define Fuzzing Experiments() Input Templates 3. prepare templates +Valid files 6. run manual test +Network captures +Generated by test tool 2.1 reuse existing schemas Command Line (fgcmd.exe) Fuzzing Experiment Runner GUI Ready Fuzzing Schemas +Run Experiment() +Run in GUI() 7. develop automation HTTP +Trace to DBMON() +View Traces in GUI() GZIP Test Owner «datatype» SMTP Fuzzing Experiments FTP use as command line 8. investigate the results DNS +File Fuzzer (using fuzzing schema) SOCKS +XML Fuzzer (using XSD schema) 9. extend the framework MIME +TCP/UDP Clients/Servers +TCP / UDP Man-in-the-middle (Redirector) Test Automation +Custom (implemented by user) +Run Fuzzing Stress() Scripts or Test Harness +Repro Bugs() implement custom experiments +Provide Traces() Investigate the results +Fuzzing Traces «uses» Custom Test Tools +Code Coverage Analysis +Update Test Coverage use fuzzing API from test code Data Fuzzing Framework Extensibility Interfaces Fuzzing API «datatype» «datatype» «datatype» «datatype» Fuzzers Data Elements Encoders Relations +String +String (ANSI, Unicode) +Unicode (UTF*) / Windows Char Set +Presence +Numeric +Binary Data +Base 64 +Buffer / Length +Numeric String +Grouping Elements +Special XML Encoder +Group / Count +Unicode-specific +XML +Custom (implemented by user) +Custom (implemented by user) +XML +Custom (implemented by user) +Group Fuzzers +Custom Fuzzers 6
  • 7. Designing Fuzzing Test • Fuzzing a protocol - create schema or customize a ready one – Define schema for parts of the protocol, need to be fuzzed – More later • Defining fuzzing Test Cases – Fuzzing Test Cases choose a subset of schema (elements and fuzzers) to be applied for relevant scenario – FuzzGuru command line tool gets test case id as parameter – FuzzGuru API requires test case id to generate malformed packets – Test Case can be used for focused fuzzing to test specific fixes • Create fuzzing Templates – Obtain real world data captures or generated by test programmatically – Templates are “equivalence classes”, choose minimum number to cover all your scenarios – Template must adhere to schema, you can use placeholder elements in schema to skip irrelevant parts • Use FuzzGuru GUI Simulator to verify test cases and templates – Verify template is parsed correctly – See which fuzzers are chosen (simulator trace) – Inspect output to inspect malformed requests 7
  • 8. Manual or Automated Fuzz Testing • FuzzGuru Experiments – ready tools for common fuzzing scenarios – Gets schema, mutation template and test case name – Ready tcp/udp server/client, man-in-the middle redirector, file, xml modes – Extensive - can develop custom experiments – Generates “stress” of upto 500 tcp cps or 11,000 udp packets – Supports recording/playback of repro buffer – Generates perf counters – Writes fuzzing traces to dbmon • Manual Test Running (GUI) – Define Experiment Configuration (FuzzGuru GUI, Tools | Experiment Configuration Editor) – Run experiments interactively (FuzzGuru GUI, Tools | Experiment Runner) • Scriptable Automation – Define Experiment Configuration (FuzzGuru GUI, Tools | Experiment Configuration Editor) – Call experiments from command line interface (fgcmd.exe) • Integrate into your own test tools – Call DataFuzzer APIs from your own test tool, providing it schema, mutation template and test case name 8
  • 9. Demo • Run BinUrt2DemoApp.exe • Run HTTP Server Attack Demo – See DemoReadme.mhtml => Part2 for instructions • Results (5 minutes each run): Iterations Scenario Bugs found Test Cases coverage 6500 24% Dumb Fuzzing without template 0 out of 4 Dumb Fuzzing with template 11000 2 from 4 56% (hits: 0, 0, 2, 10) 700 (slow ) 2 from 4 Fuzzing with HTTP Demo 80% Schema without template (hits: 0, 0, 4, 8) 10200 Fuzzing with HTTP Demo 4 from 4 100% Schema with one template (valid) (hits: 1, 7, 64, 143) 9
  • 10. Completing Fuzzing Coverage (Code Coverage) • After running a fuzzing test for a first round it is important to inspect whether all code paths were covered • Magellan Code Coverage tool set is recommended • You should not hunt the numbers, rather review all uncovered code paths – Fuzzing should traverse to all branches that depend on untrusted data – All parsing code should be covered – All error handling and cleanup code should be covered • Note: If there is no code to handle malformed data exist, Code Coverage will not help you! • To add coverage, you may need: – Extend test matrix and fuzzing tests additional configurations of the feature – Add additional fuzzing templates – Extend FuzzGuru with custom fuzzers or elements • Metrics – Expected to reach 75-85% code coverage of parsers code blocks – Per fuzzed DLL: fuzzing usually adds 3%-6% blocks and 3%-8% arcs additional coverage to compared to stress – Per fuzzed source file: fuzzing usually significantly adds the coverage of ~13%. – Per fuzzed function: fuzzing usually significantly adds the coverage of over 17%. 10