SlideShare a Scribd company logo
Make static instrumentation great again
High performance fuzzing for Windows system
Lucas Leong (@_wmliang_)
1
#whoami
• Security researcher from Trend Micro
• Interested in
• vulnerability discovery
• binary exploitation
• reverse engineering
• symbolic execution
• MSRC TOP 100
• HITCON CTF team
2
Agenda
• Motivation
• Related works
• AFL 101
• Implementation
• Benchmark
• Demo
• Case study
CLFS, CNG, Registry
• Conclusion
3
Motivation
• 2014 Nov, AFL is released
• I want to fuzz windows target
4
Motivation
• 2014 Nov, AFL is released
• I want to fuzz windows target
• 2016 Jul, WinAFL is committed
• I want a better performance, support kernel
5
Motivation
• 2014 Nov, AFL is released
• I want to fuzz windows target
• 2016 Jul, WinAFL is committed
• I want a better performance, support kernel
• 2017 Jul, Static binary instrumentation via syzygy is merged
• I don’t have full PDB
• And I want more, scale up, etc
6
Motivation
7
Related works – static
• WinAFL
• Use dynamic binary instrumentation via DynamoRIO
• Support static binary instrumentation via syzygy
• Require full PDB
8
Related works – dynamic
• DARKO
• Static analysis via Capstone
• Dynamic binary rewriting via Keystone
• Cross platforms and architectures
• KFUZZ
• Focus on windows kernel driver
• Dynamic binary rewriting
• Use interrupt instead of hook to solve the tiny basic block problem
9
Related works – hardware
• winafl-intelpt
• Use the built-in Intel PT driver (ipt.sys) in RS5
• kAFL
• Combine QEMU/KVM and Intel PT
• Scale-up and cross platform fuzzing
• Filter with vCPU/Supervisor/CR3/IP-Range
10
Related works – virtualization
• applepie
• Combine Bochs and WHVP API
• Get code coverage at the hypervisor level
• Restore snapshot with the modified pages only
11
AFL 101
12
initialize
mutate input
choose input
from queue
new
coverage
?
crash ?
run targetsave in queue
save
Yes
No
Yes No
AFL 101
• Instrument each basic block on compile-time (afl-gcc)
• Record code coverage on execution-time (afl-fuzz)
13
instrumented
lea rsp,[rsp-0x98]
mov QWORD PTR [rsp],rdx
mov QWORD PTR [rsp+0x8],rcx
mov QWORD PTR [rsp+0x10],rax
mov rcx,0x5c80
call 4009a8 <__afl_maybe_log>
mov rax,QWORD PTR [rsp+0x10]
mov rcx,QWORD PTR [rsp+0x8]
mov rdx,QWORD PTR [rsp]
lea rsp,[rsp+0x98]
Implementation – pe-afl
• Do the similar thing statically
14
coverage
bitmap
instrumented
Implementation – pe-afl
• Expand code and update jump
• short jump to long jump
15
jmp loc_123
loc_456:
…
[Instrumented code]
…
jmp loc_456
loc_123:
+ size of instrumented code
- size of instrumented code
Implementation – pe-afl
• Duplicate executable section
• Some DATA still remains on the original section
• Append .coverage for coverage bitmap
• Update
• PE header
• section table
• export table
• SEH handle table
• relocation table
16
HEADER
.text
.data
PAGE
INIT
.reloc
HEADER
.text
.data
PAGE
INIT
.text2
PAGE2
INIT2
.coverage
.reloc
Before instrument
After instrument
Implementation – pe-afl
• All the static information is from IDA pro
• basic block
• branch
• target address
• op code
• operand
• stack frame
• …
17
Implementation – pe-afl
• Reason to collect stack frame information
18
Before stack frame poisoning
After stack frame poisoning
Implementation – pe-afl
19
• Oops
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Take care of DATA in executable section
• 2-byte alignment for unicode string argument in WIN32 API
• 4-byte alignment for SEHandlerTable
20
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Assume DATA as CODE, DATA may be corrupted
eg. CreateFile(“ABC”) -> CreateFile(“[instrumented code]ABC”)
• Assume CODE as DATA, coverage is missed or the execution may fail
eg. jmp [old loc] -> jmp [old loc]
21
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Assume DATA as CODE, DATA may be corrupted
• Assume CODE as DATA, the execution may fail
22
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Public symbol can solve
23
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Public symbol can solve, otherwise …
• IDA pro is improving
24
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Public symbol can solve, otherwise …
• IDA pro is improving, otherwise …
• Assume DATA as CODE, DATA may be corrupted
• Instrument before branch instead of basic block
• Validate the branch, otherwise alert it
• Assume CODE as DATA, the execution may fail
• Look for valid branch in suspicious data
• Filter with known data type and alert it
25
Challenge for SBI
• The mix of DATA and CODE in executable section is the source of
problems
• Confuse between DATA and CODE
• Workaround
26
Instrumenting mspaint.exe without PDB
Implementation – pe-afl
• Fuzz on user-mode
27
kernel
user
test_wrapper.exe
afl-fuzz.exe
afl_shm_XXX afl_shm_XXX
mapped
target.dll
.coverage
pipe
Implementation – pe-afl
• Fuzz on kernel-mode
28
kernel
user
target.sys
.coverage
test_wrapper.exe
.coverage
mapped
afl-fuzz.exe
afl_shm_XXX afl_shm_XXX
mapped
helper.sys
pipe
Implementation – pe-afl
• Type of instrument on fuzzing
• PID filtering
• multi-thread
different afl_prev_loc for each thread
• inline-mode in assembly vs. callback-mode in C
29
Benchmark
• Test on gdiplus.dll
• Win10, 1 vm, 4GB ram, i7-7600, 1 core
• WINAFL states that “This approach has been found to introduce an
overhead about 2x compared to the native execution speed”
30
pe-afl
(w/o instrument)
522 exec/s
pe-afl 508 exec/s
winafl
(edge mode)
236 exec/s
Demo
31
Case study (1)
• CLFS
• First try on kernel driver
• Well-known attack vector
• Btw, it was sandboxed
• Parsing un-document BLF binary format in kernel
• Entry point
CreateTransactionManager(“input.blf”)
• Patch checksum
• 2 weeks, 8 vms
• 2 CVE + won’t fix case
• CVE-2018-0844, pool overflow
• CVE-2018-0846, UAF
32
Case study (2)
• CNG
• Entry point
IOCTL
• Applicable on any kind of IOCTL fuzzing
• Coverage is stuck at the beginning
• Try to figure out the root cause
33
Case study (2)
• CNG
• Entry point
IOCTL
• Applicable on any kind of IOCTL fuzzing
• Coverage is stuck at the beginning
• Benefit from SBI, it is easy to dump execution trace
34
Import into
lighthouse
Case study (2)
• CNG
• Entry point
IOCTL
• Applicable on any kind of IOCTL fuzzing
• Coverage is stuck at the beginning
• Benefit from SBI, it is easy to dump execution trace
• It needs valid object
eg. CreateEvent()
• It needs magic header
eg. 0x1a2b3c4d
• 1 week, 8 vms
• 1 CVE
• CVE-2018-8207, pool OOB read
35
Case study (3)
• Registry Hive
• Parsing un-document registry hive format in ntoskrnl.exe
• Entry point
RegLoadAppKey(“input.dat”)
• Have to instrument around 7MB ntoskrnl.exe
• Support and use partial instrument here
36
Case study (3)
• Registry Hive
• Parsing un-document registry hive format in ntoskrnl.exe
• Entry point
RegLoadAppKey(“input.dat”)
• Have to instrument around 7MB ntoskrnl.exe
• Support and use partial instrument here
RE = ’_?Cm|_Hv[^il]’
• No CVE
• Global state in registry brings the non-deterministic on fuzzing
37
Case study (3) – post story
• Full instrumentation on ntoskrnl.exe
• Everything works except one
• Self-modifying branch 
38
Case study (3) – post story
• Full instrumentation on ntoskrnl.exe
• Everything works except one
• Self-modifying branch 
• Detectable
• Skip with partial instrumentation
• Workaround
39
Conclusion
• Show the possibility and limitation of SBI on PE file and fuzzing
• Not so reliable and elegant, but it works and high performance
• Benefit from SBI
• Not only feedback code coverage, but also data, stack depth …
• Not only for fuzzing, but also for bug detection, tracing …
• Open source
• https://github.com/wmliang/pe-afl
40
Thanks
• Thanks
• AFL, WINAFL
• Lays, Steward Fu, Serena Lin
• Bluehat IL conference team
• Contact
• https://twitter.com/_wmliang_
• lucas_leong@trendmicro.com
41

