Windows Forensics Cheat Sheet: Commands, Event IDs and Artifacts

  • Windows
  • Cybersecurity
  • Intermediate
  • 12 min read

This Windows forensics cheat sheet collects the commands, event IDs and files you need when a Windows PC or server may have been hacked. It follows the order a real investigation takes: save the evidence, see who and what is running, find how the attacker stays on the machine, read the logs, then build a timeline and find the root cause.

Last updated: December 2026

In short

  • Collect memory first, because it is gone after a restart. Then copy the disk and the logs.
  • Most attackers leave traces in the same few places: autostart entries, services, scheduled tasks and the Security event log.
  • The built-in Windows commands were tested on Windows 11. Each code box says where it runs and whether it needs admin rights.
Windows forensics workflow in 5 steps: collect, triage, analyze, timeline and root cause, with the order of evidence collection
The five steps of a Windows investigation, and the order to collect evidence in. Tap the picture to see it full size.

Before you type anything

Every command you run changes the machine a little: it starts a process, writes to the prefetch folder and adds log entries. On a machine that may end up in court or an insurance claim, capture memory and a disk image first and do the deep analysis on the copies. Save output to a USB drive or a network share, never to the suspect disk. Run these commands only on systems you own or are allowed to investigate.

Which Windows Versions This Covers

The commands and file paths are for Windows 10, Windows 11 and Windows Server 2016 or newer (the packet capture in step 7 needs Windows 10 version 2004, Windows 11 or Windows Server 2022). Most artifacts also exist on Windows 7, but Windows 7 lost support in January 2020 and lacks some tools used here. To open an admin window, right-click Start and choose Terminal (Admin).

The Windows Forensics Cheat Sheet at a Glance

C:\> first-response

  1. query userWho is signed in right now
  2. net localgroup administratorsWho has admin rights
  3. tasklist /vEvery running process
  4. netstat -anoOpen connections and the process behind each
  5. schtasks /query /fo LIST /vEvery scheduled task
  6. Get-WinEvent -FilterHashtableLogons, new accounts and new services

Tap a command to jump to it. “admin” = run it in an administrator window to see everything.

Step 1: Quick Triage Commands

Triage answers three questions in a few minutes: who is on the machine, what is running, and what is it talking to. These are built into Windows, so they work even when you cannot install anything.

01 query user: Who Is Signed In

  • Read-only

Lists every session on the machine, including Remote Desktop ones, with the time each user signed in. A session you cannot explain, especially an RDP one at night, is worth a closer look.

Windows · Command Prompt or PowerShell
query user

query user is missing on Windows Home editions. It also returns exit code 1 even when it works, so do not rely on the exit code in scripts.

02 net user and net localgroup: Accounts and Admins

  • Read-only

Attackers like to add a quiet local account and put it in the Administrators group. Compare these two lists with the accounts you expect.

Windows · Command Prompt
net user
Windows · Command Prompt
net localgroup administrators

03 tasklist: Running Processes

  • Read-only
  • Admin to see every process

/v adds the user that owns each process. /svc shows which services live inside each process, which helps when one svchost.exe is using the network.

Windows · Command Prompt
tasklist /v
Windows · Command Prompt
tasklist /svc

To also see the full command line and the parent process, use Get-CimInstance Win32_Process, explained in our PowerShell guide for a hacked PC.

04 netstat -ano: Connections and Their Process IDs

  • Read-only

Shows every open port and connection with the process ID (PID) in the last column. Match the PID with tasklist to find the program. Look for connections to unknown public IP addresses and for programs listening on ports you did not open.

Windows · Command Prompt
netstat -ano
Windows · PowerShell
Get-NetTCPConnection -State Established | Select-Object LocalPort, RemoteAddress, RemotePort, OwningProcess

05 ipconfig /displaydns: Recently Looked-Up Domains

  • Read-only
  • Admin on Windows 11

The DNS cache lists domains the machine resolved recently. A strange domain here can point to malware calling home. The cache is cleared on restart, so read it early. On our Windows 11 test PC this command needed an admin window.

Windows · Command Prompt (admin)
ipconfig /displaydns

