SlideShare a Scribd company logo
1 of 38
Download to read offline
1
Fuzzing the Media Framework in Android
Alexandru Blanda
OTC Security QA
2
Agenda
Introduction
Fuzzing Media Content in Android
Data Generation
Fuzzing the Stagefright Framework
Logging & Triage Mechanisms
3
Introduction
Fuzzing
• Form of black-box testing
• Involves sending corrupt input to a software system and
monitoring for crashes
• Purpose: find security-related problems or any other critical
defects that could lead to an undesirable behaviour of the system
4
Introduction
Fuzzing
Possible targets:
 Media Players
 Document Viewers
 Web Browsers
 Antivirus products
 Binary (ELF)
5
Introduction
Audio and video as attack vectors
• Binary streams containing complex data
• Large variety of audio and video players and associated media
codecs
• User perception that media files are harmless
• Media playback doesn’t require special permissions
6
Introduction
What to expect
• Crashes (SIGSEGV, SIGFPE, SIGABRT, SIGILL)
• Process hangs (synchronization issues, memory leaks, infinite
loops)
• Denial of Service situations (device reboots, application crashes)
• Buffer overflows, null-pointer dereference, integer overflows
7
Introduction
Fuzzing Media Content in Android
Data Generation
Fuzzing the Stagefright Framework
Logging & Triage Mechanisms
Agenda
8
Fuzzing Media Content in Android
Overview
• Create corrupt but structurally valid media files
• Direct them to the appropriate decoders in Android
• Monitor the system for potential issues
• Pass the issues through a triage mechanism
9
Fuzzing Media Content in Android
Steps in a fuzzing campaign
1. Identify type of input
2. Identify entry point in the system
3. Data generation
4. Execution phase (actual fuzzing process)
5. Monitor results (logging process)
6. Triage phase
10
Fuzzing Media Content in Android
Steps in a fuzzing campaign
1. Identify type of input - corrupt media files
2. Identify entry point in the system - Stagefright framework
3. Data generation - various fuzzing tools
4. Execution phase - Stagefright CLI
5. Monitor results - log buffer in Android
6. Triage phase - /data/tombstones
11
Introduction
Fuzzing Media Content in Android
Data generation
Fuzzing the Stagefright framework
Logging & Triage mechanisms
Agenda
12
Data generation
Tools
• Basic Fuzzing Framework (BFF)
• FuzzBox
• Radamsa
• American Fuzzy Lop (AFL)
• Seed gathering
13
Data generation
Basic Fuzzing Framework (BFF)
• Mutational fuzzing on software that consumes file input
• Automatically generated GDB and Valgrind traces
• Crash classification based on bug severity/exploitability
degree
• Automated test case minimization, for inputs that produce a
crash
• Based on a modified version of zzuf
14
Data generation
BFF for Android fuzzing
• Generate test files on a temporary location the disk (rather
than directly in memory)
• External script to save the files from the temporary location
• Retrace generated test cases to their initial seed files
15
Data generation
FuzzBox
• Multi-codec media fuzzing tool, written in Python
• Creates corrupt but structurally valid media files and launches
them in a player, while gathering GDB backtraces
• More targeted than BFF (targets specific stream formats)
• Supported filetypes: Ogg, FLAC, ASF(WMV, WMA), MP3,
MP4, Speex, WAV, AIFF
16
Data generation
FuzzBox for Android fuzzing
• Several changes from the standard tool:
• Only use the data generation functionality of the tool
• Retrace all generated test files to their initial seed files
• Automated tool usage
• Much faster than BFF !
17
Data generation
Radamsa
• General purpose fuzzer
• Random, deterministic, model-based fuzzer
• Collection of ~15 smaller model-based fuzzers
• Control over mutation patterns and data generation sources
• Mainly used only for generating test cases
• Can be easily ported to run directly on Android (advantages?)
18
Data generation
Seed gathering
 Python mass downloader using
Google and Bing search engines
 The LibAv samples collection:
