SlideShare a Scribd company logo
Ice Age melting down!
Intel features considered usefull!
whoami
• @zer0mem, Peter Hlavaty
• Lead of Windows kernel security at KeenLab, Tencent
• 2015, 2016 pwn2own winner { team work! }
– 2015 2x TTF
– 2016 Master Of Pwn ( Edge -> SYSTEM )
• Top 100 MSRC ( Ranked 36 at 2016)
• Kernel CVEs and advanced exploitation techniques
• Delivered talks at Recon, SyScan, ZeroNights and others
• Wushu player
agenda
• NX
• ROP
Data vs Code
• CFG
• CET
Code Reuse
• Clang CFI
• RAP-RIP-ROP
integrity
• SIDT/SGDT
• Ring-1
Further
What is this talk about
• Elevation of Privilege
• Kernel code exec
• Software Mitigations
• New Bare metal principles
• Future of software security
At the very begining
Custom data
shipped to
domain in
order to exec
#1 NonExec
• ExAllocatePool(…Nx)
Security awerness++
Custom data
shipped to
domain in
order to exec
Page Tables
• Exec bit on / off
• Accessible from ring0*
• * if no ring-1 in place
ROP
• Reusing of existing code
• Returning/Jumping into different (even
misaligned) instructions
• Chaining those gadgets together
• Reliable control flow achieved
CFG
• Microsoft introduced mitigation
• Bitmap of valid indirect jump locations
• Simple
• Effective
http://blog.trendmicro.com/trendlabs-security-intelligence/exploring-control-flow-guard-in-windows-10/
CFG
• Check before indirect jump/call
http://powerofcommunity.net/poc2014/mj0011.pdf
CFG
• Do not solve ROP itself, just focus on
preventing kicking it off
– fair enough approximation
Use function instead!
• pwn2own 2015
• Function driven attack
• Instead of gadget we use functions
– Use it until we got custom kernel code
exec
p2o 2015
• We got Read/Write primitive
– ReCon , GdiBitmap technique
• Problems
– #1 I dont like ROP and shellcode neither
– #2 RWE page
– #3 custom kernel code trigger
p2o 2015
• NtUserMessageCall
http://www.k33nteam.org/noks.html
p2o 2015
ExAllocatePool
Provide RWE
flags
Leak address
p2o 2015
• Use gdi.Io() to write our kernel mode
driver in place
– cc_shellcode framework with some kernel
mode features
• Need to deal with relocations, and import
resolving
– cc_shellcode framework do it automatically
p2o 2015
• Kernel code exec switch
– gdi.Io() _EPROCESS list walking
– Find stack of our thread
– With gdi.Io() rewrite own stack return
CET - IBT
• At compile time mark source and destination of call
– Indirect call/jmp
– ENDBRXX
• If you jump somewhere what is not marked as destination, boom
• Similar to CFG
– roots better into the code
– this time from bare-metal setting distinctions
• Direct and clean solving of ROP
– Solve ROP comprehensively not just at very beginning!
– Basically shaping architecture forward to secure oriented one
• Does *not* intend to solve integrity!
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf
Code Exec
• anti-ROP is no problem
• No direct page-table altering is no
problem
• Type-hash integrity + stack, ouch…
• EPT ? …
EPT & Code Signing
• Running at ring-1
• No W+X pages at once, no ever
• EPT vs ring0 page tables, shadowing
• Signing check once it tries to exec
• Game over for custom code exec if no
logical bug ?
Control Flow control
• CodeSigning or PageTable lockdown no
problem
– We dont intend to use custom code
• anti-ROP becomes a problem +-
• Type-hash integrity is essential problem
Control Flow Integrity
Another technologies
[not applied at windows kernel]
RAP-RIP-ROP
• Return address protection
• Reserved register for cookie
• Cookie per :
– Task
– Syscall
– Special loops scenarios
https://pax.grsecurity.net/docs/PaXTeam-H2HC15-RAP-RIP-ROP.pdf
RAP-RIP-ROP
stack
• cookie ^ ret
• Kernel.Io() from another thread can be
possibly used to leak & rewrite
– However unread-able kernel stacks can
harden approach
Self-modify
• Limited / jailed kernel-A.Io() to create
better version of kernel-X.Io()
• kernel-X.Io() need :
– Contains loop in which do read/write
– Loop counter should depend on writable
memory
• iovec alikes are good candidates (splice, …)
Self-modify
• kernel-X.Io() modify itself
• Corrupt loop counter
• To create prolonged loop
• Read out own cookie^ret
• Rewrite own cookie^ret
– In another thread resolve and modify
– Readed value in previous step must be accessible somehow
( user mode / kernel.Io() ) to second thread
– Patched value should be available in further read/write
operations of self-looped kernel-X.Io()
Intel - Shadow stack
• Normal instruction can not touch it
directly
• Kernel.Io() is
out of game
Clang
• Forward-Edge CFI
• bit vector for static types
– Read-only
– Per static type
• Compiler + linker
– Depends on LLVM's type metadata
http://www.pcc.me.uk/~peter/acad/usenix14.pdf
Clang
http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html
RAP-RIP-ROP
• Indirect Control Transfer protection
• Type hash for indirect 'calls'
– Return type
– Function name
– Function parameters
RAP-RIP-ROP
Perfect ?
• Still imperfect, however infinite times
better!
• Exponentially raise cost (time) of
exploitation
• Security becoming real deal
Intel – errata
• Some may argue that intel technology is
weak because dont do type-hash etc
• However goal of this is not provide CFI,
but do strict rule how to jump (kill ROP)
• Simple & effective
• CFI need to be handled compiler specific
Bit of c++
• Is this correct ?
• Is it even important ?
• Could it ends up with
control flow control ?
Bit of c++
• Well … yes and no …
– depends on quality of code
• Inheriting vs limiting / extending, etc
– concrete object context
– Must be used with (limited) Kernel.Io()
– Could allows to reach data gadget dispatcher
– … what ?
Data Oriented Prg
• Turing complete
https://www.comp.nus.edu.sg/~shweta24/publications/dop_oakland16.pdf f
Data Oriented Prg
• However type-hash approaches ..
• #1 You have luck to hit vulnerability
reachable at control flow of some
gadget dispatcher
• #2 you need to find type-hash friendly
candidate and prepare for redirection
to it before you proceed to DOP
Bit of objective-C
• This is more powerful to abuse
• some languages are build to be dynamic ..
some of them not
– Therefore harder to protect
OOP problems
• Data – Code mix
– Objective-C
• Hard to impossible
to distinguish
– C++
• Can be distinguished
• Built for dynamic code in mind
Data flow integrity
• DFI – data flow integrity
• Different set of instructions are usually
responsible for some set of data
• Likely to work on same type of data
DFI - implementation
• Static data flow graph at compilation
• Checking per memory access ?
• Costly overhead
• Approximations ?
DFI - approximation
• Limit only to subset of functions
• Limit only to subset of data
• Leaves lot of attack surface
• Approximate more ?
DFI - approximation
• Maybe help of hardware ?
• Special instruction :
– change *accessible range* mem-access instructions
• Default should be current stack
– Whoaa, somehow close to intel's mpx! 
• Fine grained pools & inside isolated heaps alikes
• Compilers + linkers with type scope information
• Data attacks will be solved 一步一步
https://software.intel.com/en-us/blogs/2013/07/22/intel-memory-protection-extensions-
intel-mpx-support-in-the-gnu-toolchain
DFI - approximation
• However .. Based on current (pretty badass)
implementation of DOP and its early results
• Seems to be fair enough to just protect
potential gadget dispatchers
– Numbers are tend to be small
• But this is more like state-of-art, and subsets
of this approach still remains ( kernel.Io()! )
ROP & CodeExec
• Those are results of non - security
thinking (limitations) at the very
beginning
• Seems to be solved
– Unless logic bugs in solutions
– However idea of solutions is pretty solid
Code Reuse & Data attack
• Can we say with all those potential
mitigations (hardware & software) will
be solved ?
Code Reuse & Data attack
• Not likely
• As those exploiting very principles of
current architectures & dynamic code
– Proper protection is hard (but looks like
possible) for built-in dynamic languages
– To what extend is it possible to languages
dynamic by possibility not be design ?
Security
• However … with ongoing research (clang, pax,
intel, ..)
• It will be far more harder to do successful
attack
– in many (many) cases will be even impossible
• Goal of success are however not solely
mitigations, nor bugs killing itself
– Both aspects is important and has its own role
– Final outcome could be very secure environments
Back to the future
Still way to go..
Time to think
• What is SYSTEM / Kernel Code Exec ?
• Why we do need it ?
• How is it used ?
• What is real goal we want to achieve ?
DATA
DATA
• DATA are all what matters
• Code is just group of targeted
instructions to work over those data
• You want read / write to data
• SYSTEM / kernel code exec did it for
you in easy way
Kernel.Io()
• We have it from the time being
• Kernel.Io() is subset of DOP implementation
• We used it for making shortcuts
• Once you can read / write to targeted domain
you won
– no need to direct control flow control
Kernel.Io()
• Kernel.Io()
– Vulnerability
• Considering mem-corruption here
– Technique
• Leaking domain addresses
• Reliable re-use multiple times
• Deep domain knowledge
• Code quality++
Kernel.Io()
Kernel.Io()
• with Kernel.Io() you can :
– do any mathematic operation on arbitrary
data
– emulate known 'api'
• With no protection of stack-return it is pretty
cheap
security
• SIDT / SGDT
• CR4.UMIP (documented at revision 58)
• Solves (trap to block) :
– Leaks for user mode
– Virtualization leak issue
Security [WINDOWS]
• gdi info leakage
locked
Security [WINDOWS]
• w32k lockdown
– dont touch what you dont need
• ntos restricted access
– Low attack surface
– Code quality good
Conclusions
• Hardware setting security boundaries
at possibility level
• Software continues to tackling
attackers techniques to the edge
• Vulnerabilities space is shrinking
– Notable by security research from china
Way to go
• Technologies benefits one from
another, making software more secure!
…
Thank you!
Q & A

