Mac OS X Forensics Joaquin Moreno Garijo
Total Page:16
File Type:pdf, Size:1020Kb
Mac OS X Forensics Joaquin Moreno Garijo Technical Report RHUL–MA–2015–8 4 March 2015 Information Security Group Royal Holloway University of London Egham, Surrey, TW20 0EX United Kingdom www.ma.rhul.ac.uk/tech Student Number: 100780122 Name: Joaquin, Moreno Garijo Mac OS X Forensics Supervisor: Dr. Lorenzo Cavallaro Submitted as part of the requirements for the award of the MSc in Information Security at Royal Holloway, University of London I declare that this assignment is all my own work and that I have acknowledged all quotations from the published or unpublished works of other people. I declare that I have also read the statements on plagiarism in Section 1 of the Regulations Governing Examination and Assessment Offences and in accordance with it I submit this project report as my own work. Signature: Date: Academic Year 2013/2014 Copyright c 2013/2014 by Joaquin Moreno Garijo Abstract Mac OS X Forensics by Joaquin Moreno Garijo Master of Science in Information Security Royal Holloway, University of London 2013/2014 During the past few years, the number of incidents related with Mac OS X environ- ment have increased, especially those related to malware. Due to this new tendency, incident response teams and computer forensics investigators require new tools, proce- dures and documentation to understand how to properly handle the incidents over this platform. However, the research undertaken till now is not enough to deal with these new threats. For this reason, the research community has started to work on volatile evi- dences, live system evidences and malware reversing approaches. However, the research done over persistent evidences has almost been non-existent, in particular the evidences created by Mac OS X itself. Hence, this dissertation focuses on Mac OS X persistent evidences, identifying the evidences, how these evidences are stored and how this information can be obtained. Furthermore, the project provides an implementation that extracts the information stored by Mac OS X using a well-known forensics framework called Plaso extending the tool and allowing for the work done in the dissertation to be used by the computer forensics community at large. iii iv Acknowledgement This thesis would have not been possible without Kristinn Gudjonsson. Thank you. I want to thank Lorenzo Cavallaro to gave me freedom during the project to take decision related with the implementation and the goals of the project. Lastly, I would like to thank to Plaso team that provided this incredible framework where on top of it, I developed the Mac OS X plugins extending the tool functionalities. v vi Contents 1 Introduction1 1.1 Aims and Objectives............................1 1.2 Implementation and Availability......................2 1.3 Structure of Report............................3 2 Digital Forensics Background5 2.1 Forensics Methodology...........................5 2.2 Volatile Evidences.............................8 2.3 Malware..................................9 2.4 Persistent Evidences............................ 11 3 Plaso 13 3.1 Introduction to Plaso........................... 13 3.2 Working with Plaso............................ 14 3.2.1 Evidence acquisition........................ 14 3.2.2 Executing Plaso.......................... 15 3.3 Implementation process.......................... 18 4 Mac OS X 23 4.1 Mac OS X Design............................. 23 4.2 Timestamp................................. 24 4.3 Hierarchical File System Plus (HFS+)................... 27 vii 4.4 Bundle Layout............................... 28 4.5 File Vault.................................. 28 4.6 Evidence Types............................... 29 5 Mac OS X No Time Valuable 33 5.1 System basic configuration......................... 33 5.2 User accounts............................... 35 5.3 Autologin.................................. 36 5.4 Recent Files................................ 37 5.5 Kernel, Extensions, Swap and Hibernation File.............. 40 5.6 Booting and persistence.......................... 41 6 Mac OS X Timestamp Evidences 45 6.1 Apple System Log (ASL)......................... 45 6.1.1 Apple System Log Binary File................... 46 6.1.2 Apple System Log plaintext format................ 51 6.2 Basic Security Module (BSM)....................... 54 6.3 UTMPX File................................ 59 6.4 Configuration Files: Property List..................... 61 6.4.1 Time Machine........................... 61 6.4.2 Bluetooth............................. 62 6.4.3 Mac OS X Updates........................ 62 6.4.4 Airport Stored Wifi........................ 63 6.4.5 Spotlight Searched Terms and Volume.............. 63 6.4.6 Apple User Account........................ 64 6.4.7 System User Account....................... 64 6.4.8 Installation History......................... 65 6.4.9 Finder Sidebar........................... 65 6.5 Newsyslog plaintext logs.......................... 66 6.6 CUPS IPP control files........................... 68 6.7 Document Versions............................ 71 6.8 Keychains................................. 72 7 Case of study 77 viii 8 Conclusion 83 A Independent Parsers 87 B Plaso implementation 89 C Basic Security Module Tokens 93 Bibliography 105 ix x List of Figures 2.1 FSEventer screenshot from the Dockster.A [71].............. 10 3.1 Pinfo over Mac OS X image with Careto malware executed........ 16 3.2 Example of 4n6Time tool obtained form Dav Nads blog.......... 17 3.3 Kibana interface from Mac OS X image.................. 18 3.4 Plaso 1.1 released on 6th of June...................... 21 4.1 Mac OS X structure............................ 24 4.2 Mac OS X Timestamp........................... 26 4.3 Decrypting a partition using Libfvde library................ 29 4.4 Mac OS X Evidences............................ 31 5.1 User information extracted from mac password.py............. 36 5.2 Dave tool recovering a Mac OS X 10.9 password.............. 36 5.3 Bookmark Plist attribute.......................... 38 5.4 Bookmark hexadecimal Plist attribute................... 39 6.1 Generic ASL File structure......................... 47 6.2 ASL Entry structure in deep........................ 48 6.3 ASL Hexadecimal file example....................... 49 6.4 BSM Entry structure............................ 55 6.5 BSM hexadecimal raw entry......................... 56 6.6 Real UTMPX Mac OS X structure.................... 60 xi 6.7 Hexadecimal explanation of alias attribute................. 66 6.8 Extracting mounted devices extracted using alias.py script......... 67 6.9 Diagram CUPS IPP control file....................... 69 6.10 Hexadecimal CUPS IPP control file..................... 70 6.11 Keychain database structure........................ 74 6.12 Keychain header and schema hexadecimal structure............ 74 6.13 Keychain table header hexadecimal structure................ 75 6.14 Keychain record structure.......................... 75 6.15 Keychain application record hexadecimal structure............. 76 7.1 Virtual machine running Mac OS X 10.9.................. 78 xii List of Tables 3.1 Plaso review process............................. 20 3.2 Property List Plaso implementation..................... 20 6.1 ASL priority levels.............................. 45 6.2 BSM implemented token structures..................... 58 6.3 UTMPX structure.............................. 59 6.4 Most valuable CUPS attributes....................... 70 7.1 Mac OS X Malware used.......................... 78 A.1 Independent parsers............................. 87 B.1 Plaso ASL implementation......................... 89 B.2 Plaso CUPS IPP implementation...................... 89 B.3 Plaso BSM implementation......................... 90 B.4 Plaso Appfirewall.log implementation.................... 90 B.5 Plaso document versions implementation.................. 90 B.6 Plaso Keychain implementation....................... 90 B.7 Plaso securityd.log implementation..................... 90 B.8 Plaso wifi.log implementation........................ 91 B.9 Plaso BSD single line implementation................... 91 B.10 Plaso Mac OS X UTMPX implementation................. 91 B.11 Plaso Property list Mac OS X implementation............... 92 xiii C.1 BSM Token Header 32........................... 93 C.2 BSM Token Header 64........................... 93 C.3 BSM Token Header 32 Extended...................... 94 C.4 BSM Token Text.............................. 94 C.5 BSM Token Path.............................. 94 C.6 BSM Token Return 32........................... 94 C.7 BSM Token Return 64........................... 94 C.8 BSM Token Trailer............................. 95 C.9 BSM Token Argument 32.......................... 95 C.10 BSM Token Argument 64.......................... 95 C.11 BSM Token Subject 32........................... 95 C.12 BSM Token Subject 32 extended...................... 96 C.13 BSM Token Subject 64........................... 96 C.14 BSM Token Subject 64 extended...................... 97 C.15 BSM Token opaque (au to opaque).................... 97 C.16 BSM Token Sequence (au to seq)..................... 97 C.17 BSM Token Address (au to in addr).................... 97 C.18 BSM Token Address Extended (au to in addr ext)............. 98 C.19 BSM Token IP (au to ip).......................... 98 C.20 BSM Token IPC (au to ipc)........................ 98 C.21 BSM Token Port (au to iport)....................... 99 C.22 BSM Token File (au to file)......................... 99 C.23 BSM Token Process 32 (au to process32)................. 99 C.24 BSM Token Process