# Finding Evidence of Deleted Files with USN Journal Analysis

In the context of **Master File Table (MFT)** entries in NTFS file systems, **"in-use"** and **"not in-use"** are terms that describe the status of MFT records.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FbDAhpBPNzZuc0lMwBMYe%2FScreenshot(1).png?alt=media&#x26;token=0f7482f1-bf16-40e2-9f64-a8fb1e30662b" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="194">Term</th><th>Description</th></tr></thead><tbody><tr><td><strong>In-Use</strong></td><td>The MFT entry is <strong>active</strong> and points to an existing file or directory.</td></tr><tr><td></td><td>The file/directory is currently present on the file system.</td></tr><tr><td><strong>Not In-Use</strong></td><td>The MFT entry is <strong>inactive</strong> and has been marked for reuse.</td></tr><tr><td></td><td>The file/directory has been <strong>deleted</strong>, but its metadata remains until the space is overwritten.</td></tr></tbody></table>

#### **How It Works**

1. **When a file is created**:
   * A new MFT entry is allocated and marked **in-use**.
2. **When a file is deleted**:
   * The MFT entry is marked as **not in-use**, but the metadata and file content may remain on disk until overwritten.
3. **Forensic Use**:
   * "Not in-use" entries allow forensic investigators to recover deleted files, extract timestamps, or analyze remnants of file metadata.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FWqIsDZZX9UMt5Ljm5ucq%2FScreenshot(3).png?alt=media&#x26;token=d523caae-f7c5-44c4-bc18-282274fa114a" alt=""><figcaption></figcaption></figure>

Let’s examine the details of the "SRU00078.log" file using its Entry Number.

```bash
MFTECmd.exe -f C:\Cases\E\$MFT --de 176972
```

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FlNeWVK7f4xombs5Rvm28%2FScreenshot(4).png?alt=media&#x26;token=7593997d-bba3-4422-bef5-d4c77802f044" alt=""><figcaption></figcaption></figure>

The **`IsFree`** flag means this MFT entry is **not in use**. The file associated with this entry has been deleted, and the MFT entry is available for reuse.

**Resident**: `False`

* The file data is stored **outside** the MFT entry, meaning it's non-resident data.

**DataRuns Entries**: Specifies the physical cluster location on disk:

* `0x9E2F5`: Starting cluster.
* `0x10`: The number of clusters allocated (16 clusters × 4 KB = 64 KB).

## Analyzing the USN Journal for deleted files

Q) When was the file "deleteme\_T1551.004" created and deleted ?

The **USN Journal (Update Sequence Number Journal)** is a valuable artifact in forensic investigations for tracking changes to files and directories on an NTFS volume. It records metadata changes, including file creations, modifications, renames, and deletions.

**$Extend\\$UsnJrnl:** Tracks file and directory changes on an NTFS volume.

* **$Max:** Contains metadata about the USN Journal configuration.
* **$J:** Contains records of filesystem operations.

We can see the two files in our Cases folder.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FY5xylcgAfzNSYF1hYyt9%2FScreenshot(5).png?alt=media&#x26;token=c651103a-c840-422d-8965-98dc9883a8c8" alt=""><figcaption></figcaption></figure>

Now, let's parse the $J file.

```bash
MFTECmd.exe -f C:\Cases\E\$Extend\$J -m C:\Cases\E\$MFT --csv C:\Cases\Analysis\NTFS
```

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FEDO9DsoFd4ry9JuGpXrB%2FScreenshot(6).png?alt=media&#x26;token=df436847-9546-4d11-8483-731153378310" alt=""><figcaption></figcaption></figure>

* $MFT file to use when -f points to a $J file

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FuXdvN6orp2vvTLcNUKjA%2FScreenshot(7).png?alt=media&#x26;token=6ecf1f0b-75cf-455a-81e0-2c36f12902cd" alt=""><figcaption></figcaption></figure>

Let's open "**MFTECmd\_$J\_Output.csv"** using Timeline Explorer and search for "deleteme\_T1551.004" file.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FRRLKr6zHUPJo9VFthusp%2FScreenshot(8).png?alt=media&#x26;token=02ab3d85-54bd-4539-90ab-74df86413c85" alt=""><figcaption></figcaption></figure>

Let's scroll to the right.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FXeO6k1GiY0CdtnTSw2rk%2FScreenshot(9).png?alt=media&#x26;token=d1cc747b-71c2-4e86-bb28-5bbeb40b2322" alt=""><figcaption></figcaption></figure>

The Update Timestamps are visible by scrolling to the left.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FCEjBvRRuZEGtbtowZJiy%2FScreenshot(10).png?alt=media&#x26;token=1b11e8f9-72dd-4262-908e-61febf55d44d" alt=""><figcaption></figcaption></figure>

* **File Create:** 2024-12-12 08:08:58
* **File Deleted:** 2024-12-12 08:08:59

Q) What was the Entry Number for "deleteme\_T1551.004" and does it still exist in the MFT ?

We already know its Entry Number.

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FCGJUBOf522XKAk3yoy9K%2FScreenshot(11).png?alt=media&#x26;token=0b816cc0-d455-4080-9a4f-92fcba9afb25" alt=""><figcaption></figcaption></figure>

```bash
MFTECmd.exe -f C:\Cases\E\$MFT --de 1987
```

<figure><img src="https://2537271824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIswWWP3l0rGuQmG2WUcr%2Fuploads%2FmSg8y9gFaQ3xxTdgqs5Q%2FScreenshot(13).png?alt=media&#x26;token=378b1bca-3b15-4241-9c26-76a544266d4d" alt=""><figcaption></figcaption></figure>

The space in the MFT that was previously occupied by the `deleteme_T1551.004` file have been reused or overwritten by another file, in this case, `WuProvider...etl`. This could happen if the original file was deleted or its entry was recycled after being deleted or modified.
