## Prefetch files
* Useful to determine evidence of execution
* Only enabled on non-server Windows Versions.
---
## Prefetch files
Enable prefetcher on windows server OS's
```text
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v EnablePrefetcher /t REG_DWORD /d 3 /f
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Prefetcher" /v MaxPrefetchFiles /t REG_DWORD /d 8192 /f
powershell /c "Enable-MMAgent -OperationAPI"
```
---
## Filesystem artifacts: USN
* The USN Journal records filesystem operations
* Operations are recorded in the hidden NTFS file `$Extend\$UsnJrnl:$J`
* The USN journal rolls over fairly quickly (Approx 30mb)
---
## Using the USN journal in IR
Filtering the USN journal for prefetch file modifications gives
useful timestamps related to program execution!
---
## Querying the USN journal
* The [fsutil tool](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-usn) can be used to manipulate the USN journal.
---
## Attackers may clear the USN journal
* Attacker can completely delete the USN Journal.
* We are forced to carve the disk for USN records!
---
## What can we do with an agent?
* Forward USN records off the system in a timely fashion.
---
## Forwarding USN logs off the system