Step 2: Registry Hives and Key Artifacts

The registry is stored in a few files called hives. Windows keeps them locked while it runs, so forensic tools copy them or you export them with reg save. Our guide to Windows directories for SOC analysts shows where each file lives.

HiveFile on diskWhat it tells you
HKLM\SAMC:\Windows\System32\config\SAMLocal accounts and their groups
HKLM\SECURITYC:\Windows\System32\config\SECURITYLocal security policy and stored LSA secrets
HKLM\SOFTWAREC:\Windows\System32\config\SOFTWAREInstalled programs and machine-wide autostart keys
HKLM\SYSTEMC:\Windows\System32\config\SYSTEMServices, drivers, USB devices, computer name
HKCU (one per user)C:\Users\<user>\NTUSER.DATThat user’s settings, recent files, typed paths and Run box history
Part of HKCRC:\Users\<user>\AppData\Local\Microsoft\Windows\UsrClass.datShellBags: folders the user opened, even on removed drives
AmcacheC:\Windows\AppCompat\Programs\Amcache.hvePrograms that were present, with their SHA1 hash. Not proof that they ran.

These keys are where attackers most often hide programs that should start on their own:

KeyWhy it matters
Software\Microsoft\Windows\CurrentVersion\Run (HKLM and HKCU)Starts a program at every sign-in
...\CurrentVersion\RunOnceStarts a program once, at the next sign-in
HKLM\SYSTEM\CurrentControlSet\ServicesEvery service and driver, with the file it runs
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution OptionsA Debugger value here runs another program instead of the real one
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLsDLLs loaded into many programs. Windows ignores it when Secure Boot is on.

To show that a program actually ran, and when, combine several of these execution artifacts. No single one is proof on its own:

ArtifactWhereWhat it shows
PrefetchC:\Windows\Prefetch\*.pfPrograms that ran, how many times, and recent run times. Often turned off on servers.
UserAssistNTUSER.DATPrograms a user started from Explorer or the Start menu, with a run count. The names are ROT13-encoded.
BAMSYSTEM\CurrentControlSet\Services\bamLast run time of programs, per user (Windows 10 version 1709 and later)
ShimcacheSYSTEM hive (AppCompatCache)Programs Windows checked for compatibility. Shows the file existed, not that it ran.
SRUMC:\Windows\System32\sru\SRUDB.datRoughly hourly app and network use, useful for spotting large uploads

06 reg query: Read a Key

  • Read-only

Reads the values of one key. Add /s to include every subkey below it.

Windows · Command Prompt
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run
Windows · Command Prompt
reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run

07 reg save: Export a Hive for Later

  • Admin
  • Writes a file

Copies a whole hive to a file you can open on your analysis machine with Registry Explorer or RegRipper. Point the output to your evidence drive (here E:), not to the suspect disk.

Windows · Command Prompt (admin)
reg save HKLM\SYSTEM E:\evidence\SYSTEM.hiv

08 reg load and reg unload: Open a Copied User Hive

  • Admin
  • On your analysis PC

Mounts a copied NTUSER.DAT under a temporary name so you can browse it with reg query or Registry Editor. Unload it when you finish. Work on a copy: loading a hive can change it.

Windows · Command Prompt (admin)
reg load HKU\Case1 E:\evidence\NTUSER.DAT
Windows · Command Prompt (admin)
reg unload HKU\Case1

Step 3: Persistence and Autostart Checks

Persistence is how an attacker gets back in after a restart. Check these five places on every case:

Scheduled Tasks

Run a program at a set time, at startup or at sign-in. Look for odd names and actions that start scripts.

Services

Run as SYSTEM before anyone signs in. A service whose file sits in Temp or AppData is a red flag.

Run and RunOnce Keys

The registry keys from step 2. Check both the machine (HKLM) and every user (HKCU).

Startup Folders

Shortcuts in shell:startup and shell:common startup run at sign-in. Note anything added recently.

WMI Event Subscriptions

Run a command when something happens, with no file in the usual places. Autoruns lists them on its WMI tab.

09 schtasks: Every Scheduled Task in Detail

  • Read-only
  • Admin to see every task

