vssadmin list shadows comes back empty, even though you are fairly sure snapshots existed last week. In most ransomware cases this is deliberate. The attacker deleted the Volume Shadow Copies (the point-in-time snapshots Windows keeps through the Volume Shadow Copy Service, or VSS) before starting encryption, and that delete command is one of the best timestamps you will get for when they had admin control of the box.
MITRE ATT&CK lists this behavior as Inhibit System Recovery, T1490, and MITRE's analytic CAR-2021-01-009 points to the same two places to look: Security Event ID 4688 and Sysmon Event ID 1. Both record process creation, which means a new program starting, along with the program's command line and the process that launched it. This guide walks through checking those logs from the command line, in an order that keeps the evidence intact.
What the deletion usually looks like
vssadmin delete shadows /all /quietdeletes every shadow copy without a prompt.vssadmin resize shadowstorageshrinks the storage area until Windows drops existing snapshots. This removes copies without any "delete" verb in the command, which is why the CAR analytic covers resize as well.wmic shadowcopy deletedoes the same deletion through WMI.- PowerShell calls against the
Win32_ShadowCopyWMI class, often looping over each copy and calling its delete method. wbadmin delete catalogandbcdeditchanges that turn off Windows recovery often appear right next to the shadow copy deletion.
Save the logs before you query them
POWERSHELL
# Run from an elevated prompt. E:\case is an example path on external storage.
wevtutil epl Security E:\case\Security.evtx
wevtutil epl System E:\case\System.evtx
wevtutil epl Microsoft-Windows-Sysmon/Operational E:\case\Sysmon.evtx
wevtutil epl Microsoft-Windows-PowerShell/Operational E:\case\PowerShell.evtx
# Current shadow copy state (read-only)
vssadmin list shadows
vssadmin list shadowstorage
# Was the Security log cleared? Event ID 1102 records that.
Get-WinEvent -FilterHashtable @{Path='E:\case\Security.evtx'; Id=1102} -ErrorAction SilentlyContinue |
Select-Object TimeCreated, MessageSearching Security Event ID 4688
vssadmin.exe ran, but you cannot tell list from delete.
POWERSHELL
$pattern = 'vssadmin|wmic|shadowcopy|shadowstorage|wbadmin|bcdedit|Win32_ShadowCopy'
Get-WinEvent -FilterHashtable @{Path='E:\case\Security.evtx'; Id=4688} |
Where-Object { _.Message -matchpattern } |
Sort-Object TimeCreated |
Format-List TimeCreated, Message- New Process Name and Process Command Line: what ran, with its arguments.
- Creator Process Name and Creator Process ID: what launched it.
- Account Name and Logon ID in the Subject section: which account ran it, in which logon session.
Getting the parent chain from Sysmon Event ID 1
POWERSHELL
Get-WinEvent -FilterHashtable @{Path='E:\case\Sysmon.evtx'; Id=1} |
Where-Object { _.Message -matchpattern } |
ForEach-Object {
$d = @{}
([xml]_.ToXml()).Event.EventData.Data | ForEach-Object {d[_.Name] =_.'#text' }
[pscustomobject]@{
UtcTime = $d.UtcTime
User = $d.User
CommandLine = $d.CommandLine
ParentImage = $d.ParentImage
ParentCommandLine = $d.ParentCommandLine
ParentProcessGuid = $d.ParentProcessGuid
}
} | Format-List$pattern from the previous block, so run both in the same PowerShell session. To go one level up, change the filter to match events whose ProcessGuid equals the ParentProcessGuid you just found, and repeat until you reach something that clearly is not attacker-controlled, such as explorer.exe in a user session or a Windows service host.
The parent chain tells you how the attacker ran the command. A few rough patterns help with reading it, though none of them is proof on its own:
cmd.exelaunched by an unfamiliar executable in a temp, ProgramData, or user folder usually points to the ransomware binary itself running the cleanup.wmiprvse.exeas the parent suggests the command came through WMI, possibly from another machine on the network.services.exespawning a randomly named service binary is typical of remote execution tools that install a temporary service.powershell.exeas the parent means the PowerShell Operational log, and script block logging (Event ID 4104) if enabled, may hold the actual script.
UtcTime in UTC, while TimeCreated in Get-WinEvent output is shown in the local time zone of the machine you query from. Mixing the two is an easy way to build a timeline that is off by several hours.
Turning one timestamp into a timeline
- Before the deletion: the 4624 logon tied to the Logon ID, any new accounts (Event ID 4720), and earlier process events from the same session. The first suspicious event in that session is the earliest confirmed attacker activity, not necessarily the initial access.
- Around the deletion: the
wbadminandbcdeditcommands, service installs, and the start time of the ransomware binary. - After the deletion: file modification times on encrypted files and the creation time of the ransom note show when encryption actually ran.
When the logs come back empty
auditpol /get /subcategory:"Process Creation" shows whether 4688 was being logged, and reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit /v ProcessCreationIncludeCmdLine_Enabled shows whether command lines were included (a value of 1 means on; a missing value usually means off). Also check the Security log's maximum size. On a busy server a small log can roll over within hours, which pushes the deletion event out before anyone looks.
The same two commands are your verification step after hardening. Once both policies are enabled on the rebuilt server, run a harmless vssadmin list shadows, then query the newest 4688 event. If it shows the full command line, the parent process, and the Logon ID, the next incident will leave the evidence this one did not.
The practical habit is simple. Export the logs before touching anything, search 4688 and Sysmon 1 for the deletion command, follow the Logon ID and parent chain back to the session that ran it, and use that session's start time, not the encryption time, to choose which backup to restore.