more than 50 GB of valid and
corrupt media files
http://samples.mplayerhq.hu/
 -inurl:htm -inurl:html intitle:
”index of” .mp3 + wget
19
Introduction
Fuzzing Media Content in Android
Data generation
Fuzzing the Stagefright framework
Logging & Triage mechanisms
Agenda
20
Fuzzing the Stagefright framework
The fuzzing infrastructure
21
Fuzzing the Stagefright framework
Overview of the testing process
• Corrupted media input is created on a server using the data
generation tools
• The server sends large sets of test cases to the local host
• Each set of test files is automatically divided into separate
batches
• Each device receives a batch of testing files in a distributed
manner and logs the results separately
22
Fuzzing the Stagefright framework
root@android:/ # stagefright -h
usage: stagefright
-h(elp)
-a(udio)
-n repetitions
-l(ist) components
-m max-number-of-frames-to-decode in each pass
-p(rofiles) dump decoder profiles supported
-t(humbnail) extract video thumbnail or album art
-s(oftware) prefer software codec
-r(hardware) force to use hardware codec
-o playback audio
-w(rite) filename (write to .mp4 file)
-x display a histogram of decoding times/fps (video only)
-S allocate buffers from a surface
-T allocate buffers from a surface texture
-d(ump) filename (raw stream data to a file)
-D(ump) filename (decoded PCM data to a file)
Stagefright command line interface
23
Introduction
Fuzzing Media Content in Android
Data generation
Fuzzing the Stagefright framework
Logging & Triage mechanisms
Agenda
24
Logging and Triage Mechanisms
• Log every test case executed with Fatal priority
• Save filtered logcat buffer for each campaign, for all devices
"adb shell log -p F -t sp_stagefright *** Filename:" + test_files[i]
Logging process
25
0
20000
40000
60000
80000
100000
120000
140000
160000
Number of files
Total: ~1 million
Logging and Triage Mechanisms
Initial results
26
0
500
1000
1500
2000
2500
3000
Size of files
Total: ~11.5 TB
Logging and Triage Mechanisms
Initial results
27
0
5000
10000
15000
20000
25000
30000
35000
40000
45000
Number of crashes
Total: ~185000
crashes
Logging and Triage Mechanisms
Initial results
28
Logging and Triage Mechanisms
Triage phase
• Problem: Automated fuzzing campaigns generating large
number of crashes (issues)
› Manual sorting is not an option
• Suitable testing scenarios: involve executing various test
cases on devices and monitoring for crashes
29
Logging and Triage Mechanisms
Testing scenario
2 separate phases:
• First run testing phase
› Test cases are executed on the device
› Logs are created during each test run
• Triage phase
› Generated logs are parsed to identify crashing test cases
› Crashing test cases are resent to the device
› Previously unseen crashes get stored in the unique issues pool
30
Logging and Triage Mechanisms
Triage phase - implementation
• Each test case that produces a crash generates an entry in
data/tombstones and data/system/dropbox
31
Logging and Triage Mechanisms
Triage phase - implementation
1. Parse the logs and identify the test cases that caused a crash
2. Resend the files to the testing infrastructure
3. For each test file sent:
a. Grab the generated tombstone
b. Parse the tombstone and get the PC value
c. Check if the PC value has been previously encountered
d. Save the tombstone and the test case if the issue is new
32
Logging and Triage Mechanisms
Triage phase - implementation
• Diff between the folder that contains the unique issues, before
and after the triage process:
Common subdirectories: ./0015ae9f and old_issues/0015ae9f
Common subdirectories: ./00163774 and old_issues/00163774
Only in .: 001639cf
Only in .: 00167d90
Common subdirectories: ./00168304 and old_issues/00168304
Common subdirectories: ./00169d0f and old_issues/00169d0f
Common subdirectories: ./0016c8a7 and old_issues/0016c8a7
Only in .: 001a9211
Common subdirectories: ./00235a99 and old_issues/00235a99
33
0
1
2
3
4
5
6
7
8
Number of issues
Total: 35 issues
Logging and Triage Mechanisms
Results after triage
34
Logging and Triage Mechanisms
Results after triage
• Majority of issues reproduced in AOSP – reported
directly to Google
• 7 issues considered security vulnerabilities, 3 included in
Android Security Bulletin from September 2014
• Integer overflows in libstagefright:
› CVE-2014-7915, CVE-2014-7916, CVE-2014-7917
35
Introduction
Fuzzing Media Content in Android
Data generation
Fuzzing the Stagefright framework
Logging & Triage mechanisms
Fuzzing Stagefright with AFL
Agenda
36
Fuzzing Stagefright with AFL
The American Fuzzy Lop fuzzing tool
• Instrumentation based fuzzing tool
• Targeted binaries need to be compiled with afl-gcc (wrapper
over gcc)
• Two fuzzing modes: dumb-mode, instrumented-mode
• Instrumented mode detects changes to program control flow
to find new code paths
• Detects both crashes and hangs and sorts out the unique
issues
37
Fuzzing Stagefright with AFL
AFL on Android
• Build instrumented binary like a regular Android module
• Use environment variables (afl-gcc built as wrapper over
gcc toolchain from Android)
https://github.com/fuzzing/MFFA
ioan-alexandru.blanda@intel.com

