SlideShare a Scribd company logo
DeathNote of
Microsoft Windows Kernel
windows kernel internals
$whoami
• @zer0mem
• Windows kernel research at
KeenLab, Tencent
• pwn2own winner (2015 / 2016),
pwnie nominee (2015)
• fuzzing focus : state
• wushu player
Daniel
• @long123king
• Windows kernel research at
KeenLab, Tencent
• pwn2own winner (2016)
• fuzzing focus : data 'format'
• windbg guy
Peter
agenda
sandbox
ntoskrnl
extension
clfs
internals
Sandbox
• limiting attack surface
• potantional landscape for bugs
• available methods for abusing it
• ACL vs access to various kernel objects
• non ntos, non w32k drivers
• various ntos objects
• w32k filtering
• depends on sandboxed app needs
• w32k lockdown
Sandbox targets
mutex
memory
thread PE
section
pipe ...
... plus ?
• Nt*Transaction*
• Nt*Enlistment*
• Nt*Manager*
what ?
• Kernel Transaction Manager
• Purpose
• The Kernel Transaction Manager (KTM) enables the
development of applications that use transactions. The
transaction engine itself is within the kernel, but transactions
can be developed for kernel- or user-mode transactions, and
within a single host or among distributed hosts.
• The KTM is used to implement Transactional NTFS (TxF) and
Transactional Registry (TxR). TxF allows transacted file system
operations within the NTFS file system. TxR allows transacted
registry operations. KTM enables client applications to
coordinate file system and registry operations with a
transaction.
tm.sys
• simple object state
• few syscalls available
• not much code involved
• however interestingly interconnected
• Results :
• 1 nullptr deref
• 1 exploitable vulnerability
tm indirection
• tm.sys simple
purpose driver
• but interesting
module involved
at backend
• CLFS.sys
CLFS.sys
• Purpose
• The Common Log File System (CLFS) API provides a high-performance,
general-purpose log file subsystem that dedicated client applications
can use and multiple clients can share to optimize log access.
• Any user-mode application that needs logging or recovery support can
use CLFS.
• Where applicable
• You can use CLFS for data and event management and to develop
server and enterprise applications.
• For data management, you can use CLFS with the following:
• Database systems
• Messaging, such as store-and-forward systems
• Online transactional processing (OLTP) systems
• Other kinds of transactional systems
CLFS.sys
• well integrated to transactions and more!
• c++ code base
• serve fair attack surface
• ... but not at appcontainer or untrusted level ...
• or does it ?
NtCreateTransactionManager
• depends on CLFS
• use CLFS for its checkpoints
• therefore implies :
• Opens CLFS
• *PARSE* CLFS
• interact with CLFS
• lets try it out!
CLFS - data fuzzing I.
• i am not fan of data fuzzing in kernel
• as i am strongly against data parsing at kernel at all :)
• lets do quick probe, that i am ok with :
• mutate randomly file
• results = 0
• cool for me, i am not much interested anyway
• get back to original idea!
CLFS - state fuzzing
• approach 1.
• RE clfs.sys
• go to ioctl
• .. ah too lazy to do that from scratch ...
• approach 2.
• go trough msdn docs
• understand how those api works
• callstack necessary to suceed to call one or another api
• implement that logic to Qilin (our internal fuzzer)
• mess with logic in Qilin little bit
bugz++
• after first dry run of fuzzer in 15 min first crashes
• ... wtf
• but ddos only
• eliminate that
• another bugz apear
• now time to rethink .. data fuzzing really so bad
idea afterall ?
CLFS - data fuzzing II.
• RE where & how are data parsed
• EntryPoint : ClfsCreateLogFile
• ouch ... magic .. dummy fuzz proof
• I. crc
• II. rellocation required
CLFS - lets fuzz more seriously
• too lazy to re-implement existing code, but is it
even necesary ?
CLFS - lets fuzz more seriously
• too lazy to implement crc &
rellocations
CLFS { state, dummy, enhanced }
Data Enhanced fuzz
27% ++
Data Dummy Fuzz
40%
State Fuzz
33%
CLFS FUZZING STRATEGIES => RESULTS
CLFS internals
... under the hood ...
BLF (Base Log File) Format
Record Header
Control Record
Base Log Record
Container Record
Symbol Header
Client Context
Container Context
CClfsBaseFilePersisted::ReadImage
Record Parameter
CClfsBaseFile::GetBaseLogRecord
CClfsBaseFile::GetBaseLogRecord(CClfsBaseFile* this)
xor eax, eax
cmp ax, [rcx+28h]
jz short locret_1C00335DB
mov rcx, [rcx+30h]
mov rcx, [rcx+30h]
test rcx, rcx
jz short locret_1C00335DB
mov eax, [rcx+28h]
add rax, rcx
locret_1C00335DB:
retn
CClfsBaseFile::AcquireMetadataBlock
Use of AcquireMetadataBlock
CClfsBaseFilePersisted::OpenImage
Symbol Hash Function
__int64 ClfsHashPJW(const struct _UNICODE_STRING *a1)
{
unsigned int v1 = 0, v4 = 0, v6;
PWSTR wchar_buffer = a1->Buffer;
const struct _UNICODE_STRING *v3 = a1;
if ( a1->Length & 0xFFFE ){
do{
int v5 = 0x10 * v1 + RtlUpcaseUnicodeChar(*wchar_buffer);
v6 = v5 & 0xF0000000;
if ( v5 & 0xF0000000 )
v5 ^= v6 >> 0x18;
v1 = v6 ^ v5;
++wchar_buffer;
++v4;
}
while ( v4 < (unsigned int)v3->Length >> 1 );
}
return v1;
}
Enhanced CLFS format fuzzing
• If you know the target well enough, you can fuzz it
well.
• Since now, we know:
• BLF file format
• Control Record
• Base Log Record
• Symbol Header
• Client Context
• Container Context
• Container Record
• Clfs.sys has its own logic to parse these formats, is
it robust enough?
Enhanced CLFS format fuzzing
Select
Deserialize
Mutate
Inmune
Serialize
push
Enhanced CLFS format fuzzing
class CControlRecord : public CFormatBase<CControlRecord>
{
……
virtual bool serialize(ostream & out) const override;
virtual bool deserialize(istream & in) override;
virtual bool mutate() override;
……
};
class CBaseLogRecord : public CFormatBase<CBaseLogRecord>
{
……
virtual bool serialize(ostream & out) const override;
virtual bool deserialize(istream & in) override;
virtual bool mutate() override;
……
};
……
Enhanced CLFS format fuzzing
bool CCLFSFormat::deserialize(istream & in)
{
……
m_controlRecord.deserialize(in);
m_controlRecordShadow.deserialize(in);
m_baseLogRecord.deserialize(in);
m_baseLogRecordShadow.deserialize(in);
m_truncateRecord.deserialize(in);
m_truncateRecordShadow.deserialize(in);
……
}
bool CCLFSFormat::mutate(istream & in)
{ …… }
bool CCLFSFormat::serialize(istream & in)
{ …… }
Enhanced CLFS format fuzzing
CCLFSDocument::CCLFSDocument(const string filename)
:m_template_filename(filename)
,m_template_stream(filename, ios::in | ios::binary)
{
/* number: 0 */m_engine.registerFilter(make_unique<CCommonErrorBypass>());
/* number: 1 */m_engine.registerFilter(make_unique<CPOC_XXX_1>());
/* number: 2 */m_engine.registerFilter(make_unique<CPOC_XXX_2>());
/* number: 3 */m_engine.registerFilter(make_unique<CPOC_XXX_3>());
/* number: 4 */m_engine.registerFilter(make_unique<CPOC_XXX_4>());
/* number: 5 */m_engine.registerFilter(make_unique<CPOC_XXX_5>());
……
}
void CCLFSDocument::mutate()
{
m_clfs_format.mutate();
m_engine.triggerFilter(3, m_orginal_clfs_format, m_clfs_format);
}
Enhanced CLFS format fuzzing
bool CPOCFilterEngine::triggerFilter(size_t filterIndex,
CCLFSFormat& originalFormat, CCLFSFormat& format)
{
bool b_triggered = false;
for (size_t i = 0; i < m_filters.size(); i++)
{
if (i == filterIndex)
{
m_filters[i]->infect(originalFormat, format);
b_triggered = true;
}
else
m_filters[i]->immune(originalFormat, format);
}
return b_triggered;
}
Q & A
Thank you!

