Post

File Systems, Offline Registry & File Signatures

Identifying file systems in E01 images with The Sleuth Kit, pulling system, network and user details from offline registry hives, and identifying files by their magic numbers.

File Systems, Offline Registry & File Signatures

Overview

Second post in the Digital Forensics Labs series. Once evidence is acquired, the next questions are basic but essential: what’s on this image, what system did it come from, and what kind of files am I looking at?

  1. File system identification in E01 images with The Sleuth Kit
  2. Offline registry analysis — OS, network, and user accounts from raw hives
  3. File signature analysis — identifying files by content, not extension

All analysis was performed on course-provided evidence images inside isolated lab VMs.


Step 1: File System Identification with The Sleuth Kit

The images were in EWF / E01 format — the Expert Witness format used by EnCase and FTK, which stores the disk data along with metadata and an embedded hash. I worked through them with four tools:

ToolPurpose
img_statImage format, size, sector size, stored hash
ewfverifyRecompute the data hash and compare it to the stored one
fsstatFile system type and layout details
flsList files and directories

drive2.E01 — Ext4

img_stat on drive2 img_stat: EWF image, 1,044,905,984 bytes, 512-byte sectors, with the stored MD5 of the data

fsstat on drive2 fsstat identifies an Ext4 file system from a Linux system

PropertyValue
File systemExt4
Likely OSLinux
Volume IDe018ba1739a539b4a941a806e678b8a2
Volume labelnone
Inode size256 bytes
Block size4,096 bytes

fls on drive2 fls listing the root of the Ext4 volume

Running the Windows build of TSK against drive2 gives the same results:

fsstat on Windows fsstat on drive2 from the Windows build of The Sleuth Kit

One detail worth noticing: md5sum drive2.E01 gives a different MD5 than the one img_stat reports. That’s expected — md5sum hashes the E01 container (headers, compression, metadata), while the stored hash covers only the disk data inside it. To verify an E01, compare against the data hash, which is exactly what ewfverify does.

drive3.E01 — no recognizable file system

img_stat on drive3 img_stat reads drive3 fine: 1,993,342,976 bytes of EWF data

fsstat fails on drive3 fsstat and fls: “Cannot determine file system type”

The image itself is valid, but neither tool found a file system at the start of it. That usually means the image contains a partition table rather than a bare volume — in which case mmls would show the partitions, and fsstat -o <offset> could analyse each one — or the volume is damaged, encrypted, or a type TSK doesn’t support. Either way, “no file system found” is a finding to explain, not a dead end.

drive5.E01 — exFAT

ewfverify on drive5 ewfverify: the MD5 stored in the file matches the MD5 calculated over the data

PropertyValue
File systemexFAT
Likely OSWindows / removable media
Volume serial9cc1-6dbd
Volume labelempty
Sector size512 bytes
Cluster size32,768 bytes

fls on drive5 fls listing the exFAT volume


Step 2: Offline Registry Analysis

The Windows registry on disk is a set of hive files (SOFTWARE, SYSTEM, SAM, …) under Windows\System32\config. Analysing a copy of them “offline” reveals how the suspect machine was configured without ever booting it.

SOFTWARE hive in Regedit

Regedit can mount an external hive with File → Load Hive. I loaded the SOFTWARE hive under HKLM as TEST:

Loading the hive in Regedit The offline SOFTWARE hive mounted as HKLM\TEST

HKLM\TEST\Microsoft\Windows NT\CurrentVersion describes the installed OS:

CurrentVersion key Product name, product ID, system root and install date

ValueFinding
ProductWindows 7 Professional
Product ID00371-868-0000007-85715
System rootC:\Windows
Installed23 November 2010, 14:46:59

The consent/logon banner lives under ...\CurrentVersion\Policies\System in the legalnoticecaption and legalnoticetext values.

SYSTEM and SAM hives in Windows Registry Recovery

Windows Registry Recovery parses hives into readable reports. The SYSTEM hive loaded with 147 services and 234 drivers:

SYSTEM hive in Windows Registry Recovery The SYSTEM hive parsed by Windows Registry Recovery