More Related Content

PDF
DeathNote of Microsoft Windows Kernel
PPTX
[CB16] DeathNote of Microsoft Windows Kernel by Peter Hlavaty & Jin Long
PPTX
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
PDF
Modern Kernel Pool Exploitation: Attacks and Techniques
PDF
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
PDF
Windows 10 Nt Heap Exploitation (English version)
PPT
Reliable Windows Heap Exploits
PPTX
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
DeathNote of Microsoft Windows Kernel
[CB16] DeathNote of Microsoft Windows Kernel by Peter Hlavaty & Jin Long
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
Modern Kernel Pool Exploitation: Attacks and Techniques
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
Windows 10 Nt Heap Exploitation (English version)
Reliable Windows Heap Exploits
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes

What's hot (20)

PDF
Block Drivers
PDF
Play with FILE Structure - Yet Another Binary Exploit Technique
PDF
Windows 10 Nt Heap Exploitation (Chinese version)
PDF
PDF
Monitoring Kafka without instrumentation using eBPF with Antón Rodríguez | Ka...
PPTX
HTTP/2 Introduction
PDF
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
PDF
Linux fundamental - Chap 15 Job Scheduling
PDF
Linux Binary Exploitation - Return-oritend Programing
PPTX
VMs All the Way Down (BSides Delaware 2016)
PDF
Hive tuning
PPTX
Practical Windows Kernel Exploitation
PPTX
CoAP Talk
PDF
CDC Stream Processing with Apache Flink
PDF
Architecture Of The Linux Kernel
PDF
CNIT 126 6: Recognizing C Code Constructs in Assembly
PDF
syzkaller: the next gen kernel fuzzer
PDF
Binary exploitation - AIS3
PDF
SyScan 2015 - iOS 678 Security - A Study in Fail
PPTX
Beneath the Linux Interrupt handling
Block Drivers
Play with FILE Structure - Yet Another Binary Exploit Technique
Windows 10 Nt Heap Exploitation (Chinese version)
Monitoring Kafka without instrumentation using eBPF with Antón Rodríguez | Ka...
HTTP/2 Introduction
Real-time Data Ingestion from Kafka to ClickHouse with Deterministic Re-tries...
Linux fundamental - Chap 15 Job Scheduling
Linux Binary Exploitation - Return-oritend Programing
VMs All the Way Down (BSides Delaware 2016)
Hive tuning
Practical Windows Kernel Exploitation
CoAP Talk
CDC Stream Processing with Apache Flink
Architecture Of The Linux Kernel
CNIT 126 6: Recognizing C Code Constructs in Assembly
syzkaller: the next gen kernel fuzzer
Binary exploitation - AIS3
SyScan 2015 - iOS 678 Security - A Study in Fail
Beneath the Linux Interrupt handling
Ad