More Related Content

PDF
Windows 10 Nt Heap Exploitation (English version)
PDF
Play with FILE Structure - Yet Another Binary Exploit Technique
PDF
Memory Mapping Implementation (mmap) in Linux Kernel
PDF
Pwning in c++ (basic)
PPT
RFID (Radio Frequency Identification)
PDF
ROP 輕鬆談
PPT
New public management
PDF
Windows 10 Nt Heap Exploitation (Chinese version)
Windows 10 Nt Heap Exploitation (English version)
Play with FILE Structure - Yet Another Binary Exploit Technique
Memory Mapping Implementation (mmap) in Linux Kernel
Pwning in c++ (basic)
RFID (Radio Frequency Identification)
ROP 輕鬆談
New public management
Windows 10 Nt Heap Exploitation (Chinese version)

What's hot (20)

PDF
Modern Kernel Pool Exploitation: Attacks and Techniques
PPTX
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
PDF
Make static instrumentation great again, High performance fuzzing for Windows...
PDF
Linux binary Exploitation - Basic knowledge
PPTX
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
PDF
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
PDF
MacOS memory allocator (libmalloc) Exploitation
PPTX
[CB16] DeathNote of Microsoft Windows Kernel by Peter Hlavaty & Jin Long
PDF
Advanced heap exploitaion
PDF
MacOS memory allocator (libmalloc) Exploitation - Chinese Version
PDF
Sigreturn Oriented Programming
PDF
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
PDF
from Binary to Binary: How Qemu Works
PDF
Heap exploitation
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PDF
Linux Binary Exploitation - Heap Exploitation
PDF
Binary exploitation - AIS3
PDF
Linux Binary Exploitation - Return-oritend Programing
PDF
How fun of privilege escalation Red Pill2017
PPT
Reliable Windows Heap Exploits
Modern Kernel Pool Exploitation: Attacks and Techniques
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Make static instrumentation great again, High performance fuzzing for Windows...
Linux binary Exploitation - Basic knowledge
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
MacOS memory allocator (libmalloc) Exploitation
[CB16] DeathNote of Microsoft Windows Kernel by Peter Hlavaty & Jin Long
Advanced heap exploitaion
MacOS memory allocator (libmalloc) Exploitation - Chinese Version
Sigreturn Oriented Programming
Reverse Engineering and Bug Hunting on KMDF Drivers - Enrique Nissim - 44CON ...
from Binary to Binary: How Qemu Works
Heap exploitation
CNIT 126: 10: Kernel Debugging with WinDbg
Linux Binary Exploitation - Heap Exploitation
Binary exploitation - AIS3
Linux Binary Exploitation - Return-oritend Programing
How fun of privilege escalation Red Pill2017
Reliable Windows Heap Exploits
Ad

