Windows quietly records almost everything a user, or an attacker, does. Even when someone deletes their tools, these artifacts often remain, and they're where most Windows investigations are won.
The big four
| Artifact | Location | What it proves |
|---|---|---|
| Registry | C:\Windows\System32\config\ (SAM, SYSTEM, SOFTWARE, SECURITY) and each user's NTUSER.DAT | Settings, installed software, USB devices, autostart entries |
| Prefetch | C:\Windows\Prefetch\*.pf | Which programs ran, how often and when |
| LNK files | %APPDATA%\Microsoft\Windows\Recent\ | Which files and folders a user opened, even on USB drives |
| Event Logs | C:\Windows\System32\winevt\Logs\*.evtx | Logons, new services, cleared logs and much more |
Registry: where persistence hides
Attackers want their malware to survive a reboot. The classic way is a Run key:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Anything listed there starts automatically. Other keys worth checking:
- USB history:
HKLM\SYSTEM\CurrentControlSet\Enum\USBSTORlists USB storage devices that have been connected. - Typed paths:
Software\Microsoft\Windows\CurrentVersion\Explorer\TypedPathsin NTUSER.DAT shows folders typed into Explorer. - Services:
HKLM\SYSTEM\CurrentControlSet\Servicesholds every installed service, including malicious ones.
Prefetch: proof of execution
Windows creates a .pf file when a program runs, so it loads faster next time. For an investigator, it's evidence that a program was executed, for example MIMIKATZ.EXE-1A2B3C4D.pf, even if the .exe itself was deleted. On Windows 8 and later, each file stores up to the last 8 run times.
Tip: Prefetch is usually turned off on Windows Server. An empty Prefetch folder doesn't mean nothing ran.
Event logs: the IDs to know by heart
| Event ID | Log | Meaning |
|---|---|---|
| 4624 | Security | Successful logon |
| 4625 | Security | Failed logon |
| 4672 | Security | Logon with admin privileges |
| 4688 | Security | New process created (if auditing is on) |
| 4720 | Security | User account created |
| 7045 | System | New service installed |
| 1102 | Security | Security log was cleared |
| 104 | System | System log was cleared |
The logon type inside a 4624 event tells you how someone logged in: 2 = at the keyboard, 3 = over the network (for example a file share), 10 = Remote Desktop.
Tools
- Eric Zimmerman's tools (free): PECmd for Prefetch, LECmd for LNK files, EvtxECmd for event logs and Registry Explorer for hives.
- RegRipper pulls key artifacts out of registry hives automatically.
- Hayabusa and Chainsaw scan .evtx files for known attack patterns.
- On Kali, the python-evtx package converts .evtx logs into readable XML.
Example: parse every Prefetch file from a mounted image into a CSV:
PECmd.exe -d "E:\Windows\Prefetch" --csv C:\cases\case01
One artifact is a clue. Three artifacts that agree, such as a Prefetch entry, an LNK file and a 4688 event in the same minute, is a finding.