Similar to Make static instrumentation great again, High performance fuzzing for Windows system (20)

ODP
Groovy In the Cloud
PDF
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
PDF
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
PDF
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
PPTX
Performance Benchmarking: Tips, Tricks, and Lessons Learned
PDF
Introduction to DevOps
PDF
Non equilibrium Molecular Simulations of Polymers under Flow Saving Energy th...
PPTX
HotSpotコトハジメ
PDF
What to expect from Java 9
PDF
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
PPTX
HDFS Erasure Coding in Action
PDF
RISC V in Spacer
PDF
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
PPT
Coverage Solutions on Emulators
PDF
What’s eating python performance
PDF
Sista: Improving Cog’s JIT performance
PPTX
Security research over Windows #defcon china
PDF
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
PDF
SDAccel Design Contest: Vivado HLS
PPTX
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Groovy In the Cloud
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Introduction to DevOps
Non equilibrium Molecular Simulations of Polymers under Flow Saving Energy th...
HotSpotコトハジメ
What to expect from Java 9
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
HDFS Erasure Coding in Action
RISC V in Spacer
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Coverage Solutions on Emulators
What’s eating python performance
Sista: Improving Cog’s JIT performance
Security research over Windows #defcon china
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
SDAccel Design Contest: Vivado HLS
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Ad

Recently uploaded (20)

PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
web development for engineering and engineering
PDF
Digital Logic Computer Design lecture notes
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Construction Project Organization Group 2.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
PPT on Performance Review to get promotions
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Sustainable Sites - Green Building Construction
DOCX
573137875-Attendance-Management-System-original
PPT
Project quality management in manufacturing
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
CYBER-CRIMES AND SECURITY A guide to understanding
Lecture Notes Electrical Wiring System Components
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mechanical Engineering MATERIALS Selection
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
web development for engineering and engineering
Digital Logic Computer Design lecture notes
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Construction Project Organization Group 2.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPT on Performance Review to get promotions
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
R24 SURVEYING LAB MANUAL for civil enggi
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
Project quality management in manufacturing
Foundation to blockchain - A guide to Blockchain Tech
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...

