Nytro Posted August 5, 2012 Report Posted August 5, 2012 Windows 8 Heap InternalsContentsIntroduction .................................................................................................................................................. 4Overview ....................................................................................................................................................... 4Prior Works ................................................................................................................................................... 5Prerequisites ................................................................................................................................................. 5User Land .................................................................................................................................................. 5Kernel Land ............................................................................................................................................... 5Terminology .................................................................................................................................................. 6User Land Heap Manager ............................................................................................................................. 7Data Structures ......................................................................................................................................... 7_HEAP (HeapBase) ................................................................................................................................ 7_LFH_HEAP (Heap?>FrontEndHeap) ..................................................................................................... 8_HEAP_LOCAL_DATA (Heap?>FrontEndHeap?>LocalData) ................................................................... 9_HEAP_LOCAL_SEGMENT_INFO (Heap?>LFH?>SegmentInfoArrays[] / AffinitizedInfoArrays[]) .......... 9_HEAP_SUBSEGMENT (Heap?>LFH?>InfoArrays[]?>ActiveSubsegment) ............................................ 10_HEAP_USERDATA_HEADER (Heap?>LFH?>InfoArrays[]?>ActiveSubsegment?>UserBlocks) ............. 11_RTL_BITMAP (Heap?>LFH?>InfoArrays[]?>ActiveSubsegment?>UserBlocks?>Bitmap) ..................... 12_HEAP_ENTRY ..................................................................................................................................... 12Architecture ............................................................................................................................................ 13Algorithms ?? Allocation .......................................................................................................................... 15Intermediate ....................................................................................................................................... 15BackEnd ............................................................................................................................................... 18Front End ............................................................................................................................................. 25Algorithms – Freeing ............................................................................................................................... 37Intermediate ....................................................................................................................................... 37BackEnd ............................................................................................................................................... 40FrontEnd .............................................................................................................................................. 44Security Mechanisms .............................................................................................................................. 47_HEAP Handle Protection ................................................................................................................... 47Virtual Memory Randomization .......................................................................................................... 48FrontEnd Activation ............................................................................................................................ 49FrontEnd Allocation ............................................................................................................................ 50Fast Fail ............................................................................................................................................... 52Guard Pages ........................................................................................................................................ 53Arbitrary Free ...................................................................................................................................... 56Exception Handling ............................................................................................................................. 57Exploitation Tactics ................................................................................................................................. 58Bitmap Flipping 2.0 ............................................................................................................................. 58_HEAP_USERDATA_HEADER Attack .................................................................................................... 60User Land Conclusion .............................................................................................................................. 62Kernel Pool Allocator .................................................................................................................................. 63Fundamentals ......................................................................................................................................... 63Pool Types ........................................................................................................................................... 63Pool Descriptor ................................................................................................................................... 63Pool Header ......................................................................................................................................... 64Windows 8 Enhancements ..................................................................................................................... 66Non?Executable (NX) Non?Paged Pool ................................................................................................ 66Kernel Pool Cookie .............................................................................................................................. 69Attack Mitigations ................................................................................................................................... 75Process Pointer Encoding .................................................................................................................... 75Lookaside Cookie ................................................................................................................................ 76Cache Aligned Allocation Cookie ........................................................................................................ 77Safe (Un)linking ................................................................................................................................... 78PoolIndex Validation ........................................................................................................................... 79Summary ............................................................................................................................................. 80Block Size Attacks .................................................................................................................................... 82Block Size Attack ................................................................................................................................. 82Split Fragment Attack .......................................................................................................................... 83Kernel Land Conclusion ........................................................................................................................... 85Thanks ......................................................................................................................................................... 85Bibliography ................................................................................................................................................ 86Download:http://t.co/uOgkjkj4 Quote