SlideShare a Scribd company logo
1 of 55
Browser Fuzzing with a Twist
(and a Shake)
Jeremy Brown, 2015
Agenda
I. Introduction
I. Target Architecture
II. Infrastructure Notes
II. ShakeIt
I. Current Tooling
II. Internals
III. Incubation Results
III. Conclusion
#whoami
• Jeremy Brown
– Independent researcher / consultant
– Formerly of Microsoft
• Windows/Phone/Xbox Security
• Malware Protection Center
– Also, Tenable
• Nessus
• RE patches
What I’m not covering
• Comprehensive browser fundamentals
– Just enough to get your feet wet
• Looking for bugs outside of rendering engines
– There’s plenty of other attack surface, but this one
is really juicy & often no user interaction required
• Sandbox escapes
– This is needed post-compromise of renderer
What I’m covering
• The fuzzing engine part of the puzzle
– But ShakeIt is not a fuzzer, it is a mutator
• Working with grammar-based parsing engines
– Not specific to browsers, but they’re a primary
target
• Overall setup you need to do so effectively
– But not claiming I fuzz as well as Ben Nagy
– A lot of hard lessons learned
Why
• Share the research instead of just letting it sit
on my box
– Projects often fade away after incubation, but are
more valuable in collaboration
• Not many talks detail the process and how the
engine actually works
– Most engines are not rocket science
– Fuzzing really has no rules, any method fair game
Attack Surface Overview
Credit:
Chris Rolf / LeafSR (now Yahoo!)
http://blog.leafsr.com/2012/09/09/google-native-client-attack-surface-and-vulnerabilities-part-4/
Reference:
“Inside Adobe Reader Protected Mode - Part 1 - Design” – Security @ Adobe
http://blogs.adobe.com/security/2010/10/inside-adobe-reader-protected-mode-part-1-design.html
Fuzzing Options
• Generation
Reference: http://www.peachfuzzer.com
Fuzzing Options
• Mutation
– Zzuf is the canonical example here
Reference: http://caca.zoy.org/wiki/zzuf
Fuzzing Options
• Code-assisted (eg. sub-evolutionary)
– American Fuzzy Lop
Reference: http://lcamtuf.coredump.cx/afl/
Fuzzing Options
Reference: http://lcamtuf.coredump.cx/afl/
Infrastructure
Pieces to the Puzzle
• A complete fuzzing framework has
– Fuzzing Engine
– System Harnesses
– Scaling Infrastructure
– Target-specific Support
– Helpers
Pieces to the Puzzle
• Fuzzing Engine
– Generator per specifications
– Mutator based on particular algorithms
– Instrumentation for code-assisted fuzzing
Pieces to the Puzzle
• Local System Harnesses
– Debug harness to catch crashes
– Filesystem monitor for interesting read/write
– Dedicated and high performance database server
• Or SSD for fast access to local sqlite db
Pieces to the Puzzle
• Scaling Infrastructure
– High-performance machines with hypervisors
– Clusters in a master/slave setup
– An Army of Droids (eg. jduck)
– Utilizing the online cloud providers
Pieces to the Puzzle
• Target-specific Support
– File store for templates (eg. html, xml, pdf)
• Client to add new templates / remove bad ones
• WinAppDbg
– Great framework, very versatile
– Provides a ton of options for instrumentation
– Run into interesting issues sometimes, eg.
bottleneck with db server / attach memory errors
Pieces to the Puzzle
• Helpers
– Pause/Restart support
– Automatic repro / PoC generation
– Data failure backup mechanisms
– Minset support
– Instrumentation / Code Coverage
Agenda
I. Introduction
I. Target Architecture
II. Infrastructure Notes
II. ShakeIt
I. Current Tooling
II. Internals
III. Incubation Results
III. Conclusion
Current Tooling
• Cross_fuzz
– Cross-document DOM binding fuzzer by lcamtuf
– Similar concept to ShakeIt as it either selects or
reuses input fragments
• Fuzzinator
– Tokenizes a collection of input and builds new
tests from those
References:
http://lcamtuf.coredump.cx/cross_fuzz/
http://browser.sed.hu/blog/20141023/fuzzinator-reloaded
Current Tooling
• Jsfunfuzz
– JavaScript fuzzer from Jesse Ruderman
– Uses generational method to create interesting JS
• LangFuzz
– Grammar-based fuzzer by Mozilla / Saarland Uni
– Utilizes the ANTLR suite for parsing
– Like Cross_fuzz, it can reuse input fragments
References:
https://github.com/MozillaSecurity/funfuzz/blob/master/js/jsfunfuzz/README.md
https://www.st.cs.uni-saarland.de/publications/files/holler-usenix-2012.pdf
Deviations from ShakeIt
• Dictionary
– Defining a dictionary of valid tokens and replacing
them with either randomly generated or oracle
input
• Nesting
– Duplicating or multiplying tokens to create nesting
in random or strategic locations
ShakeIt Algorithm
High-level Diagram
How it works
• Collection of tokens or “changeables”
– Data
– Position
• Switch the data a random positions
• Fix it all back up and generate new test case
• Idea is simple, but implementation is more
complex
Process
• Step 1
– Feed it templates (HTML, XML, JS, PDF + JS, etc)
– Can handle simple or complex input
Implementation Details
• Consume template
– Modes for HTML/JS or PDF/JS
• Call Shake.It
– It calls Token.Find to find all the tokens
– We need at least (2) to perform mutation
– Token.Find uses extensive set of regex’s
Implementation Details
• Token.Match successful, save it and continue
• Once complete, Shake.Shuffle all the tokens
– Iterate from the end, choosing random index and
removing items from the pool until exhaustion
Implementation Details
• After Shuffle, now build out the mutation
– Find each shuffled position, insert new data and
append all other template content appropriately
Implementation Details
• Write to output and repeat n iterations!
– We use .NET threads to utilize computing power
– SHA1 for *unique filenames
• * We don’t care about collisions here 
Example Template
Fuzzing Strategy
• Tries to “confuse” the rendering engine
• Mixes types, parameters, values, objects
• Tries to put the browser in a weird state and
force it to make bad decisions
– “Shaking the memory corruption tree”
Mutated Examples
Process
• Step 2
– Store mutated collection on file or web server
– Make it accessible to a browser
Process
• Step 3
– Setup target with harness, iterate over collection
– Store results in database for sorting, repros on
network share for debugging promising crashes
Implementation
• Written in C#
– Algorithm is portable though
• Available after this talk
Incubation
Incubation Results
• Interesting Chrome/Opera crashes
– Sadly hard to save repros per infrastructure issues
– Could not determine if crashes can from render
bugs or attach/synchronization issues
Incubation Results
• Multiple crashes in WebKit/GTK+
– Only 2 / 4 repro’d
– Suspected invalid access on garbage collection
Incubation Results
• Unremarkable crash in KHTML
– Continuous memory allocations and copies
Incubation Results
• Likely exploitable memory corruption bug in
Netsurf (popular embedded device browser)
– Corruption of internal structure pointer
– Triggered by mutated tag property
Incubation Results
• Interesting crash in Phonon (VLC @ web)
– Triggered by parsing multimedia content / tags
Challenges / Lessons Learned
• Comprehensive fuzzing harnesses enable a
smooth process
• Without a complete system, it’s tough to be
successful
– Bandwidth, resources or tooling are bottlenecks
Agenda
I. Introduction
I. Target Architecture
II. Infrastructure Notes
II. ShakeIt
I. Current Tooling
II. Internals
III. Incubation Results
III. Conclusion
Future Work
• Enable ShakeIt in scalable environment OR
• Port it to existing fuzzing frameworks
– Joxean’s Nightmare Fuzzer
– <insert your custom fuzzing framework @ home>
– Perhaps even a Metasploit auxiliary module
Conclusion
• Fuzzing is more than a mutation engine
– Strategy and infrastructure matter too
• Investment in tooling is paramount
– But don’t micro-manage ROI!
• More complexity == more fuzzing bugs
– Code review for complex operations is expensive
– Manually pen-testing is great for logic bugs
– Does anyone seeing software becoming simpler?
Conclusion
• Sandboxes cannot save you from bugs
– You just need +1 more bug
• SDL cannot save you from bugs
– Too much old code, too much new code, not
enough eyes or interested people to throw at it
• Mitigations cannot save you from bugs
– They only make them +n days harder to exploit
• Managed code is a positive step forward
The End
Questions?