More Related Content

What's hot

How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
Peter Hlavaty
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
Peter Hlavaty
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
Peter Hlavaty
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
Peter Hlavaty
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
Peter Hlavaty
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Peter Hlavaty
 
Memory Corruption: from sandbox to SMM
Memory Corruption: from sandbox to SMMMemory Corruption: from sandbox to SMM
Memory Corruption: from sandbox to SMM
Positive Hack Days
 
Packers
PackersPackers
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
Quinn Wilton
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Shota Shinogi
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester
 
BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheels
infodox
 
Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughter
Quinn Wilton
 
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
Shakacon
 
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attacDefcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Priyanka Aash
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
midnite_runr
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One Exploit
Jiahong Fang
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
infodox
 
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Liang Chen
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
zeroSteiner
 

What's hot (20)

How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
Vulnerability desing patterns
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
Guardians of your CODE
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
 
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytesWindows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
 
Memory Corruption: from sandbox to SMM
Memory Corruption: from sandbox to SMMMemory Corruption: from sandbox to SMM
Memory Corruption: from sandbox to SMM
 
Packers
PackersPackers
Packers
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform ExploitationOne Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
 
BSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheels
 
Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughter
 
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi
 
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attacDefcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac
 
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One Exploit
 
Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root...
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
 

Similar to Ice Age melting down: Intel features considered usefull!

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NoSuchCon
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
Rajagopal Nagarajan
 
Metasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel ExploitationMetasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel Exploitation
zeroSteiner
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
JetBrains
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
Takuya ASADA
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Alexandre Moneger
 
EuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPIEuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPI
Dan Holmes
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
Peter Hlavaty
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
Prashant Rane
 
Embedded system - embedded system programming
Embedded system - embedded system programmingEmbedded system - embedded system programming
Embedded system - embedded system programming
Vibrant Technologies & Computers
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryption
bigendiansmalls
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
Dominik Seifert
 
NBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then iceNBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then ice
Alexandre Moneger
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary Storage
Liran Zvibel
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming Language
Jaeju Kim
 
Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
Fwdays
 
Project Basecamp: News From Camp 4
Project Basecamp: News From Camp 4Project Basecamp: News From Camp 4
Project Basecamp: News From Camp 4
Digital Bond
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
Tiago Henriques
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
Lyon Yang
 
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
OpenEBS
 

Similar to Ice Age melting down: Intel features considered usefull! (20)

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
 
Metasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel ExploitationMetasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel Exploitation
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
 
SMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
 
EuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPIEuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPI
 
Security research over Windows #defcon china
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
 
Pune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
 
Embedded system - embedded system programming
Embedded system - embedded system programmingEmbedded system - embedded system programming
Embedded system - embedded system programming
 