Viewers also liked (20)

PDF
When is something overflowing
PDF
Rainbow Over the Windows: More Colors Than You Could Expect
PPTX
Ice Age melting down: Intel features considered usefull!
PPTX
Power of linked list
PPTX
Back to the CORE
PPTX
Attack on the Core
PDF
Moony li pacsec-1.8
PPTX
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
PDF
DbiFuzz framework #ZeroNights E.0x03 slides
PPTX
Racing with Droids
PPTX
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
PPTX
iOS Application Exploitation
PPTX
How2heap
PDF
Designing and Attacking DRM (RSA 2008)
PDF
You're Off the Hook: Blinding Security Software
PDF
Find your own iOS kernel bug
PDF
Attacking the Webkit heap [Or how to write Safari exploits]
PPTX
Software Security : From school to reality and back!
PPTX
How Safe is your Link ?
PDF
Exploit techniques and mitigation
When is something overflowing
Rainbow Over the Windows: More Colors Than You Could Expect
Ice Age melting down: Intel features considered usefull!
Power of linked list
Back to the CORE
Attack on the Core
Moony li pacsec-1.8
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
DbiFuzz framework #ZeroNights E.0x03 slides
Racing with Droids
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
iOS Application Exploitation
How2heap
Designing and Attacking DRM (RSA 2008)
You're Off the Hook: Blinding Security Software
Find your own iOS kernel bug
Attacking the Webkit heap [Or how to write Safari exploits]
Software Security : From school to reality and back!
How Safe is your Link ?
Exploit techniques and mitigation
Ad

Similar to DeathNote of Microsoft Windows Kernel (20)