Make static instrumentation great again, High performance fuzzing for Windows system

  • 1. Make static instrumentation great again High performance fuzzing for Windows system Lucas Leong (@_wmliang_) 1
  • 2. #whoami • Security researcher from Trend Micro • Interested in • vulnerability discovery • binary exploitation • reverse engineering • symbolic execution • MSRC TOP 100 • HITCON CTF team 2
  • 3. Agenda • Motivation • Related works • AFL 101 • Implementation • Benchmark • Demo • Case study CLFS, CNG, Registry • Conclusion 3
  • 4. Motivation • 2014 Nov, AFL is released • I want to fuzz windows target 4
  • 5. Motivation • 2014 Nov, AFL is released • I want to fuzz windows target • 2016 Jul, WinAFL is committed • I want a better performance, support kernel 5
  • 6. Motivation • 2014 Nov, AFL is released • I want to fuzz windows target • 2016 Jul, WinAFL is committed • I want a better performance, support kernel • 2017 Jul, Static binary instrumentation via syzygy is merged • I don’t have full PDB • And I want more, scale up, etc 6
  • 8. Related works – static • WinAFL • Use dynamic binary instrumentation via DynamoRIO • Support static binary instrumentation via syzygy • Require full PDB 8
  • 9. Related works – dynamic • DARKO • Static analysis via Capstone • Dynamic binary rewriting via Keystone • Cross platforms and architectures • KFUZZ • Focus on windows kernel driver • Dynamic binary rewriting • Use interrupt instead of hook to solve the tiny basic block problem 9
  • 10. Related works – hardware • winafl-intelpt • Use the built-in Intel PT driver (ipt.sys) in RS5 • kAFL • Combine QEMU/KVM and Intel PT • Scale-up and cross platform fuzzing • Filter with vCPU/Supervisor/CR3/IP-Range 10
  • 11. Related works – virtualization • applepie • Combine Bochs and WHVP API • Get code coverage at the hypervisor level • Restore snapshot with the modified pages only 11
  • 12. AFL 101 12 initialize mutate input choose input from queue new coverage ? crash ? run targetsave in queue save Yes No Yes No
  • 13. AFL 101 • Instrument each basic block on compile-time (afl-gcc) • Record code coverage on execution-time (afl-fuzz) 13 instrumented lea rsp,[rsp-0x98] mov QWORD PTR [rsp],rdx mov QWORD PTR [rsp+0x8],rcx mov QWORD PTR [rsp+0x10],rax mov rcx,0x5c80 call 4009a8 <__afl_maybe_log> mov rax,QWORD PTR [rsp+0x10] mov rcx,QWORD PTR [rsp+0x8] mov rdx,QWORD PTR [rsp] lea rsp,[rsp+0x98]
  • 14. Implementation – pe-afl • Do the similar thing statically 14 coverage bitmap instrumented
  • 15. Implementation – pe-afl • Expand code and update jump • short jump to long jump 15 jmp loc_123 loc_456: … [Instrumented code] … jmp loc_456 loc_123: + size of instrumented code - size of instrumented code
  • 16. Implementation – pe-afl • Duplicate executable section • Some DATA still remains on the original section • Append .coverage for coverage bitmap • Update • PE header • section table • export table • SEH handle table • relocation table 16 HEADER .text .data PAGE INIT .reloc HEADER .text .data PAGE INIT .text2 PAGE2 INIT2 .coverage .reloc Before instrument After instrument
  • 17. Implementation – pe-afl • All the static information is from IDA pro • basic block • branch • target address • op code • operand • stack frame • … 17
  • 18. Implementation – pe-afl • Reason to collect stack frame information 18 Before stack frame poisoning After stack frame poisoning
  • 20. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Take care of DATA in executable section • 2-byte alignment for unicode string argument in WIN32 API • 4-byte alignment for SEHandlerTable 20
  • 21. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Assume DATA as CODE, DATA may be corrupted eg. CreateFile(“ABC”) -> CreateFile(“[instrumented code]ABC”) • Assume CODE as DATA, coverage is missed or the execution may fail eg. jmp [old loc] -> jmp [old loc] 21
  • 22. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Assume DATA as CODE, DATA may be corrupted • Assume CODE as DATA, the execution may fail 22
  • 23. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Public symbol can solve 23
  • 24. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Public symbol can solve, otherwise … • IDA pro is improving 24
  • 25. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Public symbol can solve, otherwise … • IDA pro is improving, otherwise … • Assume DATA as CODE, DATA may be corrupted • Instrument before branch instead of basic block • Validate the branch, otherwise alert it • Assume CODE as DATA, the execution may fail • Look for valid branch in suspicious data • Filter with known data type and alert it 25
  • 26. Challenge for SBI • The mix of DATA and CODE in executable section is the source of problems • Confuse between DATA and CODE • Workaround 26 Instrumenting mspaint.exe without PDB
  • 27. Implementation – pe-afl • Fuzz on user-mode 27 kernel user test_wrapper.exe afl-fuzz.exe afl_shm_XXX afl_shm_XXX mapped target.dll .coverage pipe
  • 28. Implementation – pe-afl • Fuzz on kernel-mode 28 kernel user target.sys .coverage test_wrapper.exe .coverage mapped afl-fuzz.exe afl_shm_XXX afl_shm_XXX mapped helper.sys pipe
  • 29. Implementation – pe-afl • Type of instrument on fuzzing • PID filtering • multi-thread different afl_prev_loc for each thread • inline-mode in assembly vs. callback-mode in C 29
  • 30. Benchmark • Test on gdiplus.dll • Win10, 1 vm, 4GB ram, i7-7600, 1 core • WINAFL states that “This approach has been found to introduce an overhead about 2x compared to the native execution speed” 30 pe-afl (w/o instrument) 522 exec/s pe-afl 508 exec/s winafl (edge mode) 236 exec/s
  • 32. Case study (1) • CLFS • First try on kernel driver • Well-known attack vector • Btw, it was sandboxed • Parsing un-document BLF binary format in kernel • Entry point CreateTransactionManager(“input.blf”) • Patch checksum • 2 weeks, 8 vms • 2 CVE + won’t fix case • CVE-2018-0844, pool overflow • CVE-2018-0846, UAF 32
  • 33. Case study (2) • CNG • Entry point IOCTL • Applicable on any kind of IOCTL fuzzing • Coverage is stuck at the beginning • Try to figure out the root cause 33
  • 34. Case study (2) • CNG • Entry point IOCTL • Applicable on any kind of IOCTL fuzzing • Coverage is stuck at the beginning • Benefit from SBI, it is easy to dump execution trace 34 Import into lighthouse
  • 35. Case study (2) • CNG • Entry point IOCTL • Applicable on any kind of IOCTL fuzzing • Coverage is stuck at the beginning • Benefit from SBI, it is easy to dump execution trace • It needs valid object eg. CreateEvent() • It needs magic header eg. 0x1a2b3c4d • 1 week, 8 vms • 1 CVE • CVE-2018-8207, pool OOB read 35
  • 36. Case study (3) • Registry Hive • Parsing un-document registry hive format in ntoskrnl.exe • Entry point RegLoadAppKey(“input.dat”) • Have to instrument around 7MB ntoskrnl.exe • Support and use partial instrument here 36
  • 37. Case study (3) • Registry Hive • Parsing un-document registry hive format in ntoskrnl.exe • Entry point RegLoadAppKey(“input.dat”) • Have to instrument around 7MB ntoskrnl.exe • Support and use partial instrument here RE = ’_?Cm|_Hv[^il]’ • No CVE • Global state in registry brings the non-deterministic on fuzzing 37
  • 38. Case study (3) – post story • Full instrumentation on ntoskrnl.exe • Everything works except one • Self-modifying branch  38
  • 39. Case study (3) – post story • Full instrumentation on ntoskrnl.exe • Everything works except one • Self-modifying branch  • Detectable • Skip with partial instrumentation • Workaround 39
  • 40. Conclusion • Show the possibility and limitation of SBI on PE file and fuzzing • Not so reliable and elegant, but it works and high performance • Benefit from SBI • Not only feedback code coverage, but also data, stack depth … • Not only for fuzzing, but also for bug detection, tracing … • Open source • https://github.com/wmliang/pe-afl 40
  • 41. Thanks • Thanks • AFL, WINAFL • Lays, Steward Fu, Serena Lin • Bluehat IL conference team • Contact • https://twitter.com/_wmliang_ • lucas_leong@trendmicro.com 41