An Analysis of Accidentally Tampered Master File Table

Are you looking for English version for this article? Click here!

ในระบบ File System แบบ NTFS จะมีไฟล์ที่เรียกว่า $MFT หรือ Master File Table ซึ่งเป็นที่รวบรวมข้อมูลของไฟล์ทั้งหมดในไดร์ฟนั้นๆ แม้แต่ไฟล์ที่ถูกลบไปแล้ว ซึ่งในวันนี้ทีม Intelligent Response จาก บริษัทไอ-ซีเคียว จำกัด จะมาเล่าข้อมูลที่น่าสนใจเกี่ยวกับ $MFT ในด้าน Digital Forensic กันค่ะ

ข้อมูลที่น่าสนใจเกี่ยวกับ $MFT ในด้าน digital forensic

MFT หรือ Master File Table เป็นไฟล์ในระบบไฟล์แบบ NTFS โดยจะรวบรวมข้อมูลของไฟล์ทั้งหมดในไดร์ฟนั้นๆ แม้แต่ไฟล์ที่ถูกลบไปแล้ว การตรวจสอบไฟล์ $MFT จึงมีประโยชน์อย่างมากในช่วยค้นหาไฟล์ที่ถูกลบเพื่อทำการกู้คืนและการใช้วิเคราะห์ในฐานะของหลักฐานดิจิตอลรูปแบบหนึ่ง

โดยปกติไฟล์ $MFT จะถูกสร้างขึ้นโดยอัตโนมัติเมื่อมีการฟอร์แมตหรือเปลี่ยนพาร์ติชันของดิสก์เป็น NTFS โดยวันที่และเวลาที่ไฟล์ $MFT ถูกสร้างขึ้น (หรือวันที่และเวลาที่ดิสก์ถูกฟอร์แมต) จะถูกระบุอยู่ในคุณลักษณะของไฟล์ $MFT ที่หัวข้อ Date created ซึ่งในกรณีโดยส่วนใหญ่ที่ดิสก์ดังกล่าวถูกติดตั้งระบบปฏิบัติการ ไฟล์ของระบบปฏิบัติการจะมีวันที่และเวลาที่ถูกสร้างใกล้เคียงหรือสอดคล้องกับค่า Date created ใน $MFT ตามรูปภาพด้านล่าง

ในขณะที่เราทำการวิเคราะห์หลักฐานดิจิตอลเพื่อค้นหาที่มาและข้อมูลที่เกี่ยวข้องกับภัยคุกคาม เราพบซอฟต์แวร์และโปรแกรมบางประเภท อาทิ ซอฟต์แวร์คงสภาพฮาร์ดดิสก์ เช่น Deep Freeze, ซอฟต์แวร์ปรับแต่งการทำงานของระบบ เช่น CCleaner อาจมีการเข้าไปแก้ไขไฟล์ $MFT และส่งผลให้ค่า Date created เปลี่ยนไปเมื่อเปรียบเทียบกับค่าของวันที่และเวลาจากไฟล์อื่นๆ ที่มักจะถูกสร้างขึ้นมาในเวลาที่ใกล้เคียงหรือสอดคล้องกัน พฤติกรรมนี้สามารถช่วยบ่งชี้ถึงพฤติกรรมที่น่าสงสัยหรือความสมบูรณ์ของข้อมูลที่ได้จากไฟล์ $MFT ได้

ความสมบูรณ์และถูกต้องของไฟล์ $MFT ยังสามารถถูกทำลายได้ในบางกรณี เช่น การใช้โปรแกรมกู้คืนไฟล์โดยทำการกู้คืนไฟล์ที่ถูกลบมายังไดร์ฟเดิม เนื่องจากการแก้ไขและการเขียนทับรายการภายในไฟล์ $MFT ที่ไม่ถูกต้อง

ตัวอย่างด้านล่างนั้นได้แสดงให้เห็นถึงการทำลายความสมบูรณ์และความถูกต้องของไฟล์ $MFT ซึ่งเป็นเหตุมาจากการกู้คืนไฟล์ไปยังไดร์ฟหรือตำแหน่งเดิม ค่า Date created ของไดร์ฟ D เมื่อเปรียบเทียบกับไดร์ฟ C จึงไม่ถูกต้องตรงกัน

กรณีตัวอย่างที่การทำลายความสมบูรณ์และความถูกต้องของไฟล์ $MFT มีผลกับการทำ Digital Forensic