PPTX
Security research over Windows #defcon china
PDF
Next Generation DevOps in Drupal: DrupalCamp London 2014
PPTX
Metasploit & Windows Kernel Exploitation
PDF
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
PDF
Open Source Cyber Weaponry
PDF
John adams talk cloudy
PPTX
Practical Windows Kernel Exploitation
PDF
PyCon India 2012: Celery Talk
PDF
Powering up on PowerShell - BSides Charleston - Nov 2018
PDF
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
PPTX
Powering up on PowerShell - BSides Greenville 2019
PDF
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
PPTX
44CON 2014 - Meterpreter Internals, OJ Reeves
PDF
Latest (storage IO) patterns for cloud-native applications
PPTX
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
PPTX
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
PDF
Serverless: A love hate relationship
PPTX
Modern application development with oracle cloud sangam17
PPTX
Powering up on power shell avengercon - 2018
PDF
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
Security research over Windows #defcon china
Next Generation DevOps in Drupal: DrupalCamp London 2014
Metasploit & Windows Kernel Exploitation
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
Open Source Cyber Weaponry
John adams talk cloudy
Practical Windows Kernel Exploitation
PyCon India 2012: Celery Talk
Powering up on PowerShell - BSides Charleston - Nov 2018
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Powering up on PowerShell - BSides Greenville 2019
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
44CON 2014 - Meterpreter Internals, OJ Reeves
Latest (storage IO) patterns for cloud-native applications
Braxton McKee, Founder & CEO, Ufora at MLconf SF - 11/13/15
Open Source LinkedIn Analytics Pipeline - BOSS 2016 (VLDB)
Serverless: A love hate relationship
Modern application development with oracle cloud sangam17
Powering up on power shell avengercon - 2018
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Modernizing your data center with Dell and AMD
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Modernizing your data center with Dell and AMD
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