More Related Content

What's hot

BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheelsinfodox
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!Peter Hlavaty
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectPeter Hlavaty
 
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco GrassiShakacon
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Peter Hlavaty
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school introPeter Hlavaty
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" Peter Hlavaty
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Pythoninfodox
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon chinaPeter Hlavaty
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?Peter Hlavaty
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devicesNikhil Mittal
 
More fun using Kautilya
More fun using KautilyaMore fun using Kautilya
More fun using KautilyaNikhil Mittal
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNEDChris Gates
 
FUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGFUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGMuH4f1Z
 
Power of linked list
Power of linked listPower of linked list
Power of linked listPeter Hlavaty
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?Aditya K Sood
 
Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Luis Grangeia
 

What's hot (20)

BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheels
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could Expect
 
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
 
Steelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with PythonSteelcon 2014 - Process Injection with Python
Steelcon 2014 - Process Injection with Python
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Racing with Droids
Racing with DroidsRacing with Droids
Racing with Droids
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
 
More fun using Kautilya
More fun using KautilyaMore fun using Kautilya
More fun using Kautilya
 
Lares from LOW to PWNED
Lares from LOW to PWNEDLares from LOW to PWNED
Lares from LOW to PWNED
 
FUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTINGFUZZING & SOFTWARE SECURITY TESTING
FUZZING & SOFTWARE SECURITY TESTING
 