More Related Content

What's hot

Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatilityYashashree Gund
 
[若渴計畫] Black Hat 2017之過去閱讀相關整理
[若渴計畫] Black Hat 2017之過去閱讀相關整理[若渴計畫] Black Hat 2017之過去閱讀相關整理
[若渴計畫] Black Hat 2017之過去閱讀相關整理Aj MaChInE
 
Metasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeMetasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeE Hacking
 
Is That A Penguin In My Windows?
Is That A Penguin In My Windows?Is That A Penguin In My Windows?
Is That A Penguin In My Windows?zeroSteiner
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareTakahiro Haruyama
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXTakahiro Haruyama
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Sam Bowne
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgSam Bowne
 
Fun With Dr Brown
Fun With Dr BrownFun With Dr Brown
Fun With Dr BrownzeroSteiner
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseTakahiro Haruyama
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCanSecWest
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgSam Bowne
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgSam Bowne
 
BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...BlueHat Security Conference
 
Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Honorary_BoT
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CanSecWest
 

What's hot (20)

Malware analysis using volatility
Malware analysis using volatilityMalware analysis using volatility
Malware analysis using volatility
 
[若渴計畫] Black Hat 2017之過去閱讀相關整理
[若渴計畫] Black Hat 2017之過去閱讀相關整理[若渴計畫] Black Hat 2017之過去閱讀相關整理
[若渴計畫] Black Hat 2017之過去閱讀相關整理
 
Metasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeMetasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning Tree
 
Is That A Penguin In My Windows?
Is That A Penguin In My Windows?Is That A Penguin In My Windows?
Is That A Penguin In My Windows?
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugX
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
Practical Malware Analysis Ch12
Practical Malware Analysis Ch12Practical Malware Analysis Ch12
Practical Malware Analysis Ch12
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Fun With Dr Brown
Fun With Dr BrownFun With Dr Brown
Fun With Dr Brown
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCase
 
Dll injection
Dll injectionDll injection
Dll injection
 
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updatedCsw2017 bazhaniuk exploring_yoursystemdeeper_updated
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbgPractical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
 
BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...BlueHat v18 || Linear time shellcode detection using state machines and opera...
BlueHat v18 || Linear time shellcode detection using state machines and opera...
 
Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10Bypassing patchguard on Windows 8.1 and Windows 10
Bypassing patchguard on Windows 8.1 and Windows 10
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
 

Similar to Fuzzing the Media Framework in Android

technical overview - endpoint protection 10.3.3
technical overview - endpoint protection 10.3.3technical overview - endpoint protection 10.3.3
technical overview - endpoint protection 10.3.3Muhammad Denis Iqbal
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharingJames Hsieh
 
A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node ibmwebspheresoftware
 