The “Task To Run” line shows the program each task starts. Long PowerShell commands or files in user folders are the ones to check first.

Windows · Command Prompt (admin)
schtasks /query /fo LIST /v

10 Services and the File Each One Runs

  • Read-only

sc query lists every service and its state (the space after each = is required). The PowerShell line adds the start mode and the file path. Many older cheat sheets use wmic service here, but Microsoft is removing WMIC from Windows 11 (it is off by default since version 24H2, and our 26H2 test PC no longer has it), so use PowerShell instead.

Windows · Command Prompt
sc query type= service state= all
Windows · PowerShell
Get-CimInstance Win32_Service | Select-Object Name, StartMode, State, PathName

11 Autoruns: Every Autostart Location at Once

  • Free Microsoft Sysinternals tool
  • Admin

Autoruns checks more autostart places than any manual list, including WMI and browser add-ons. autorunsc is its command-line version: -a * means all entry types, -c CSV output, -h file hashes and -s signature checks. Unsigned entries are the first to review.

Windows · Command Prompt (admin)
autorunsc -accepteula -a * -c -h -s > E:\evidence\autoruns.csv

Step 4: Windows Event Logs and Event IDs

Event logs are .evtx files in C:\Windows\System32\winevt\Logs. These are the event IDs most investigations start with:

Event IDLogMeaning
4624SecuritySuccessful sign-in. Check the logon type: 2 = at the keyboard, 3 = over the network, 10 = Remote Desktop.
4625SecurityFailed sign-in. Many in a row from one source suggests password guessing.
4672SecurityA sign-in was given sensitive privileges, such as SeDebugPrivilege. Normal for SYSTEM and admins; investigate it for an ordinary user.
4720SecurityA user account was created
4732SecurityA member was added to a local group, such as Administrators
4688SecurityA process started (only if process auditing is turned on)
1102SecurityThe Security log was cleared, often to hide tracks
7045SystemA new service was installed
4104PowerShell OperationalThe text of a PowerShell script block that ran (every block only if Script Block Logging is turned on)
1116, 1117Defender OperationalMicrosoft Defender found malware (1116) and acted on it (1117)

12 Get-WinEvent: Filter Events by ID

  • Read-only
  • Admin for the Security log

Get-WinEvent has no -Id parameter on its own, so a line like Get-WinEvent -Id 4624 fails. Put the log name and IDs in -FilterHashtable instead.

Windows · PowerShell (admin)
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624,4625,4720,4732} -MaxEvents 50
Windows · PowerShell
Get-WinEvent -FilterHashtable @{LogName='System'; Id=7045} -MaxEvents 20

13 wevtutil: Read or Export Logs from Command Prompt

  • Admin for the Security log

The first line shows the 20 newest System events as text (/rd:true means newest first). The second exports the whole Security log to your evidence drive for tools like Hayabusa or Timeline Explorer.

Windows · Command Prompt
wevtutil qe System /c:20 /rd:true /f:text
Windows · Command Prompt (admin)
wevtutil epl Security E:\evidence\Security.evtx

Step 5: Deleted Files and File Carving

A deleted file can often be recovered until Windows reuses its space on the disk.

Where or whatWhat you can recover
C:\$Recycle.Bin\<user SID>Files in the Recycle Bin. Each $I file stores the original path and the deletion time.
Volume Shadow CopiesOlder versions of files, if restore points exist. Ransomware often deletes them first.
The Sleuth Kit (fls, icat)Deleted NTFS entries listed and copied out of a disk image
PhotoRec, ScalpelFiles carved from empty space by their file signatures, even without a name

14 vssadmin: List Shadow Copies

  • Read-only
  • Admin
Windows · Command Prompt (admin)
vssadmin list shadows

If this lists nothing on a server that normally keeps restore points, ask why. vssadmin delete shadows in a process or event log is a strong ransomware sign.

15 fls and icat: Find and Copy Out Deleted Files

  • Works on a disk image

fls -r -d walks every folder and lists only deleted entries, each with an address such as 1234-128-1. icat copies that entry’s content to a new file.