DeathNote of Microsoft Windows Kernel

  • 1. DeathNote of Microsoft Windows Kernel windows kernel internals
  • 2. $whoami • @zer0mem • Windows kernel research at KeenLab, Tencent • pwn2own winner (2015 / 2016), pwnie nominee (2015) • fuzzing focus : state • wushu player Daniel • @long123king • Windows kernel research at KeenLab, Tencent • pwn2own winner (2016) • fuzzing focus : data 'format' • windbg guy Peter
  • 4. Sandbox • limiting attack surface • potantional landscape for bugs • available methods for abusing it • ACL vs access to various kernel objects • non ntos, non w32k drivers • various ntos objects • w32k filtering • depends on sandboxed app needs • w32k lockdown
  • 6. ... plus ? • Nt*Transaction* • Nt*Enlistment* • Nt*Manager*
  • 7. what ? • Kernel Transaction Manager • Purpose • The Kernel Transaction Manager (KTM) enables the development of applications that use transactions. The transaction engine itself is within the kernel, but transactions can be developed for kernel- or user-mode transactions, and within a single host or among distributed hosts. • The KTM is used to implement Transactional NTFS (TxF) and Transactional Registry (TxR). TxF allows transacted file system operations within the NTFS file system. TxR allows transacted registry operations. KTM enables client applications to coordinate file system and registry operations with a transaction.
  • 8. tm.sys • simple object state • few syscalls available • not much code involved • however interestingly interconnected • Results : • 1 nullptr deref • 1 exploitable vulnerability
  • 9. tm indirection • tm.sys simple purpose driver • but interesting module involved at backend • CLFS.sys
  • 10. CLFS.sys • Purpose • The Common Log File System (CLFS) API provides a high-performance, general-purpose log file subsystem that dedicated client applications can use and multiple clients can share to optimize log access. • Any user-mode application that needs logging or recovery support can use CLFS. • Where applicable • You can use CLFS for data and event management and to develop server and enterprise applications. • For data management, you can use CLFS with the following: • Database systems • Messaging, such as store-and-forward systems • Online transactional processing (OLTP) systems • Other kinds of transactional systems
  • 11. CLFS.sys • well integrated to transactions and more! • c++ code base • serve fair attack surface • ... but not at appcontainer or untrusted level ... • or does it ?
  • 12. NtCreateTransactionManager • depends on CLFS • use CLFS for its checkpoints • therefore implies : • Opens CLFS • *PARSE* CLFS • interact with CLFS • lets try it out!
  • 13. CLFS - data fuzzing I. • i am not fan of data fuzzing in kernel • as i am strongly against data parsing at kernel at all :) • lets do quick probe, that i am ok with : • mutate randomly file • results = 0 • cool for me, i am not much interested anyway • get back to original idea!
  • 14. CLFS - state fuzzing • approach 1. • RE clfs.sys • go to ioctl • .. ah too lazy to do that from scratch ... • approach 2. • go trough msdn docs • understand how those api works • callstack necessary to suceed to call one or another api • implement that logic to Qilin (our internal fuzzer) • mess with logic in Qilin little bit
  • 15. bugz++ • after first dry run of fuzzer in 15 min first crashes • ... wtf • but ddos only • eliminate that • another bugz apear • now time to rethink .. data fuzzing really so bad idea afterall ?
  • 16. CLFS - data fuzzing II. • RE where & how are data parsed • EntryPoint : ClfsCreateLogFile • ouch ... magic .. dummy fuzz proof • I. crc • II. rellocation required
  • 17. CLFS - lets fuzz more seriously • too lazy to re-implement existing code, but is it even necesary ?
  • 18. CLFS - lets fuzz more seriously • too lazy to implement crc & rellocations
  • 19. CLFS { state, dummy, enhanced } Data Enhanced fuzz 27% ++ Data Dummy Fuzz 40% State Fuzz 33% CLFS FUZZING STRATEGIES => RESULTS
  • 20. CLFS internals ... under the hood ...
  • 21. BLF (Base Log File) Format
  • 31. CClfsBaseFile::GetBaseLogRecord CClfsBaseFile::GetBaseLogRecord(CClfsBaseFile* this) xor eax, eax cmp ax, [rcx+28h] jz short locret_1C00335DB mov rcx, [rcx+30h] mov rcx, [rcx+30h] test rcx, rcx jz short locret_1C00335DB mov eax, [rcx+28h] add rax, rcx locret_1C00335DB: retn
  • 35. Symbol Hash Function __int64 ClfsHashPJW(const struct _UNICODE_STRING *a1) { unsigned int v1 = 0, v4 = 0, v6; PWSTR wchar_buffer = a1->Buffer; const struct _UNICODE_STRING *v3 = a1; if ( a1->Length & 0xFFFE ){ do{ int v5 = 0x10 * v1 + RtlUpcaseUnicodeChar(*wchar_buffer); v6 = v5 & 0xF0000000; if ( v5 & 0xF0000000 ) v5 ^= v6 >> 0x18; v1 = v6 ^ v5; ++wchar_buffer; ++v4; } while ( v4 < (unsigned int)v3->Length >> 1 ); } return v1; }
  • 36. Enhanced CLFS format fuzzing • If you know the target well enough, you can fuzz it well. • Since now, we know: • BLF file format • Control Record • Base Log Record • Symbol Header • Client Context • Container Context • Container Record • Clfs.sys has its own logic to parse these formats, is it robust enough?
  • 37. Enhanced CLFS format fuzzing Select Deserialize Mutate Inmune Serialize push
  • 38. Enhanced CLFS format fuzzing class CControlRecord : public CFormatBase<CControlRecord> { …… virtual bool serialize(ostream & out) const override; virtual bool deserialize(istream & in) override; virtual bool mutate() override; …… }; class CBaseLogRecord : public CFormatBase<CBaseLogRecord> { …… virtual bool serialize(ostream & out) const override; virtual bool deserialize(istream & in) override; virtual bool mutate() override; …… }; ……
  • 39. Enhanced CLFS format fuzzing bool CCLFSFormat::deserialize(istream & in) { …… m_controlRecord.deserialize(in); m_controlRecordShadow.deserialize(in); m_baseLogRecord.deserialize(in); m_baseLogRecordShadow.deserialize(in); m_truncateRecord.deserialize(in); m_truncateRecordShadow.deserialize(in); …… } bool CCLFSFormat::mutate(istream & in) { …… } bool CCLFSFormat::serialize(istream & in) { …… }
  • 40. Enhanced CLFS format fuzzing CCLFSDocument::CCLFSDocument(const string filename) :m_template_filename(filename) ,m_template_stream(filename, ios::in | ios::binary) { /* number: 0 */m_engine.registerFilter(make_unique<CCommonErrorBypass>()); /* number: 1 */m_engine.registerFilter(make_unique<CPOC_XXX_1>()); /* number: 2 */m_engine.registerFilter(make_unique<CPOC_XXX_2>()); /* number: 3 */m_engine.registerFilter(make_unique<CPOC_XXX_3>()); /* number: 4 */m_engine.registerFilter(make_unique<CPOC_XXX_4>()); /* number: 5 */m_engine.registerFilter(make_unique<CPOC_XXX_5>()); …… } void CCLFSDocument::mutate() { m_clfs_format.mutate(); m_engine.triggerFilter(3, m_orginal_clfs_format, m_clfs_format); }
  • 41. Enhanced CLFS format fuzzing bool CPOCFilterEngine::triggerFilter(size_t filterIndex, CCLFSFormat& originalFormat, CCLFSFormat& format) { bool b_triggered = false; for (size_t i = 0; i < m_filters.size(); i++) { if (i == filterIndex) { m_filters[i]->infect(originalFormat, format); b_triggered = true; } else m_filters[i]->immune(originalFormat, format); } return b_triggered; }
  • 42. Q & A Thank you!