Ice Age melting down: Intel features considered usefull!

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
1 of 64

Recommended

Hacking - high school intro by
Hacking - high school introHacking - high school intro
Hacking - high school introPeter Hlavaty
1.3K views31 slides
Attack on the Core by
Attack on the CoreAttack on the Core
Attack on the CorePeter Hlavaty
12.3K views52 slides
Rainbow Over the Windows: More Colors Than You Could Expect by
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectPeter Hlavaty
5.7K views52 slides
When is something overflowing by
When is something overflowingWhen is something overflowing
When is something overflowingPeter Hlavaty
6.3K views37 slides
You didnt see it’s coming? "Dawn of hardened Windows Kernel" by
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" Peter Hlavaty
9.4K views62 slides
Racing with Droids by
Racing with DroidsRacing with Droids
Racing with DroidsPeter Hlavaty
3.5K views46 slides

More Related Content

What's hot

How Safe is your Link ? by
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?Peter Hlavaty
1.2K views37 slides
Vulnerability desing patterns by
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patternsPeter Hlavaty
4.6K views31 slides
Software Security : From school to reality and back! by
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
1.6K views37 slides
DeathNote of Microsoft Windows Kernel by
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelPeter Hlavaty
9.4K views42 slides
Guardians of your CODE by
Guardians of your CODEGuardians of your CODE
Guardians of your CODEPeter Hlavaty
3.4K views41 slides
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes by
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 bytesPeter Hlavaty
31.1K views50 slides

What's hot(20)

How Safe is your Link ? by Peter Hlavaty
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
Peter Hlavaty1.2K views
Vulnerability desing patterns by Peter Hlavaty
Vulnerability desing patternsVulnerability desing patterns
Vulnerability desing patterns
Peter Hlavaty4.6K views
Software Security : From school to reality and back! by 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!
Peter Hlavaty1.6K views
DeathNote of Microsoft Windows Kernel by Peter Hlavaty
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
Peter Hlavaty9.4K views
Guardians of your CODE by Peter Hlavaty
Guardians of your CODEGuardians of your CODE
Guardians of your CODE
Peter Hlavaty3.4K views
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes by Peter Hlavaty
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 Hlavaty31.1K views
One Shellcode to Rule Them All: Cross-Platform Exploitation by Quinn Wilton
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 Wilton5.2K views
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal) by Shota Shinogi
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 Shinogi2.7K views
Process injection - Malware style by Sander Demeester
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester9.4K views
BSides Hannover 2015 - Shell on Wheels by infodox
BSides Hannover 2015 - Shell on WheelsBSides Hannover 2015 - Shell on Wheels
BSides Hannover 2015 - Shell on Wheels
infodox2.4K views
Software to the slaughter by Quinn Wilton
Software to the slaughterSoftware to the slaughter
Software to the slaughter
Quinn Wilton1K views
50 Shades of Fuzzing by Peter Hlavaty & Marco Grassi by Shakacon
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
Shakacon1.6K views
Defcon 22-paul-mcmillan-attacking-the-iot-using-timing-attac by Priyanka Aash
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 Aash3.2K views
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013 by midnite_runr
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_runr8.7K views
How to Root 10 Million Phones with One Exploit by Jiahong Fang
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 Fang14.6K views
Steelcon 2015 - 0wning the internet of trash by infodox
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
infodox2.3K views
Us 16-subverting apple-graphics_practical_approaches_to_remotely_gaining_root... by Liang Chen
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 Chen2.5K views
Practical Windows Kernel Exploitation by zeroSteiner
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
zeroSteiner2K views

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

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core by
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 CoreNoSuchCon
844 views52 slides
Introduction to multicore .ppt by
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .pptRajagopal Nagarajan
1.1K views52 slides
Metasploit & Windows Kernel Exploitation by
Metasploit & Windows Kernel ExploitationMetasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel ExploitationzeroSteiner
4.3K views37 slides
High-Performance Computing with C++ by
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++JetBrains
1.8K views33 slides
SMP implementation for OpenBSD/sgi by
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgiTakuya ASADA
1.2K views62 slides
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for... by
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
892 views44 slides

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

NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core by NoSuchCon
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
NoSuchCon844 views
Metasploit & Windows Kernel Exploitation by zeroSteiner
Metasploit & Windows Kernel ExploitationMetasploit & Windows Kernel Exploitation
Metasploit & Windows Kernel Exploitation
zeroSteiner4.3K views
High-Performance Computing with C++ by JetBrains
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
JetBrains1.8K views
SMP implementation for OpenBSD/sgi by Takuya ASADA
SMP implementation for OpenBSD/sgiSMP implementation for OpenBSD/sgi
SMP implementation for OpenBSD/sgi
Takuya ASADA1.2K views
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for... by Alexandre Moneger
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 Moneger892 views
EuroMPI 2013 presentation: McMPI by Dan Holmes
EuroMPI 2013 presentation: McMPIEuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPI
Dan Holmes624 views
Security research over Windows #defcon china by Peter Hlavaty
Security research over Windows #defcon chinaSecurity research over Windows #defcon china
Security research over Windows #defcon china
Peter Hlavaty375 views
Pune-Cocoa: Blocks and GCD by Prashant Rane
Pune-Cocoa: Blocks and GCDPune-Cocoa: Blocks and GCD
Pune-Cocoa: Blocks and GCD
Prashant Rane1.3K views
NBTC#2 - Why instrumentation is cooler then ice by Alexandre Moneger
NBTC#2 - Why instrumentation is cooler then iceNBTC#2 - Why instrumentation is cooler then ice
NBTC#2 - Why instrumentation is cooler then ice
Alexandre Moneger375 views
DConf2015 - Using D for Development of Large Scale Primary Storage by Liran Zvibel
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 Zvibel1.3K views
Rust Programming Language by Jaeju Kim
Rust Programming LanguageRust Programming Language
Rust Programming Language
Jaeju Kim8.5K views
Игорь Фесенко "Direction of C# as a High-Performance Language" by Fwdays
Игорь Фесенко "Direction of C# as a High-Performance Language"Игорь Фесенко "Direction of C# as a High-Performance Language"
Игорь Фесенко "Direction of C# as a High-Performance Language"
Fwdays1.1K views
Project Basecamp: News From Camp 4 by Digital Bond
Project Basecamp: News From Camp 4Project Basecamp: News From Camp 4
Project Basecamp: News From Camp 4
Digital Bond779 views
Vulnerability, exploit to metasploit by Tiago Henriques
Vulnerability, exploit to metasploitVulnerability, exploit to metasploit
Vulnerability, exploit to metasploit
Tiago Henriques2.6K views
Advanced SOHO Router Exploitation XCON by Lyon Yang
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
Lyon Yang2.2K views
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017 by OpenEBS
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
OpenEBS541 views

Recently uploaded

Unit 1_Lecture 2_Physical Design of IoT.pdf by
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdfStephenTec
15 views36 slides
STPI OctaNE CoE Brochure.pdf by
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
14 views1 slide
SUPPLIER SOURCING.pptx by
SUPPLIER SOURCING.pptxSUPPLIER SOURCING.pptx
SUPPLIER SOURCING.pptxangelicacueva6
20 views1 slide
Special_edition_innovator_2023.pdf by
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
18 views6 slides
MVP and prioritization.pdf by
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
37 views8 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
317 views86 slides

Recently uploaded(20)

Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec15 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software317 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana17 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab23 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays33 views
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn26 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays17 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely29 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc72 views

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!