Global System For Automated Applications Using Plug In
Global System For Automated Applications Using Plug InGlobal System For Automated Applications Using Plug In
Global System For Automated Applications Using Plug Injpinasaez
 
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...Mike Spaulding
 
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)BlueHat v18 || Return of the kernel rootkit malware (on windows 10)
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)BlueHat Security Conference
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsGraham Dumpleton
 
Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxbriancrawford30935
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPLnitinscribd
 
SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012Rian Yulian
 
Blackhat USA 2016 - What's the DFIRence for ICS?
Blackhat USA 2016 - What's the DFIRence for ICS?Blackhat USA 2016 - What's the DFIRence for ICS?
Blackhat USA 2016 - What's the DFIRence for ICS?Chris Sistrunk
 
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)Dina Goldshtein
 
Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerShakacon
 
Process control daemon
Process control daemonProcess control daemon
Process control daemonhaish
 
Lessons learned from designing QA automation event streaming platform(IoT big...
Lessons learned from designing QA automation event streaming platform(IoT big...Lessons learned from designing QA automation event streaming platform(IoT big...
Lessons learned from designing QA automation event streaming platform(IoT big...Omid Vahdaty
 
Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP StackLorna Mitchell
 
End of Studies project: Malware Repsonse Center
End of Studies project: Malware Repsonse CenterEnd of Studies project: Malware Repsonse Center
End of Studies project: Malware Repsonse CenterAbdessabour Arous
 

Similar to Fuzzing the Media Framework in Android (20)

technical overview - endpoint protection 10.3.3
technical overview - endpoint protection 10.3.3technical overview - endpoint protection 10.3.3
technical overview - endpoint protection 10.3.3
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharing
 
A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node A Taste of Monitoring and Post Mortem Debugging with Node
A Taste of Monitoring and Post Mortem Debugging with Node
 
Global System For Automated Applications Using Plug In
Global System For Automated Applications Using Plug InGlobal System For Automated Applications Using Plug In
Global System For Automated Applications Using Plug In
 
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
BlackHat Presentation - Lies and Damn Lies: Getting past the Hype of Endpoint...
 
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)BlueHat v18 || Return of the kernel rootkit malware (on windows 10)
BlueHat v18 || Return of the kernel rootkit malware (on windows 10)
 
Breach and attack simulation tools
Breach and attack simulation toolsBreach and attack simulation tools
Breach and attack simulation tools
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web ApplicationsPyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
 
Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docx
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
Blackhat USA 2016 - What's the DFIRence for ICS?
Blackhat USA 2016 - What's the DFIRence for ICS?Blackhat USA 2016 - What's the DFIRence for ICS?
Blackhat USA 2016 - What's the DFIRence for ICS?
 
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
Self-Aware Applications: Automatic Production Monitoring (NDC Sydney 2017)
 
Modern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layerModern Reconnaissance Phase on APT - protection layer
Modern Reconnaissance Phase on APT - protection layer
 
Process control daemon
Process control daemonProcess control daemon
Process control daemon
 
Lessons learned from designing QA automation event streaming platform(IoT big...
Lessons learned from designing QA automation event streaming platform(IoT big...Lessons learned from designing QA automation event streaming platform(IoT big...
Lessons learned from designing QA automation event streaming platform(IoT big...
 
Tool up your lamp stack
Tool up your lamp stackTool up your lamp stack
Tool up your lamp stack
 
Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP Stack
 
End of Studies project: Malware Repsonse Center
End of Studies project: Malware Repsonse CenterEnd of Studies project: Malware Repsonse Center
End of Studies project: Malware Repsonse Center
 

More from E Hacking

CEH and Security+ Training Outline - EH Academy
CEH and Security+ Training Outline - EH AcademyCEH and Security+ Training Outline - EH Academy
CEH and Security+ Training Outline - EH AcademyE Hacking
 
Threats against the next billion devices
Threats against the next billion devicesThreats against the next billion devices
Threats against the next billion devicesE Hacking
 
High Definition Fuzzing; Exploring HDMI vulnerabilities
High Definition Fuzzing; Exploring HDMI vulnerabilitiesHigh Definition Fuzzing; Exploring HDMI vulnerabilities
High Definition Fuzzing; Exploring HDMI vulnerabilitiesE Hacking
 
New Developments in the BREACH attack
New Developments in the BREACH attackNew Developments in the BREACH attack
New Developments in the BREACH attackE Hacking
 
Exploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsExploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsE Hacking
 
Most Important steps to become a hacker
Most Important steps to become a hackerMost Important steps to become a hacker
Most Important steps to become a hackerE Hacking
 
Penetrating the Perimeter - Tales from the Battlefield
Penetrating the Perimeter - Tales from the BattlefieldPenetrating the Perimeter - Tales from the Battlefield
Penetrating the Perimeter - Tales from the BattlefieldE Hacking
 
Website fingerprinting on TOR
Website fingerprinting on TORWebsite fingerprinting on TOR
Website fingerprinting on TORE Hacking
 
Stalking a City for Fun and Frivolity" Defcon Talk
Stalking a City for Fun and Frivolity" Defcon TalkStalking a City for Fun and Frivolity" Defcon Talk
Stalking a City for Fun and Frivolity" Defcon TalkE Hacking
 
Hacking Wireless World, RFID hacking
Hacking Wireless World, RFID hackingHacking Wireless World, RFID hacking
Hacking Wireless World, RFID hackingE Hacking
 
Abusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itAbusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itE Hacking
 
Malicious Domain Profiling
Malicious Domain Profiling Malicious Domain Profiling
Malicious Domain Profiling E Hacking
 
Searching Shodan For Fun And Profit
Searching Shodan For Fun And ProfitSearching Shodan For Fun And Profit
Searching Shodan For Fun And ProfitE Hacking
 
The Machines that Betrayed their Masters
The Machines that Betrayed their MastersThe Machines that Betrayed their Masters
The Machines that Betrayed their MastersE Hacking
 
Detecting Bluetooth Surveillance Systems
Detecting Bluetooth Surveillance SystemsDetecting Bluetooth Surveillance Systems
Detecting Bluetooth Surveillance SystemsE Hacking
 
Unmasking or De-Anonymizing You
Unmasking or De-Anonymizing YouUnmasking or De-Anonymizing You
Unmasking or De-Anonymizing YouE Hacking
 
WhatsApp Chat Hacking/Stealing POC
WhatsApp Chat Hacking/Stealing POCWhatsApp Chat Hacking/Stealing POC
WhatsApp Chat Hacking/Stealing POCE Hacking
 
Building Trojan Hardware at Home
Building Trojan Hardware at HomeBuilding Trojan Hardware at Home
Building Trojan Hardware at HomeE Hacking
 
Social Media Monitoring tools as an OSINT platform for intelligence
Social Media Monitoring tools as an OSINT platform for intelligenceSocial Media Monitoring tools as an OSINT platform for intelligence
Social Media Monitoring tools as an OSINT platform for intelligenceE Hacking
 
LDAP Injections & Blind LDAP Injections Paper
LDAP Injections & Blind LDAP Injections PaperLDAP Injections & Blind LDAP Injections Paper
LDAP Injections & Blind LDAP Injections PaperE Hacking
 

More from E Hacking (20)

CEH and Security+ Training Outline - EH Academy
CEH and Security+ Training Outline - EH AcademyCEH and Security+ Training Outline - EH Academy
CEH and Security+ Training Outline - EH Academy
 
Threats against the next billion devices
Threats against the next billion devicesThreats against the next billion devices
Threats against the next billion devices
 
High Definition Fuzzing; Exploring HDMI vulnerabilities
High Definition Fuzzing; Exploring HDMI vulnerabilitiesHigh Definition Fuzzing; Exploring HDMI vulnerabilities
High Definition Fuzzing; Exploring HDMI vulnerabilities
 
New Developments in the BREACH attack
New Developments in the BREACH attackNew Developments in the BREACH attack
New Developments in the BREACH attack
 
Exploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit SystemsExploiting Linux On 32-bit and 64-bit Systems
Exploiting Linux On 32-bit and 64-bit Systems
 
Most Important steps to become a hacker
Most Important steps to become a hackerMost Important steps to become a hacker
Most Important steps to become a hacker
 
Penetrating the Perimeter - Tales from the Battlefield
Penetrating the Perimeter - Tales from the BattlefieldPenetrating the Perimeter - Tales from the Battlefield
Penetrating the Perimeter - Tales from the Battlefield
 
Website fingerprinting on TOR
Website fingerprinting on TORWebsite fingerprinting on TOR
Website fingerprinting on TOR
 
Stalking a City for Fun and Frivolity" Defcon Talk
Stalking a City for Fun and Frivolity" Defcon TalkStalking a City for Fun and Frivolity" Defcon Talk
Stalking a City for Fun and Frivolity" Defcon Talk
 
Hacking Wireless World, RFID hacking
Hacking Wireless World, RFID hackingHacking Wireless World, RFID hacking
Hacking Wireless World, RFID hacking
 
Abusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get itAbusing Microsoft Kerberos - Sorry you guys don’t get it
Abusing Microsoft Kerberos - Sorry you guys don’t get it
 
Malicious Domain Profiling
Malicious Domain Profiling Malicious Domain Profiling
Malicious Domain Profiling
 
Searching Shodan For Fun And Profit
Searching Shodan For Fun And ProfitSearching Shodan For Fun And Profit
Searching Shodan For Fun And Profit
 
The Machines that Betrayed their Masters
The Machines that Betrayed their MastersThe Machines that Betrayed their Masters
The Machines that Betrayed their Masters
 
Detecting Bluetooth Surveillance Systems
Detecting Bluetooth Surveillance SystemsDetecting Bluetooth Surveillance Systems
Detecting Bluetooth Surveillance Systems
 
Unmasking or De-Anonymizing You
Unmasking or De-Anonymizing YouUnmasking or De-Anonymizing You
Unmasking or De-Anonymizing You
 
WhatsApp Chat Hacking/Stealing POC
WhatsApp Chat Hacking/Stealing POCWhatsApp Chat Hacking/Stealing POC
WhatsApp Chat Hacking/Stealing POC
 
Building Trojan Hardware at Home
Building Trojan Hardware at HomeBuilding Trojan Hardware at Home
Building Trojan Hardware at Home
 
Social Media Monitoring tools as an OSINT platform for intelligence
Social Media Monitoring tools as an OSINT platform for intelligenceSocial Media Monitoring tools as an OSINT platform for intelligence
Social Media Monitoring tools as an OSINT platform for intelligence
 
LDAP Injections & Blind LDAP Injections Paper
LDAP Injections & Blind LDAP Injections PaperLDAP Injections & Blind LDAP Injections Paper
LDAP Injections & Blind LDAP Injections Paper
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Fuzzing the Media Framework in Android

  • 1. 1 Fuzzing the Media Framework in Android Alexandru Blanda OTC Security QA
  • 2. 2 Agenda Introduction Fuzzing Media Content in Android Data Generation Fuzzing the Stagefright Framework Logging & Triage Mechanisms
  • 3. 3 Introduction Fuzzing • Form of black-box testing • Involves sending corrupt input to a software system and monitoring for crashes • Purpose: find security-related problems or any other critical defects that could lead to an undesirable behaviour of the system
  • 4. 4 Introduction Fuzzing Possible targets:  Media Players  Document Viewers  Web Browsers  Antivirus products  Binary (ELF)
  • 5. 5 Introduction Audio and video as attack vectors • Binary streams containing complex data • Large variety of audio and video players and associated media codecs • User perception that media files are harmless • Media playback doesn’t require special permissions
  • 6. 6 Introduction What to expect • Crashes (SIGSEGV, SIGFPE, SIGABRT, SIGILL) • Process hangs (synchronization issues, memory leaks, infinite loops) • Denial of Service situations (device reboots, application crashes) • Buffer overflows, null-pointer dereference, integer overflows
  • 7. 7 Introduction Fuzzing Media Content in Android Data Generation Fuzzing the Stagefright Framework Logging & Triage Mechanisms Agenda
  • 8. 8 Fuzzing Media Content in Android Overview • Create corrupt but structurally valid media files • Direct them to the appropriate decoders in Android • Monitor the system for potential issues • Pass the issues through a triage mechanism
  • 9. 9 Fuzzing Media Content in Android Steps in a fuzzing campaign 1. Identify type of input 2. Identify entry point in the system 3. Data generation 4. Execution phase (actual fuzzing process) 5. Monitor results (logging process) 6. Triage phase
  • 10. 10 Fuzzing Media Content in Android Steps in a fuzzing campaign 1. Identify type of input - corrupt media files 2. Identify entry point in the system - Stagefright framework 3. Data generation - various fuzzing tools 4. Execution phase - Stagefright CLI 5. Monitor results - log buffer in Android 6. Triage phase - /data/tombstones
  • 11. 11 Introduction Fuzzing Media Content in Android Data generation Fuzzing the Stagefright framework Logging & Triage mechanisms Agenda
  • 12. 12 Data generation Tools • Basic Fuzzing Framework (BFF) • FuzzBox • Radamsa • American Fuzzy Lop (AFL) • Seed gathering
  • 13. 13 Data generation Basic Fuzzing Framework (BFF) • Mutational fuzzing on software that consumes file input • Automatically generated GDB and Valgrind traces • Crash classification based on bug severity/exploitability degree • Automated test case minimization, for inputs that produce a crash • Based on a modified version of zzuf
  • 14. 14 Data generation BFF for Android fuzzing • Generate test files on a temporary location the disk (rather than directly in memory) • External script to save the files from the temporary location • Retrace generated test cases to their initial seed files
  • 15. 15 Data generation FuzzBox • Multi-codec media fuzzing tool, written in Python • Creates corrupt but structurally valid media files and launches them in a player, while gathering GDB backtraces • More targeted than BFF (targets specific stream formats) • Supported filetypes: Ogg, FLAC, ASF(WMV, WMA), MP3, MP4, Speex, WAV, AIFF
  • 16. 16 Data generation FuzzBox for Android fuzzing • Several changes from the standard tool: • Only use the data generation functionality of the tool • Retrace all generated test files to their initial seed files • Automated tool usage • Much faster than BFF !
  • 17. 17 Data generation Radamsa • General purpose fuzzer • Random, deterministic, model-based fuzzer • Collection of ~15 smaller model-based fuzzers • Control over mutation patterns and data generation sources • Mainly used only for generating test cases • Can be easily ported to run directly on Android (advantages?)
  • 18. 18 Data generation Seed gathering  Python mass downloader using Google and Bing search engines  The LibAv samples collection: more than 50 GB of valid and corrupt media files http://samples.mplayerhq.hu/  -inurl:htm -inurl:html intitle: ”index of” .mp3 + wget
  • 19. 19 Introduction Fuzzing Media Content in Android Data generation Fuzzing the Stagefright framework Logging & Triage mechanisms Agenda
  • 20. 20 Fuzzing the Stagefright framework The fuzzing infrastructure
  • 21. 21 Fuzzing the Stagefright framework Overview of the testing process • Corrupted media input is created on a server using the data generation tools • The server sends large sets of test cases to the local host • Each set of test files is automatically divided into separate batches • Each device receives a batch of testing files in a distributed manner and logs the results separately
  • 22. 22 Fuzzing the Stagefright framework root@android:/ # stagefright -h usage: stagefright -h(elp) -a(udio) -n repetitions -l(ist) components -m max-number-of-frames-to-decode in each pass -p(rofiles) dump decoder profiles supported -t(humbnail) extract video thumbnail or album art -s(oftware) prefer software codec -r(hardware) force to use hardware codec -o playback audio -w(rite) filename (write to .mp4 file) -x display a histogram of decoding times/fps (video only) -S allocate buffers from a surface -T allocate buffers from a surface texture -d(ump) filename (raw stream data to a file) -D(ump) filename (decoded PCM data to a file) Stagefright command line interface
  • 23. 23 Introduction Fuzzing Media Content in Android Data generation Fuzzing the Stagefright framework Logging & Triage mechanisms Agenda
  • 24. 24 Logging and Triage Mechanisms • Log every test case executed with Fatal priority • Save filtered logcat buffer for each campaign, for all devices "adb shell log -p F -t sp_stagefright *** Filename:" + test_files[i] Logging process
  • 25. 25 0 20000 40000 60000 80000 100000 120000 140000 160000 Number of files Total: ~1 million Logging and Triage Mechanisms Initial results
  • 26. 26 0 500 1000 1500 2000 2500 3000 Size of files Total: ~11.5 TB Logging and Triage Mechanisms Initial results
  • 27. 27 0 5000 10000 15000 20000 25000 30000 35000 40000 45000 Number of crashes Total: ~185000 crashes Logging and Triage Mechanisms Initial results
  • 28. 28 Logging and Triage Mechanisms Triage phase • Problem: Automated fuzzing campaigns generating large number of crashes (issues) › Manual sorting is not an option • Suitable testing scenarios: involve executing various test cases on devices and monitoring for crashes
  • 29. 29 Logging and Triage Mechanisms Testing scenario 2 separate phases: • First run testing phase › Test cases are executed on the device › Logs are created during each test run • Triage phase › Generated logs are parsed to identify crashing test cases › Crashing test cases are resent to the device › Previously unseen crashes get stored in the unique issues pool
  • 30. 30 Logging and Triage Mechanisms Triage phase - implementation • Each test case that produces a crash generates an entry in data/tombstones and data/system/dropbox
  • 31. 31 Logging and Triage Mechanisms Triage phase - implementation 1. Parse the logs and identify the test cases that caused a crash 2. Resend the files to the testing infrastructure 3. For each test file sent: a. Grab the generated tombstone b. Parse the tombstone and get the PC value c. Check if the PC value has been previously encountered d. Save the tombstone and the test case if the issue is new
  • 32. 32 Logging and Triage Mechanisms Triage phase - implementation • Diff between the folder that contains the unique issues, before and after the triage process: Common subdirectories: ./0015ae9f and old_issues/0015ae9f Common subdirectories: ./00163774 and old_issues/00163774 Only in .: 001639cf Only in .: 00167d90 Common subdirectories: ./00168304 and old_issues/00168304 Common subdirectories: ./00169d0f and old_issues/00169d0f Common subdirectories: ./0016c8a7 and old_issues/0016c8a7 Only in .: 001a9211 Common subdirectories: ./00235a99 and old_issues/00235a99
  • 33. 33 0 1 2 3 4 5 6 7 8 Number of issues Total: 35 issues Logging and Triage Mechanisms Results after triage
  • 34. 34 Logging and Triage Mechanisms Results after triage • Majority of issues reproduced in AOSP – reported directly to Google • 7 issues considered security vulnerabilities, 3 included in Android Security Bulletin from September 2014 • Integer overflows in libstagefright: › CVE-2014-7915, CVE-2014-7916, CVE-2014-7917
  • 35. 35 Introduction Fuzzing Media Content in Android Data generation Fuzzing the Stagefright framework Logging & Triage mechanisms Fuzzing Stagefright with AFL Agenda
  • 36. 36 Fuzzing Stagefright with AFL The American Fuzzy Lop fuzzing tool • Instrumentation based fuzzing tool • Targeted binaries need to be compiled with afl-gcc (wrapper over gcc) • Two fuzzing modes: dumb-mode, instrumented-mode • Instrumented mode detects changes to program control flow to find new code paths • Detects both crashes and hangs and sorts out the unique issues
  • 37. 37 Fuzzing Stagefright with AFL AFL on Android • Build instrumented binary like a regular Android module • Use environment variables (afl-gcc built as wrapper over gcc toolchain from Android)