Any OS · The Sleuth Kit
fls -r -d disk.raw
Any OS · The Sleuth Kit
icat -r disk.raw 1234-128-1 > recovered.bin

If the image holds a whole disk instead of one partition, add -o with the partition’s start sector (find it with mmls disk.raw).

16 Get-FileHash: Fingerprint a Suspicious File

  • Read-only

Hash files before and after you copy them to prove they did not change, and look the SHA256 up in VirusTotal or your threat intelligence tool.

Windows · PowerShell
Get-FileHash E:\evidence\recovered.bin -Algorithm SHA256

Step 6: Memory Capture and Analysis

RAM holds things the disk never sees: malware that runs only in memory, open network connections, decrypted data and sometimes passwords. It is lost when the machine powers off, so capture it before anything else. Run the capture tool from a USB drive as administrator and write the dump to that drive.

ToolWhat it does
FTK ImagerFree GUI tool; File › Capture Memory. Also makes disk images.
Magnet RAM CaptureFree, one window, one button
Belkasoft Live RAM CapturerFree, small, runs from USB
WinPmemOpen source, command line, good for scripts
pagefile.sys, hiberfil.sysParts of old memory saved on disk. Collect them with the disk image, especially when a live capture was not possible.

Then analyze the dump with Volatility 3, a free Python tool that runs on Windows, Linux and macOS:

PluginWhat it shows
windows.pslist, windows.pstreeProcesses, and which one started which
windows.psscanProcesses found by scanning memory, including hidden or ended ones
windows.cmdlineThe command line of each process
windows.dlllist, windows.ldrmodulesLoaded DLLs, and DLLs hidden from the normal lists
windows.netscanNetwork connections and listening ports at capture time
windows.registry.hivelistRegistry hives in memory
windows.malfindMemory that is both writable and executable, a common sign of injected code

17 vol: Run a Volatility 3 Plugin

  • On your analysis PC

Start with the process tree. A Word or browser process with cmd.exe or powershell.exe under it is suspicious.

Any OS · Volatility 3 (Python)
vol -f memory.raw windows.pstree
Any OS · Volatility 3 (Python)
vol -f memory.raw windows.netscan

Plugin names change between releases (newer versions also list some under windows.malware.). Run vol -h to see the names your version has.

Step 7: Network Activity and Data Theft

Before stealing data, attackers usually collect it in one place and pack it, then send it out with a tool that is already on the machine. Watch for these signs:

SignWhy it matters
Large new .zip, .7z or .rar files in Temp, ProgramData or a user folderData gathered and packed before it leaves
certutil -urlcache, bitsadmin /transfer, curl.exeBuilt-in Windows tools that can download or upload files
powershell -EncodedCommand (or -enc)A hidden command; decode it from Base64 to read it
Connections to unknown IPs, often at regular intervalsPossible command-and-control traffic
Uploads to personal cloud storageOneDrive, Dropbox or Google Drive used to move data out

18 pktmon: Capture Traffic Without Installing Anything

  • Admin
  • Writes a capture file

Packet Monitor (Microsoft docs) is built into Windows 10 version 2004 and later, Windows 11 and Windows Server 2022. Start a capture, reproduce the activity, then stop it. By default each packet is cut to 128 bytes; add --pkt-size 0 to keep whole packets.

Windows · Command Prompt (admin)
pktmon start --capture --pkt-size 0
Windows · Command Prompt (admin)
pktmon stop

The capture is saved as PktMon.etl in the current folder. This turns it into a file Wireshark opens:

Windows · Command Prompt
pktmon etl2pcap PktMon.etl

Step 8: Build the Incident Timeline

A timeline puts every event from every source in one list sorted by time. It shows the story: first sign-in, download, first run, persistence, then data theft. Attackers sometimes change file times (timestomping), so confirm important times with a second source, such as an event log entry.

ToolUse it for
Plaso (log2timeline.py, psort.py)One timeline from the MFT, event logs, registry, browser history and more
MFTECmdReading the NTFS Master File Table into CSV, with created, modified, accessed and changed times
fls -r -m C: disk.raw and mactime (The Sleuth Kit)A quick file-system-only timeline
TimesketchSearching and tagging a large timeline with your team