Power of linked list
Power of linked listPower of linked list
Power of linked list
 
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?HackInTheBox -  AMS 2011 , Spying on SpyEye - What Lies Beneath ?
HackInTheBox - AMS 2011 , Spying on SpyEye - What Lies Beneath ?
 
Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1 Reverse Engineering the TomTom Runner pt. 1
Reverse Engineering the TomTom Runner pt. 1
 

Viewers also liked

Gareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzingGareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzingYury Chemerkin
 
Web vulnerability seminar3
Web vulnerability seminar3Web vulnerability seminar3
Web vulnerability seminar3Sakuya Izayoi
 
How to find_vulnerability_in_software
How to find_vulnerability_in_softwareHow to find_vulnerability_in_software
How to find_vulnerability_in_softwaresanghwan ahn
 
Software Security - Vulnerability&Attack
Software Security - Vulnerability&AttackSoftware Security - Vulnerability&Attack
Software Security - Vulnerability&AttackEmanuela Boroș
 
Security Testing: Fuzzing
Security Testing: FuzzingSecurity Testing: Fuzzing
Security Testing: FuzzingAndrei Rubaniuk
 
Web vulnerability seminar4
Web vulnerability seminar4Web vulnerability seminar4
Web vulnerability seminar4Sakuya Izayoi
 
Fuzzinator - In bug we trust.
Fuzzinator - In bug we trust.Fuzzinator - In bug we trust.
Fuzzinator - In bug we trust.Renata Hodovan
 
Codegate 2013 Junior - Music Player Exploit
Codegate 2013 Junior - Music Player ExploitCodegate 2013 Junior - Music Player Exploit
Codegate 2013 Junior - Music Player Exploitsweetchip
 
Web vulnerability seminar1
Web vulnerability seminar1Web vulnerability seminar1
Web vulnerability seminar1Sakuya Izayoi
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel ExploitationzeroSteiner
 