นายเอพบว่ามีการลบไฟล์จำนวนมากออกจากเครื่องเซิร์ฟเวอร์ โดยไฟล์เหล่านั้นเป็นไฟล์ที่มีความสำคัญต่อการทำงานเป็นอย่างมาก ด้วยความตกใจ นายเอจึงทำการพยายามกู้ไฟล์เหล่านั้นด้วยโปรแกรมกู้ไฟล์กลับลงในไดร์ฟเดิม โดยสามารถกู้ไฟล์ได้แค่บางส่วนเท่านั้น นายเอเกิดข้องสงสัยว่าการลบไฟล์ดังกล่าวอาจเกิดจากผู้ไม่หวังดีภายในองค์กรเดียวกัน จากนั้นนายเอจึงได้จ้าง Digital Forensic Analyst ให้ทำการตรวจสอบเครื่องคอมพิวเตอร์ดังกล่าวว่ามีไฟล์ใดถูกลบออกไปบ้างเพื่อนำไปตรวจสอบต่อ

ซึ่งการทำลายความสมบูรณ์และความถูกต้องของไฟล์ $MFT ได้ถูกทำลายจากการกู้คืนไฟล์ไปยังไดร์ฟเดิม ส่งผลกระทบกับการทำงานของ Digital Forensic Analyst ให้ไม่สามารถตรวจหาชื่อไฟล์ได้

ตัวอย่างด้านล่างนั้นได้แสดงให้เห็นความแตกต่างระหว่างไฟล์ $MFT ก่อนและหลังการกู้คืนไฟล์ลงในไดร์ฟเดิม โดยไฟล์ $MFT ทั้งสองไฟล์ถูกแปลงด้วยโปรแกรม MFTECmd เป็น CSV จะพบว่าจำนวนข้อมูล [In Use] = unchecked ซึ่งบ่งบอกไฟล์ที่ถูกลบไปแล้วไม่เท่ากัน

และเมื่อทดลองค้นหาชื่อไฟล์ที่มีคำว่า ns จะพบว่าในไฟล์ $MFT ก่อนและหลังการกู้คืนไฟล์ลงในไดร์ฟเดิมมีข้อมูลไม่ตรงกัน โดยในไฟล์ $MFT หลังการกู้คืนจะมีจำนวนข้อมูลน้อยกว่า

สรุป

ไฟล์ $MFT มีประโยชน์มากในการทำ digital forensic  ใช้บอกข้อมูลได้หลายอย่าง แต่ควรระวังว่าข้อมูลใน MFT อาจถูกแก้ไขได้ในบางกรณีโดยไม่ตั้งใจได้

English version

There is a file called Master File Table or MFT ($MFT) in NTFS file system. And today Intelligent Response team from i-secure Co., Ltd. will present you some interesting details about $MFT.

Some interesting details about $MFT

$MFT contains all information about every file in each drive even those files had been deleted. So $MFT is very useful to file recovery software, forensic software and digital forensics.

$MFT will create once when you format each drive or when you change your disk system to NTFS. All $MFT related date such as Date created of $MFT, Date modified of $MFT and last written Date of $MFT should be the same date as you format your drive.

But there are some programs can manipulate $MFT. For example, preserve hard disk software such as Deep Freeze can wipe $MFT to preserve hard disk. Utility program such as CCleaner also has option to wipe MFT space. These programs can edit $MFT, change Date created of $MFT and destroy data integrity of $MFT.

Data integrity of $MFT can also be destroyed by an attempt to recover deleted file. If you use File Recovery program and save recovered files into the same drive, the program might overwrite $MFT record for that file and other deleted file.

The following picture shows the difference between Date created of $MFT in drive C and drive D that cause by using File Recovery program in drive D and save recovered files into the same drive.

Losing data integrity of $MFT can effect Digital Forensic as the following situation.

Mr. A. found that someone deletes lots of importance file from his server. He attempted to recover deleted files by use File Recovery program and save recovered files into the same drive so he can recover only part of deleted files. Then he. suspicious that this might cause by some insider threat so he hires Digital Forensic Analyst to investigate which files have been deleted.

But Mr. A. already destroy Data integrity of $MFT so Digital Forensic Analyst couldn't find the exact list of deleted files.

The following picture shows the difference between $MFT before recovery and after recovery. There two $MFT were parsed by  MFTECmd to CSV. We can see numbers of "[In Use] = unchecked" are difference. This "[In Use] = unchecked" indicate the deleted file.

If we try to search for the file that contains "ns", we can see that the $MFT before recovery has more record than the $MFT after recovery.

Conclusion

MFT is very useful for digital forensics. But its record can be tempered by legitimate programs in some situations.

แหล่งอ้างอิง / Reference

  1. https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table
  2. https://whereismydata.wordpress.com/2009/03/31/forensics-mft-date/
  3. บทความวิจัย การกู้คืนข้อมูลจากซอฟต์แวร์คงสภาพฮาร์ดดิสก์ http://www.ecti-thailand.org/assets/papers/1437_pub_75.pdf
  4. http://www.ntfs.com/file-recovery-concepts.htm
  5. https://whereismydata.wordpress.com/2008/08/11/file-system-mft-technical/
  6. https://whereismydata.wordpress.com/2008/08/11/file-system-mft-basics/
  7. http://www.forensickb.com/2010/10/forensic-analysis-of-frozen-hard-drive.html