Network configuration comes from SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces:

TCP/IP configuration The adapter’s DHCP configuration recovered from the hive

SettingValue
AdapterBroadcom NetXtreme Gigabit Ethernet
DHCP IP192.168.1.4 / 255.255.255.0
DHCP server & gateway192.168.1.1
Domainhome
Lease obtained4CFD7EF5 → 7 Dec 2010, 00:25:25 GMT
Lease expires4CFED074 → 8 Dec 2010, 00:25:24 GMT

The lease times are stored as Unix timestamps in hex — 0x4CFD7EF5 is seconds since 1 January 1970.

User accounts come from the SAM hive:

SAM users Accounts in the SAM hive, with logon details for user Jimmy

Four accounts exist — Administrator, Guest, Eddie, and Jimmy. For Jimmy:

FieldValue
Last logon7 Dec 2010, 12:15:01 AM
Last password set23 Nov 2010, 2:53:49 PM
Last incorrect password7 Dec 2010, 12:17:36 AM

A failed password attempt two minutes after a successful logon is the kind of small detail worth putting on a timeline.


Step 3: File Signature Analysis

File extensions are just part of the name — anyone can rename stolen.xlsx to holiday.jpg. The file signature (magic number) in the first bytes of the content is much harder to fake by accident.

File header in a hex editor Reading a file’s first bytes in a hex editor

File signature table Looking up signatures in Gary Kessler’s file signature table

FileSignatureType
File150 4B 03 04ZIP container — used by Office Open XML (.docx / .xlsx / .pptx)
File2D0 CF 11 E0 A1 B1 1A E1OLE Compound File — legacy Office (.doc / .xls / .ppt)
File325 50 44 46PDF (%PDF)
File4FF D8 FF E0JPEG (JFIF)
File54C 00 00 00 01 14 02 00Windows shortcut (.lnk)

50 4B 03 04 on its own only says “ZIP” — modern Office files are ZIP archives, so confirming a .docx means looking inside for [Content_Types].xml and the word/ folder.

Automating it with Python

A short script reads the first 8 bytes of each file and matches them against known signatures (tidied up here):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SIGNATURES = [
    (bytes.fromhex("25504446"), "PDF"),
    (bytes.fromhex("FFD8FF"), "JPEG"),
    (bytes.fromhex("504B0304"), "ZIP / Office Open XML (.docx .xlsx .pptx)"),
    (bytes.fromhex("D0CF11E0A1B11AE1"), "OLE compound file / legacy Office (.doc .xls .ppt)"),
    (bytes.fromhex("4C00000001140200"), "Windows shortcut (.lnk)"),
]


def identify_file_signature(path):
    try:
        with open(path, "rb") as f:
            header = f.read(8)
    except OSError:
        return "Error: file not accessible"
    for magic, name in SIGNATURES:
        if header.startswith(magic):
            return name
    return "Unknown file type"


if __name__ == "__main__":
    print(identify_file_signature(input("Enter file path: ")))

Signature script output The script’s output: all five sample files identified by content alone


Conclusion

Before digging into individual files, an examiner needs the lay of the land. The Sleuth Kit identified what’s on each image (and flagged one that needed a closer look), the offline registry described the machine and its users without booting it, and file signatures identified files regardless of what they were named.

Key takeaways:

  • Verify E01s against the embedded data hash, not md5sum of the container file.
  • “Cannot determine file system type” is a lead — check for a partition table with mmls before concluding anything.
  • Offline hives tell the system’s story: OS and install date from SOFTWARE, network from SYSTEM, accounts and logon history from SAM.
  • Trust signatures over extensions — and remember ZIP-based formats need a look inside to identify precisely.

Digital Forensics Labs series

  1. Evidence Acquisition: Write Blocking, Imaging & RAM Capture
  2. File Systems, Offline Registry & File Signatures (you are here)
  3. File Carving: Recovering a JPEG & PDF from Unallocated Space
  4. Autopsy Investigations & Office Document Metadata
  5. Browser & Email Artifacts: Chrome, Firefox & Mail Headers
This post is licensed under CC BY 4.0 by the author.