Resilient Filesystem
Total Page:16
File Type:pdf, Size:1020Kb
Resilient Filesystem Henry Georges Information Security Submission date: May 2018 Supervisor: Stefan Axelsson, IIK Co-supervisor: Rune Nordvik, Politihøgskolen Norwegian University of Science and Technology Department of Information Security and Communication Technology ReFS Henry Georges 22-05-2018 Master’s Thesis Master of Science in Information Security 30 ECTS Department of Computer Science and Media Technology Norwegian University of Science and Technology, 2018 Supervisor 1: Professor Stefan Axelsson, NTNU Supervisor 2: Assistant Professor Rune Nordvik, PHS ReFS Acknowledgement I would like to thank my supervisor, Assistant Professor Rune Nordvik, for his patience and engagement. H.G. i ReFS Abstract MICROSOFT developed a new file system, REFS. This Resilient FileSystem is in- tended to replace NTFS, hence the importance and usage of REFS should in- crease over the next few years. Although we have been able to use REFS since the presence of WINDOWS SERVER 2012 and WINDOWS 8, there is almost no documentation on this file system available, especially not from MICROSOFT. The aim of this master thesis is: to examine the structure of REFS; to enhance the knowledge about this file system and how it works; to examine how MICROSOFT designed the file system to improve data-integrity. Because of the missing documentation and the lack of support of REFS by the main forensic tools, reverse engineering was the method of choice and utilized for the examination of prepared REFS partitions. The results of this master thesis will help other forensicators to verify the results provided by other, usually commercial, tools, or, in the case that the tools do not provide the needed functions, to do these jobs manually. This master thesis will describe the experimental setup and the way of reverse engineering. Furthermore it will provide the results in a detailed way, supple- mented by tables for a quick access to the results. To round of the master thesis, it will also provide a self coded python tool, which can be used for analyzing a REFS a partition, at least with REFS version number v1.2. This code was used within the analysis as a proof of concept for the results. Thereby my python tool, described in pull-outs within this master thesis, is the only open source tool, which is able to handle REFS. Because of comparing my results with the output of ENCASE, the only commercial tool I found, which was able to handle REFS, I was able to find faulty outputs from ENCASE, what is also a proof, that this work is necessary. ii ReFS Contents Acknowledgement ............................... i Abstract ..................................... ii Contents .................................... iii List of Figures ................................. v List of Tables .................................. vii Listings ..................................... viii 1 Introduction ................................ 1 1.1 Target Group.............................2 1.2 The Significance of Open Source Knowledge in Forensics.....2 1.3 ReFS - Reverse Engineering of a File System............3 1.4 Overall Problem............................7 1.5 Research Questions..........................9 1.6 Limitations.............................. 12 1.7 Master Thesis Outline........................ 14 2 Background ................................ 16 2.1 Literature Research.......................... 16 2.1.1 Building the next generation file system for Windows: ReFS 16 2.1.2 The Microsoft ReFS On-Disk Layout............. 18 2.1.3 Verifying the properties of ReFS............... 18 2.1.4 Open Source Digital Forensic Tools............. 20 2.1.5 Specialization Project.................... 23 2.2 File System.............................. 24 2.3 B-Tree................................. 25 2.4 Encase................................. 27 2.5 File System Recognition Structure.................. 27 2.6 Reverse Engineering......................... 28 3 Methodology ................................ 29 3.1 Research Design........................... 29 3.2 Testing Environment......................... 30 3.3 Proof of Concept........................... 31 4 Results ................................... 33 4.1 VBR.................................. 33 4.2 $Tree_Control and System Files................... 34 4.2.1 Objects............................ 35 4.2.2 Allocation........................... 36 4.2.3 Attributes........................... 41 iii ReFS 4.3 EntryBlock............................... 41 4.3.1 Starting Area......................... 41 4.3.2 Record Area.......................... 44 5 Discussion ................................. 47 6 Conclusions ................................ 50 6.1 Research Questions.......................... 50 6.2 Future Work.............................. 52 Bibliography .................................. 54 A Appendix .................................. 58 A.1 Preparation.............................. 58 A.1.1 HDD.............................. 58 A.1.2 Preparation Machine..................... 58 A.1.3 Examination Machine.................... 59 A.1.4 Other Hardware / Software................. 59 A.2 Detailed Results............................ 60 A.2.1 VBR.............................. 60 A.2.2 $Tree_Control......................... 61 A.2.3 Second Node......................... 63 A.2.4 FNA.............................. 66 A.2.5 $Recycle.bin......................... 74 A.3 Coding................................. 79 A.3.1 Basics............................. 79 A.3.2 Vbr............................... 80 A.3.3 Tree-Control......................... 82 A.3.4 Analysis of the extracted information............ 90 A.4 Templates............................... 94 A.4.1 VBR.............................. 94 A.4.2 $Tree_Control......................... 94 A.4.3 $Object_Tree......................... 95 A.4.4 $Allocator_Lrg, $Allocator_Med, $Allocator_Sml..... 96 A.4.5 $Object............................ 96 A.4.6 EntryBlock.......................... 97 A.4.7 Directory Metadata Record (0x10000000)......... 98 A.4.8 FileNameAttribute File (0x30000100)........... 98 A.4.9 FileNameAttribute Folder (0x30000200).......... 99 A.4.10 MetaDataAttribute...................... 99 A.4.11 DataRunAttribute....................... 100 A.4.12 Child Attribute (0x20000080)................ 101 iv ReFS List of Figures 1 Structure of the Master Thesis.................... 15 2 Graphic construction of REFS.................... 16 3 Graphic abstraction of B-TREE-structure.............. 17 4 Schematic representation of a B-TREE[1].............. 25 5 Hex-dump from a VBR ........................ 33 6 Schematic layout of a REFS partition................ 34 7 $TREE_CONTROL ........................... 34 8 Dump from record area of the $OBJECT_TREE ........... 35 9 Dump from the record area of the $OBJECT ............ 36 10 Dump from the record area of the $ALLOCATOR_LRG ....... 36 11 How does allocation work...................... 39 12 Interaction between the $ALLOCATOR files............. 41 13 Starting of an ENTRYBLOCK ..................... 42 14 Visualization for the usage of extents................ 43 15 Record Area of an ENTRYBLOCK ................... 44 16 Timestamps.............................. 45 17 Flags-scheme, no flags........................ 46 18 Flags-scheme, hidden flag...................... 46 19 Flags-scheme, ead only flag..................... 46 20 Flags-scheme, archive flag...................... 46 21 VBR .................................. 60 22 $TREE_CONTROL ........................... 61 23 ENTRYBLOCK 0x19E, second node.................. 63 24 ENTRYBLOCK 0x19D, second node.................. 63 25 ENTRYBLOCK 0x19C, second node.................. 64 26 FNA of sys.info............................ 64 27 Output from the $fsuti l....................... 65 28 ENTRYBLOCK-DESCRIPTOR 0x19C.................. 65 29 ENTRYBLOCK-DESCRIPTOR 0x19D.................. 65 30 ENTRYBLOCK-DESCRIPTOR 0x19E.................. 66 31 ENTRYBLOCK-DESCRIPTOR 0x19F.................. 66 32 FILENAME-attribute HUGE-FILE, part 1............... 66 33 FILENAME-attribute,HUGE-FILE, part 2............... 68 34 FILENAME-attribute HUGE-FILE, part 3............... 70 35 FileNameAttribute - Folder, screenshot ENCASE .......... 74 36 FileNameAttribute - Folder, dump from ENTRYBLOCK 0x190... 74 v ReFS 37 NODE 0X703, deleted file...................... 75 38 $RECYCLE.BIN, records 4 and 5................... 76 39 $RECYCLE.BIN, Record 5, DATARUN-ATTRIBUTE .......... 76 40 $RECYCLE.BIN, filename of deleted file............... 77 41 $RECYCLE.BIN, record 7....................... 77 42 $RECYCLE.BIN, record 6....................... 78 43 $RECYCLE.BIN, record 6 DATARUN-ATTRIBUTE ........... 78 44 $RECYCLE.BIN, original records of deleted file........... 78 45 Screenshot from the Main Menu of my tool............ 80 46 Screenshot from the Fsstat of my tool................ 90 47 Screenshot from the visualized directory structure......... 91 48 Screenshot from the list of current files............... 91 49 Screenshot from file details..................... 92 50 Screenshot from the $RECYCLE.BIN ................. 92 51 Screenshot from file details (deleted files)............. 93 vi ReFS List of Tables 1 REFS capacitive parameters [2]................... 20 2 Breakdown of the $ALLOCATOR_LRG ................ 37 3 Flags.................................. 46 4 VBR .................................. 60 5 Breakdown 2nd extent $TREE_CONTROL .............. 62 6 Breakdown of the ENTRYBLOCK-Descriptor............. 66 7 Breakdown for FILENAME-attribute................. 67 8 Breakdown for METADATA-attribute................