취약점(Vulnerability) db 구조 설명
취약점(Vulnerability) db 구조 설명취약점(Vulnerability) db 구조 설명
취약점(Vulnerability) db 구조 설명eungjin cho
 
MBFuzzer : MITM Fuzzing for Mobile Applications
MBFuzzer : MITM Fuzzing for Mobile ApplicationsMBFuzzer : MITM Fuzzing for Mobile Applications
MBFuzzer : MITM Fuzzing for Mobile ApplicationsFatih Ozavci
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2Sakuya Izayoi
 
Inc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchipInc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchipsweetchip
 
Fuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsFuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsPawel Rzepa
 

Viewers also liked (20)

0-knowledge fuzzing
0-knowledge fuzzing0-knowledge fuzzing
0-knowledge fuzzing
 
Fuzzing
FuzzingFuzzing
Fuzzing
 
Fuzzing sucks!
Fuzzing sucks!Fuzzing sucks!
Fuzzing sucks!
 
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzingGareth hayes. non alphanumeric javascript-php and shared fuzzing
Gareth hayes. non alphanumeric javascript-php and shared fuzzing
 
Web vulnerability seminar3
Web vulnerability seminar3Web vulnerability seminar3
Web vulnerability seminar3
 
How to find_vulnerability_in_software
How to find_vulnerability_in_softwareHow to find_vulnerability_in_software
How to find_vulnerability_in_software
 
Variables and constants
Variables and constantsVariables and constants
Variables and constants
 
Software Security - Vulnerability&Attack
Software Security - Vulnerability&AttackSoftware Security - Vulnerability&Attack
Software Security - Vulnerability&Attack
 
Security Testing: Fuzzing
Security Testing: FuzzingSecurity Testing: Fuzzing
Security Testing: Fuzzing
 
Web vulnerability seminar4
Web vulnerability seminar4Web vulnerability seminar4
Web vulnerability seminar4
 
Fuzzinator - In bug we trust.
Fuzzinator - In bug we trust.Fuzzinator - In bug we trust.
Fuzzinator - In bug we trust.
 
Codegate 2013 Junior - Music Player Exploit
Codegate 2013 Junior - Music Player ExploitCodegate 2013 Junior - Music Player Exploit
Codegate 2013 Junior - Music Player Exploit
 
Web vulnerability seminar1
Web vulnerability seminar1Web vulnerability seminar1
Web vulnerability seminar1
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
 
취약점(Vulnerability) db 구조 설명
취약점(Vulnerability) db 구조 설명취약점(Vulnerability) db 구조 설명
취약점(Vulnerability) db 구조 설명
 
MBFuzzer : MITM Fuzzing for Mobile Applications
MBFuzzer : MITM Fuzzing for Mobile ApplicationsMBFuzzer : MITM Fuzzing for Mobile Applications
MBFuzzer : MITM Fuzzing for Mobile Applications
 
Web vulnerability seminar2
Web vulnerability seminar2Web vulnerability seminar2
Web vulnerability seminar2
 
Inc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchipInc0gnito fuzzing for_fun_sweetchip
Inc0gnito fuzzing for_fun_sweetchip
 
Fuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugsFuzzing underestimated method of finding hidden bugs
Fuzzing underestimated method of finding hidden bugs
 
EZ KEY_EZ
EZ KEY_EZEZ KEY_EZ
EZ KEY_EZ
 

Similar to Browser Fuzzing with a Twist (and a Shake) -- ZeroNights 2015

Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Tjarda Peelen
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning processDenis Dus
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara AnjargolianHakka Labs
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forwardМарина Босова
 
Smart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSSmart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSJames Huston
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsAchievers Tech
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Andrei KUCHARAVY
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidMatthew Johnson
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementSasha Goldshtein
 
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander Dibbo
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander DibboOpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander Dibbo
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander DibboOpenNebula Project
 