19 log2timeline and psort: A Full Timeline

  • On your analysis PC
  • Can take hours

The first command reads the image and saves every event it finds. The second writes them to a CSV file you can filter in Timeline Explorer or load into Timesketch.

Linux · Docker · Plaso
log2timeline.py --storage-file case1.plaso disk.E01
Linux · Docker · Plaso
psort.py -o dynamic -w case1-timeline.csv case1.plaso

Step 9: Find the Root Cause

Before you close the case, find out how the attacker got in, so you can block that path for good.

  1. Define the incident. What happened, when it was noticed and which systems are involved.

  2. Gather and connect the data. Logs, EDR or SIEM alerts, the artifacts above and what users report.

  3. Rebuild the timeline from the first sign of access to the last action you can see.

  4. Ask “why” until you reach a cause you can fix. “Malware ran” is a symptom; “the RDP port was open to the internet with a weak password” is a cause.

  5. Fix it and write it down. Short-term clean-up, long-term changes, and what to detect earlier next time.

In most cases the cause is one of these: a phishing email, a stolen or weak password, a missing security update, or a wrong setting such as an exposed remote access port. Tools such as Sysmon, Velociraptor and KAPE help collect the evidence across many machines; see our guide to SOC tools for how they fit with a SIEM and EDR.

Which Operating System Runs These Tools

Tool or commandWindowsLinuxmacOS
query user, net, tasklist, netstat, schtasks, sc, reg, wevtutil, vssadmin, pktmonBuilt inNoNo
Get-WinEvent, Get-CimInstance, Get-NetTCPConnection, Get-FileHashBuilt in (PowerShell)Get-FileHash only, with PowerShell 7Get-FileHash only, with PowerShell 7
Autoruns, FTK Imager, Magnet RAM Capture, WinPmemYesNoNo
Volatility 3, The Sleuth KitYesYesYes
PlasoDocker or WSLYesDocker

A ready-made lab

Free forensic Linux builds such as the SANS SIFT Workstation come with Volatility, The Sleuth Kit and Plaso installed. On a Windows analysis PC, WSL can run the Linux tools too.

Key takeaways

  • Capture memory first, then the disk, and analyze the copies.
  • Triage with built-in commands: users, processes, connections and the DNS cache.
  • Check every persistence place: tasks, services, Run keys, startup folders and WMI.
  • Use Get-WinEvent -FilterHashtable for event IDs such as 4624, 4625, 4720 and 7045.
  • Finish with a timeline and a root cause you can fix.

FAQ

What is a Windows forensics cheat sheet?

A one-page reference of the commands, event IDs and file locations an investigator needs on a Windows machine, in the order they are used. This one is tested on Windows 11 and says where each command runs.

What should I collect first in Windows forensics?

Memory, because it disappears when the machine powers off. Then network state and running processes, then the disk image and logs. RFC 3227 calls this the order of volatility.

Should I turn off a hacked Windows PC?

Not before you capture memory, if you can. Disconnect it from the network instead, so the attacker loses access but the evidence in RAM stays.

Why does Get-WinEvent -Id not work?

Get-WinEvent has no stand-alone -Id parameter. Use -FilterHashtable @{LogName='Security'; Id=4624}, which is also much faster than filtering afterwards.

Does Amcache prove that a program ran?

No. Amcache shows that a program was present on the system. Use prefetch files, event 4688 or Sysmon event 1 to show that it actually ran.

Is WMIC still useful for forensics?

Not on new systems. Microsoft is removing WMIC from Windows 11, and it is off by default since version 24H2. The PowerShell Get-CimInstance commands give the same information.

For the full list of fields in a sign-in event, see Microsoft’s page on event 4624. The order of evidence collection comes from RFC 3227, Guidelines for Evidence Collection and Archiving.

Inspired by a Windows forensics cheat sheet shared by anastasis_king. Commands tested and text written by infotechtu.com.

Related guides on infotechtu.com

Share this guide

Save

Get new guides by email

One short email when a new guide is out. Unsubscribe at any time.

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top