Share winter 2016 encryption
Share winter 2016 encryptionShare winter 2016 encryption
Share winter 2016 encryption
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
 
NBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then iceNBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then ice
 
DConf2015 - Using D for Development of Large Scale Primary Storage
DConf2015 - Using D for Development  of Large Scale Primary StorageDConf2015 - Using D for Development  of Large Scale Primary Storage
DConf2015 - Using D for Development of Large Scale Primary Storage
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming Language
 
Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
 
Project Basecamp: News From Camp 4
Project Basecamp: News From Camp 4Project Basecamp: News From Camp 4
Project Basecamp: News From Camp 4
 
Vulnerability, exploit to metasploit
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
 

Recently uploaded

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 

Recently uploaded (20)

Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 

Ice Age melting down: Intel features considered usefull!

  • 1. Ice Age melting down! Intel features considered usefull!
  • 2. whoami • @zer0mem, Peter Hlavaty • Lead of Windows kernel security at KeenLab, Tencent • 2015, 2016 pwn2own winner { team work! } – 2015 2x TTF – 2016 Master Of Pwn ( Edge -> SYSTEM ) • Top 100 MSRC ( Ranked 36 at 2016) • Kernel CVEs and advanced exploitation techniques • Delivered talks at Recon, SyScan, ZeroNights and others • Wushu player
  • 3. agenda • NX • ROP Data vs Code • CFG • CET Code Reuse • Clang CFI • RAP-RIP-ROP integrity • SIDT/SGDT • Ring-1 Further
  • 4. What is this talk about • Elevation of Privilege • Kernel code exec • Software Mitigations • New Bare metal principles • Future of software security
  • 5. At the very begining Custom data shipped to domain in order to exec
  • 7. Security awerness++ Custom data shipped to domain in order to exec
  • 8. Page Tables • Exec bit on / off • Accessible from ring0* • * if no ring-1 in place
  • 9. ROP • Reusing of existing code • Returning/Jumping into different (even misaligned) instructions • Chaining those gadgets together • Reliable control flow achieved
  • 10. CFG • Microsoft introduced mitigation • Bitmap of valid indirect jump locations • Simple • Effective http://blog.trendmicro.com/trendlabs-security-intelligence/exploring-control-flow-guard-in-windows-10/
  • 11. CFG • Check before indirect jump/call http://powerofcommunity.net/poc2014/mj0011.pdf
  • 12. CFG • Do not solve ROP itself, just focus on preventing kicking it off – fair enough approximation
  • 13. Use function instead! • pwn2own 2015 • Function driven attack • Instead of gadget we use functions – Use it until we got custom kernel code exec
  • 14. p2o 2015 • We got Read/Write primitive – ReCon , GdiBitmap technique • Problems – #1 I dont like ROP and shellcode neither – #2 RWE page – #3 custom kernel code trigger
  • 17. p2o 2015 • Use gdi.Io() to write our kernel mode driver in place – cc_shellcode framework with some kernel mode features • Need to deal with relocations, and import resolving – cc_shellcode framework do it automatically
  • 18. p2o 2015 • Kernel code exec switch – gdi.Io() _EPROCESS list walking – Find stack of our thread – With gdi.Io() rewrite own stack return
  • 19. CET - IBT • At compile time mark source and destination of call – Indirect call/jmp – ENDBRXX • If you jump somewhere what is not marked as destination, boom • Similar to CFG – roots better into the code – this time from bare-metal setting distinctions • Direct and clean solving of ROP – Solve ROP comprehensively not just at very beginning! – Basically shaping architecture forward to secure oriented one • Does *not* intend to solve integrity! https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf
  • 20. Code Exec • anti-ROP is no problem • No direct page-table altering is no problem • Type-hash integrity + stack, ouch… • EPT ? …
  • 21. EPT & Code Signing • Running at ring-1 • No W+X pages at once, no ever • EPT vs ring0 page tables, shadowing • Signing check once it tries to exec • Game over for custom code exec if no logical bug ?
  • 22. Control Flow control • CodeSigning or PageTable lockdown no problem – We dont intend to use custom code • anti-ROP becomes a problem +- • Type-hash integrity is essential problem
  • 23. Control Flow Integrity Another technologies [not applied at windows kernel]
  • 24. RAP-RIP-ROP • Return address protection • Reserved register for cookie • Cookie per : – Task – Syscall – Special loops scenarios https://pax.grsecurity.net/docs/PaXTeam-H2HC15-RAP-RIP-ROP.pdf
  • 26. stack • cookie ^ ret • Kernel.Io() from another thread can be possibly used to leak & rewrite – However unread-able kernel stacks can harden approach
  • 27. Self-modify • Limited / jailed kernel-A.Io() to create better version of kernel-X.Io() • kernel-X.Io() need : – Contains loop in which do read/write – Loop counter should depend on writable memory • iovec alikes are good candidates (splice, …)
  • 28. Self-modify • kernel-X.Io() modify itself • Corrupt loop counter • To create prolonged loop • Read out own cookie^ret • Rewrite own cookie^ret – In another thread resolve and modify – Readed value in previous step must be accessible somehow ( user mode / kernel.Io() ) to second thread – Patched value should be available in further read/write operations of self-looped kernel-X.Io()
  • 29. Intel - Shadow stack • Normal instruction can not touch it directly • Kernel.Io() is out of game
  • 30. Clang • Forward-Edge CFI • bit vector for static types – Read-only – Per static type • Compiler + linker – Depends on LLVM's type metadata http://www.pcc.me.uk/~peter/acad/usenix14.pdf
  • 32. RAP-RIP-ROP • Indirect Control Transfer protection • Type hash for indirect 'calls' – Return type – Function name – Function parameters
  • 34. Perfect ? • Still imperfect, however infinite times better! • Exponentially raise cost (time) of exploitation • Security becoming real deal
  • 35. Intel – errata • Some may argue that intel technology is weak because dont do type-hash etc • However goal of this is not provide CFI, but do strict rule how to jump (kill ROP) • Simple & effective • CFI need to be handled compiler specific
  • 36. Bit of c++ • Is this correct ? • Is it even important ? • Could it ends up with control flow control ?
  • 37. Bit of c++ • Well … yes and no … – depends on quality of code • Inheriting vs limiting / extending, etc – concrete object context – Must be used with (limited) Kernel.Io() – Could allows to reach data gadget dispatcher – … what ?
  • 38. Data Oriented Prg • Turing complete https://www.comp.nus.edu.sg/~shweta24/publications/dop_oakland16.pdf f
  • 39. Data Oriented Prg • However type-hash approaches .. • #1 You have luck to hit vulnerability reachable at control flow of some gadget dispatcher • #2 you need to find type-hash friendly candidate and prepare for redirection to it before you proceed to DOP
  • 40. Bit of objective-C • This is more powerful to abuse • some languages are build to be dynamic .. some of them not – Therefore harder to protect
  • 41. OOP problems • Data – Code mix – Objective-C • Hard to impossible to distinguish – C++ • Can be distinguished • Built for dynamic code in mind
  • 42. Data flow integrity • DFI – data flow integrity • Different set of instructions are usually responsible for some set of data • Likely to work on same type of data
  • 43. DFI - implementation • Static data flow graph at compilation • Checking per memory access ? • Costly overhead • Approximations ?
  • 44. DFI - approximation • Limit only to subset of functions • Limit only to subset of data • Leaves lot of attack surface • Approximate more ?
  • 45. DFI - approximation • Maybe help of hardware ? • Special instruction : – change *accessible range* mem-access instructions • Default should be current stack – Whoaa, somehow close to intel's mpx!  • Fine grained pools & inside isolated heaps alikes • Compilers + linkers with type scope information • Data attacks will be solved 一步一步 https://software.intel.com/en-us/blogs/2013/07/22/intel-memory-protection-extensions- intel-mpx-support-in-the-gnu-toolchain
  • 46. DFI - approximation • However .. Based on current (pretty badass) implementation of DOP and its early results • Seems to be fair enough to just protect potential gadget dispatchers – Numbers are tend to be small • But this is more like state-of-art, and subsets of this approach still remains ( kernel.Io()! )
  • 47. ROP & CodeExec • Those are results of non - security thinking (limitations) at the very beginning • Seems to be solved – Unless logic bugs in solutions – However idea of solutions is pretty solid
  • 48. Code Reuse & Data attack • Can we say with all those potential mitigations (hardware & software) will be solved ?
  • 49. Code Reuse & Data attack • Not likely • As those exploiting very principles of current architectures & dynamic code – Proper protection is hard (but looks like possible) for built-in dynamic languages – To what extend is it possible to languages dynamic by possibility not be design ?
  • 50. Security • However … with ongoing research (clang, pax, intel, ..) • It will be far more harder to do successful attack – in many (many) cases will be even impossible • Goal of success are however not solely mitigations, nor bugs killing itself – Both aspects is important and has its own role – Final outcome could be very secure environments
  • 51. Back to the future Still way to go..
  • 52. Time to think • What is SYSTEM / Kernel Code Exec ? • Why we do need it ? • How is it used ? • What is real goal we want to achieve ?
  • 53. DATA
  • 54. DATA • DATA are all what matters • Code is just group of targeted instructions to work over those data • You want read / write to data • SYSTEM / kernel code exec did it for you in easy way
  • 55. Kernel.Io() • We have it from the time being • Kernel.Io() is subset of DOP implementation • We used it for making shortcuts • Once you can read / write to targeted domain you won – no need to direct control flow control
  • 56. Kernel.Io() • Kernel.Io() – Vulnerability • Considering mem-corruption here – Technique • Leaking domain addresses • Reliable re-use multiple times • Deep domain knowledge • Code quality++
  • 58. Kernel.Io() • with Kernel.Io() you can : – do any mathematic operation on arbitrary data – emulate known 'api' • With no protection of stack-return it is pretty cheap
  • 59. security • SIDT / SGDT • CR4.UMIP (documented at revision 58) • Solves (trap to block) : – Leaks for user mode – Virtualization leak issue
  • 60. Security [WINDOWS] • gdi info leakage locked
  • 61. Security [WINDOWS] • w32k lockdown – dont touch what you dont need • ntos restricted access – Low attack surface – Code quality good
  • 62. Conclusions • Hardware setting security boundaries at possibility level • Software continues to tackling attackers techniques to the edge • Vulnerabilities space is shrinking – Notable by security research from china
  • 63. Way to go • Technologies benefits one from another, making software more secure!