Similar to Browser Fuzzing with a Twist (and a Shake) -- ZeroNights 2015 (20)

Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning process
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Internals of Presto Service
Internals of Presto ServiceInternals of Presto Service
Internals of Presto Service
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Performant Django - Ara Anjargolian
Performant Django - Ara AnjargolianPerformant Django - Ara Anjargolian
Performant Django - Ara Anjargolian
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forward
 
gcdtmp
gcdtmpgcdtmp
gcdtmp
 
Smart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWSSmart Platform Infrastructure with AWS
Smart Platform Infrastructure with AWS
 
Profiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty DetailsProfiling and Tuning a Web Application - The Dirty Details
Profiling and Tuning a Web Application - The Dirty Details
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
Introduction to .NET Performance Measurement
Introduction to .NET Performance MeasurementIntroduction to .NET Performance Measurement
Introduction to .NET Performance Measurement
 
Stackato
StackatoStackato
Stackato
 
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander Dibbo
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander DibboOpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander Dibbo
OpenNebulaConf2015 1.07 Cloud for Scientific Computing @ STFC - Alexander Dibbo
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Moving to moodle 2
Moving to moodle 2Moving to moodle 2
Moving to moodle 2
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 

More from Jeremy Brown

Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOSJeremy Brown
 
Attacking Big Data Land
Attacking Big Data LandAttacking Big Data Land
Attacking Big Data LandJeremy Brown
 
Adventures with Podman and Varlink
Adventures with Podman and VarlinkAdventures with Podman and Varlink
Adventures with Podman and VarlinkJeremy Brown
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical ApproachJeremy Brown
 
Microsoft Vulnerability Research - How to be a finder as a vendor
Microsoft Vulnerability Research - How to be a finder as a vendorMicrosoft Vulnerability Research - How to be a finder as a vendor
Microsoft Vulnerability Research - How to be a finder as a vendorJeremy Brown
 

More from Jeremy Brown (7)

Provoking Windows
Provoking WindowsProvoking Windows
Provoking Windows
 
Summer of Fuzz: macOS
Summer of Fuzz: macOSSummer of Fuzz: macOS
Summer of Fuzz: macOS
 
Unsecuring SSH
Unsecuring SSHUnsecuring SSH
Unsecuring SSH
 
Attacking Big Data Land
Attacking Big Data LandAttacking Big Data Land
Attacking Big Data Land
 
Adventures with Podman and Varlink
Adventures with Podman and VarlinkAdventures with Podman and Varlink
Adventures with Podman and Varlink
 
ProdSec: A Technical Approach
ProdSec: A Technical ApproachProdSec: A Technical Approach
ProdSec: A Technical Approach
 
Microsoft Vulnerability Research - How to be a finder as a vendor
Microsoft Vulnerability Research - How to be a finder as a vendorMicrosoft Vulnerability Research - How to be a finder as a vendor
Microsoft Vulnerability Research - How to be a finder as a vendor
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

Browser Fuzzing with a Twist (and a Shake) -- ZeroNights 2015

  • 1. Browser Fuzzing with a Twist (and a Shake) Jeremy Brown, 2015
  • 2. Agenda I. Introduction I. Target Architecture II. Infrastructure Notes II. ShakeIt I. Current Tooling II. Internals III. Incubation Results III. Conclusion
  • 3. #whoami • Jeremy Brown – Independent researcher / consultant – Formerly of Microsoft • Windows/Phone/Xbox Security • Malware Protection Center – Also, Tenable • Nessus • RE patches
  • 4. What I’m not covering • Comprehensive browser fundamentals – Just enough to get your feet wet • Looking for bugs outside of rendering engines – There’s plenty of other attack surface, but this one is really juicy & often no user interaction required • Sandbox escapes – This is needed post-compromise of renderer
  • 5.
  • 6. What I’m covering • The fuzzing engine part of the puzzle – But ShakeIt is not a fuzzer, it is a mutator • Working with grammar-based parsing engines – Not specific to browsers, but they’re a primary target • Overall setup you need to do so effectively – But not claiming I fuzz as well as Ben Nagy – A lot of hard lessons learned
  • 7. Why • Share the research instead of just letting it sit on my box – Projects often fade away after incubation, but are more valuable in collaboration • Not many talks detail the process and how the engine actually works – Most engines are not rocket science – Fuzzing really has no rules, any method fair game
  • 9. Credit: Chris Rolf / LeafSR (now Yahoo!) http://blog.leafsr.com/2012/09/09/google-native-client-attack-surface-and-vulnerabilities-part-4/
  • 10. Reference: “Inside Adobe Reader Protected Mode - Part 1 - Design” – Security @ Adobe http://blogs.adobe.com/security/2010/10/inside-adobe-reader-protected-mode-part-1-design.html
  • 11. Fuzzing Options • Generation Reference: http://www.peachfuzzer.com
  • 12. Fuzzing Options • Mutation – Zzuf is the canonical example here Reference: http://caca.zoy.org/wiki/zzuf
  • 13. Fuzzing Options • Code-assisted (eg. sub-evolutionary) – American Fuzzy Lop Reference: http://lcamtuf.coredump.cx/afl/
  • 16. Pieces to the Puzzle • A complete fuzzing framework has – Fuzzing Engine – System Harnesses – Scaling Infrastructure – Target-specific Support – Helpers
  • 17. Pieces to the Puzzle • Fuzzing Engine – Generator per specifications – Mutator based on particular algorithms – Instrumentation for code-assisted fuzzing
  • 18. Pieces to the Puzzle • Local System Harnesses – Debug harness to catch crashes – Filesystem monitor for interesting read/write – Dedicated and high performance database server • Or SSD for fast access to local sqlite db
  • 19. Pieces to the Puzzle • Scaling Infrastructure – High-performance machines with hypervisors – Clusters in a master/slave setup – An Army of Droids (eg. jduck) – Utilizing the online cloud providers
  • 20. Pieces to the Puzzle • Target-specific Support – File store for templates (eg. html, xml, pdf) • Client to add new templates / remove bad ones • WinAppDbg – Great framework, very versatile – Provides a ton of options for instrumentation – Run into interesting issues sometimes, eg. bottleneck with db server / attach memory errors
  • 21. Pieces to the Puzzle • Helpers – Pause/Restart support – Automatic repro / PoC generation – Data failure backup mechanisms – Minset support – Instrumentation / Code Coverage
  • 22. Agenda I. Introduction I. Target Architecture II. Infrastructure Notes II. ShakeIt I. Current Tooling II. Internals III. Incubation Results III. Conclusion
  • 23. Current Tooling • Cross_fuzz – Cross-document DOM binding fuzzer by lcamtuf – Similar concept to ShakeIt as it either selects or reuses input fragments • Fuzzinator – Tokenizes a collection of input and builds new tests from those References: http://lcamtuf.coredump.cx/cross_fuzz/ http://browser.sed.hu/blog/20141023/fuzzinator-reloaded
  • 24. Current Tooling • Jsfunfuzz – JavaScript fuzzer from Jesse Ruderman – Uses generational method to create interesting JS • LangFuzz – Grammar-based fuzzer by Mozilla / Saarland Uni – Utilizes the ANTLR suite for parsing – Like Cross_fuzz, it can reuse input fragments References: https://github.com/MozillaSecurity/funfuzz/blob/master/js/jsfunfuzz/README.md https://www.st.cs.uni-saarland.de/publications/files/holler-usenix-2012.pdf
  • 25. Deviations from ShakeIt • Dictionary – Defining a dictionary of valid tokens and replacing them with either randomly generated or oracle input • Nesting – Duplicating or multiplying tokens to create nesting in random or strategic locations
  • 28. How it works • Collection of tokens or “changeables” – Data – Position • Switch the data a random positions • Fix it all back up and generate new test case • Idea is simple, but implementation is more complex
  • 29. Process • Step 1 – Feed it templates (HTML, XML, JS, PDF + JS, etc) – Can handle simple or complex input
  • 30. Implementation Details • Consume template – Modes for HTML/JS or PDF/JS • Call Shake.It – It calls Token.Find to find all the tokens – We need at least (2) to perform mutation – Token.Find uses extensive set of regex’s
  • 31. Implementation Details • Token.Match successful, save it and continue • Once complete, Shake.Shuffle all the tokens – Iterate from the end, choosing random index and removing items from the pool until exhaustion
  • 32. Implementation Details • After Shuffle, now build out the mutation – Find each shuffled position, insert new data and append all other template content appropriately
  • 33. Implementation Details • Write to output and repeat n iterations! – We use .NET threads to utilize computing power – SHA1 for *unique filenames • * We don’t care about collisions here 
  • 35.
  • 36. Fuzzing Strategy • Tries to “confuse” the rendering engine • Mixes types, parameters, values, objects • Tries to put the browser in a weird state and force it to make bad decisions – “Shaking the memory corruption tree”
  • 38.
  • 39.
  • 40.
  • 41. Process • Step 2 – Store mutated collection on file or web server – Make it accessible to a browser
  • 42. Process • Step 3 – Setup target with harness, iterate over collection – Store results in database for sorting, repros on network share for debugging promising crashes
  • 43. Implementation • Written in C# – Algorithm is portable though • Available after this talk
  • 45. Incubation Results • Interesting Chrome/Opera crashes – Sadly hard to save repros per infrastructure issues – Could not determine if crashes can from render bugs or attach/synchronization issues
  • 46. Incubation Results • Multiple crashes in WebKit/GTK+ – Only 2 / 4 repro’d – Suspected invalid access on garbage collection
  • 47. Incubation Results • Unremarkable crash in KHTML – Continuous memory allocations and copies
  • 48. Incubation Results • Likely exploitable memory corruption bug in Netsurf (popular embedded device browser) – Corruption of internal structure pointer – Triggered by mutated tag property
  • 49. Incubation Results • Interesting crash in Phonon (VLC @ web) – Triggered by parsing multimedia content / tags
  • 50. Challenges / Lessons Learned • Comprehensive fuzzing harnesses enable a smooth process • Without a complete system, it’s tough to be successful – Bandwidth, resources or tooling are bottlenecks
  • 51. Agenda I. Introduction I. Target Architecture II. Infrastructure Notes II. ShakeIt I. Current Tooling II. Internals III. Incubation Results III. Conclusion
  • 52. Future Work • Enable ShakeIt in scalable environment OR • Port it to existing fuzzing frameworks – Joxean’s Nightmare Fuzzer – <insert your custom fuzzing framework @ home> – Perhaps even a Metasploit auxiliary module
  • 53. Conclusion • Fuzzing is more than a mutation engine – Strategy and infrastructure matter too • Investment in tooling is paramount – But don’t micro-manage ROI! • More complexity == more fuzzing bugs – Code review for complex operations is expensive – Manually pen-testing is great for logic bugs – Does anyone seeing software becoming simpler?
  • 54. Conclusion • Sandboxes cannot save you from bugs – You just need +1 more bug • SDL cannot save you from bugs – Too much old code, too much new code, not enough eyes or interested people to throw at it • Mitigations cannot save you from bugs – They only make them +n days harder to exploit • Managed code is a positive step forward

Editor's Notes

  1. Most of these are self-contained or mutators, not full fuzzing frameworks
  2. Taylor Swift is obviously a blackhat
  3. High-level look
  4. Negative and positive lookaheads
  5. Negative and positive lookaheads
  6. Negative and positive lookaheads
  7. Negative and positive lookaheads
  8. Deep dive a little and zoom into the process