Direct Volume Access
Adversaries may directly access a volume to bypass file access controls and file system monitoring. Windows allows programs to have direct access to logical volumes, enabling reads and writes directly from the drive by analyzing file system data structures. This technique bypasses Windows file access controls and file system monitoring tools. Utilities such as NinjaCopy (PowerShell), vssadmin, wbadmin, and esentutl can be used to create shadow copies or access locked files (such as ntds.dit, SYSTEM hive, and SAM) directly from disk. Real-world actors including Scattered Spider and Volt Typhoon have leveraged Volume Shadow Copy Service (VSS) to extract credential stores without triggering standard file access controls.
What is T1006 Direct Volume Access?
Direct Volume Access (T1006) maps to the Defense Evasion tactic — the adversary is trying to avoid being detected in MITRE ATT&CK.
This page provides production-ready detection logic for Direct Volume Access, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, File: File Access, Microsoft Defender for Endpoint. The queries below are rated high severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1006 Direct Volume Access
- Canonical reference
- https://attack.mitre.org/techniques/T1006/
let DirectVolumePatterns = dynamic([
"HarddiskVolumeShadowCopy", "GLOBALROOT\\Device\\",
"\\\\.\\PhysicalDrive", "\\\\.\\HarddiskVolume",
"\\\\?\\GLOBALROOT", "vssadmin", "diskshadow"
]);
let CredentialTargets = dynamic([
"ntds.dit", "ntds.jfm", "NTDS.dit",
"SAM", "SECURITY", "SYSTEM",
"NTUSER.DAT", "security.bak"
]);
let SuspiciousTools = dynamic([
"esentutl.exe", "vssadmin.exe", "wbadmin.exe",
"diskshadow.exe", "ntdsutil.exe"
]);
// Branch 1: Shadow copy creation and manipulation tools
let ShadowCopyOps = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (SuspiciousTools)
| where ProcessCommandLine has_any ("create shadow", "list shadows", "delete shadows",
"/y ", "/vss", "start backup", "ifm", "activate instance",
"set context", "add volume", "expose", "HarddiskVolumeShadowCopy", "GLOBALROOT")
| extend DetectionBranch = "ShadowCopyOrVSSToolUsage"
| extend TargetsCredentials = ProcessCommandLine has_any (CredentialTargets);
// Branch 2: Direct volume path access in any process command line
let DirectVolumeOps = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (DirectVolumePatterns)
| where not (FileName in~ ("vssvc.exe", "svchost.exe", "WmiPrvSE.exe"))
| extend DetectionBranch = "DirectVolumePathInCommandLine"
| extend TargetsCredentials = ProcessCommandLine has_any (CredentialTargets);
// Branch 3: PowerShell NinjaCopy or raw disk access
let NinjaCopyOps = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any (
"NinjaCopy", "Invoke-NinjaCopy",
"GetDriveGeometry", "FSCTL_GET_NTFS_VOLUME_DATA",
"DeviceIoControl", "CreateFile.*\\\\\\.\\\\Harddisk",
"PhysicalDrive", "HarddiskVolume"
)
| extend DetectionBranch = "PowerShellDirectVolumeAccess"
| extend TargetsCredentials = ProcessCommandLine has_any (CredentialTargets);
// Branch 4: File events — reads from shadow copy paths
let ShadowCopyFileAccess = DeviceFileEvents
| where Timestamp > ago(24h)
| where FolderPath has_any ("HarddiskVolumeShadowCopy", "GLOBALROOT\\Device")
| where FileName has_any (CredentialTargets)
| extend DetectionBranch = "CredentialFileReadFromShadowCopy"
| extend TargetsCredentials = true
| project Timestamp, DeviceName, AccountName,
FileName, FolderPath, InitiatingProcessFileName,
InitiatingProcessCommandLine, DetectionBranch, TargetsCredentials;
union
(ShadowCopyOps | project Timestamp, DeviceName, AccountName, FileName,
ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine,
DetectionBranch, TargetsCredentials),
(DirectVolumeOps | project Timestamp, DeviceName, AccountName, FileName,
ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine,
DetectionBranch, TargetsCredentials),
(NinjaCopyOps | project Timestamp, DeviceName, AccountName, FileName,
ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine,
DetectionBranch, TargetsCredentials)
| sort by Timestamp desc
| extend RiskScore = case(
TargetsCredentials == true, "Critical",
DetectionBranch == "PowerShellDirectVolumeAccess", "High",
DetectionBranch == "ShadowCopyOrVSSToolUsage", "Medium",
"Medium"
) Detects direct volume access patterns across four detection branches: (1) shadow copy creation and manipulation tools (vssadmin, esentutl, diskshadow, ntdsutil, wbadmin) with suspicious flags; (2) any process with direct volume path references (\\?\GLOBALROOT, PhysicalDrive, HarddiskVolumeShadowCopy) in command lines; (3) PowerShell-based direct volume access tools such as NinjaCopy; and (4) file read events targeting credential stores (ntds.dit, SAM, SYSTEM) from shadow copy device paths. Risk scoring escalates when credential file targets are identified. Uses both DeviceProcessEvents and DeviceFileEvents from Microsoft Defender for Endpoint.
Data Sources
Required Tables
False Positives
- Legitimate backup software (Veeam, Acronis, Windows Server Backup) uses VSS APIs and vssadmin/wbadmin to create and manage shadow copies as part of normal backup jobs — correlate with scheduled backup windows
- Database administrators using esentutl for legitimate NTDS or Exchange database maintenance, repair, or integrity checks — verify against change management tickets
- Windows built-in System Restore and automatic shadow copy creation triggered by system updates or restore point schedules — check InitiatingProcessFileName for svchost.exe or vssvc.exe as parent
- Security and compliance tools (CyberArk, BeyondTrust, Varonis) that enumerate shadow copies during privileged access audits or data classification scans
- Forensic and incident response tooling run by authorized responders using disk imaging utilities that access raw volumes
Sigma rule & cross-platform mapping
The detection logic for Direct Volume Access (T1006) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1006
References (10)
- https://attack.mitre.org/techniques/T1006/
- https://github.com/PowerShellMafia/PowerSploit/blob/master/Exfiltration/Invoke-NinjaCopy.ps1
- https://lolbas-project.github.io/lolbas/Binaries/Esentutl/
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/vssadmin
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskshadow
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc753455(v=ws.11)
- https://www.microsoft.com/en-us/security/blog/2023/10/25/octo-tempest-crosses-boundaries-to-facilitate-extortion-encryption-and-destruction/
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-038a
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1006/T1006.md
- http://www.codeproject.com/Articles/32169/FDump-Dumping-File-Sectors-Directly-from-Disk-usin
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1VSS Shadow Copy Creation and NTDS Extraction via esentutl
Expected signal: Sysmon Event ID 1: Process Create for vssadmin.exe with CommandLine containing 'create shadow /for=C:'. Second Sysmon Event ID 1: esentutl.exe with CommandLine containing the \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy path and '/vss'. Security Event ID 4688 for both processes if command line auditing is enabled. Microsoft-Windows-StorageService/Operational events for VSS snapshot creation. Sysmon Event ID 11 (File Create) for SYSTEM.bak in %TEMP%.
- Test 2Diskshadow Script-Based Shadow Copy and File Exposure
Expected signal: Sysmon Event ID 1: diskshadow.exe with CommandLine containing '/s' and the .dsh script path. Sysmon Event ID 11: creation of dsh_test.dsh in %TEMP% by powershell.exe. Security Event ID 4688 for diskshadow.exe. Microsoft-Windows-StorageService/Operational events for VSS snapshot creation via diskshadow. If drive Z: is exposed, subsequent file access on Z: generates normal file system events attributed to the accessing process.
- Test 3ntdsutil IFM Media Creation for NTDS Extraction
Expected signal: Sysmon Event ID 1: ntdsutil.exe with CommandLine containing 'ifm', 'create full', and the output path. Security Event ID 4688 for ntdsutil.exe. On a domain controller: Security Event ID 4656/4663 for NTDS directory handle access, and Sysmon Event ID 11 for file creation of ntds.dit and SYSTEM in the IFM output directory. On a non-DC: ntdsutil exits with an error (0x80070003 - path not found for NTDS) but process creation event still fires.
- Test 4PowerShell Direct Physical Drive Read Simulation
Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing '\\.\PhysicalDrive0' and 'FileOpen'. Security Event ID 4688 if command line auditing is enabled. If Object Access auditing covers raw disk handles: Security Event ID 4656 for handle request to PhysicalDrive0. This command will fail with 'Access Denied' for non-elevated users, but the process creation event still fires and matches the detection pattern.
Response Playbook
Triage
- Identify the tool and command used — vssadmin, esentutl, diskshadow, ntdsutil IFM, wbadmin, or PowerShell NinjaCopy. Each has different typical usage patterns: esentutl /y with a GLOBALROOT path is almost never legitimate outside a forensics or backup context.
- Check the parent process — was the volume access tool launched by a user interactively (explorer.exe, cmd.exe from a logon session), a scheduled task (taskeng.exe, svchost.exe), or a remote access tool? Interactive execution by a non-admin on a domain controller is a critical escalation trigger.
- Identify the target of the volume access — does the command reference ntds.dit, SYSTEM, SAM, or SECURITY hive? These are credential stores. Any shadow copy access targeting these files warrants immediate escalation regardless of context.
- Verify the user account — is this a domain admin, backup service account, or standard user? Check whether the account has a legitimate operational reason (scheduled backup job, DBA activity). Cross-reference with Active Directory group membership and recent logon events (Event ID 4624).
- Check the host role — is this a domain controller, file server, or workstation? Shadow copy operations on domain controllers targeting NTDS are extremely high severity. The same operation on a file server during a backup window may be routine.
- Correlate with recent events on the same host — look for preceding reconnaissance commands (nltest, net group, dsquery), lateral movement (PsExec, WMI, RDP), or privilege escalation in the 30-60 minutes before this event. Volume access is often a late-stage technique.
- For esentutl commands: decode the full source and destination paths in the /y flag arguments. A path like /y \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\ntds.dit /vss is unambiguously malicious.
- For diskshadow: examine the full script if a script file was passed. Attackers frequently use diskshadow with a pre-written .dsh script to automate shadow creation and exposure while evading simple command-line detections.
Containment
- If ntds.dit or credential hive access confirmed: treat as full domain compromise. Immediately escalate to the incident response team lead and initiate the domain compromise runbook — this requires a full forest password reset including krbtgt (twice, 10 hours apart) and all privileged accounts.
- Isolate the host from the network using EDR network isolation or emergency VLAN change to prevent exfiltration of any files already copied. Check DeviceNetworkEvents or Sysmon Event ID 3 for outbound connections in the minutes following the volume access.
- Disable the account that performed the action in Active Directory — revoke all Kerberos tickets with a password reset (which invalidates existing TGTs) and terminate any active sessions via Event ID 4647 and logoff enforcement.
- Preserve the VSS shadow copies on the affected host before remediation — do NOT delete them, as they are forensic evidence. Document the shadow copy GUIDs with: vssadmin list shadows /for=C:
- If a file was successfully exfiltrated (check file creation events and network events), block the destination IP/domain at the perimeter firewall and proxy and initiate threat intelligence lookup.
- For domain controllers: verify ntds.dit integrity on all DCs using repadmin /showrepl and check for unauthorized AD object changes using Get-ADObject with -IncludeDeletedObjects in the past 24 hours.
Evidence Collection
- Process creation logs — Sysmon Event ID 1 or Security Event ID 4688 (requires 'Audit Process Creation' and 'Include command line in process creation events' GPO): capture the full command line with all arguments for the volume access tool.
- File creation and access events — Sysmon Event ID 11 (File Created) for any output files written by esentutl or diskshadow. Check for new .dit, .bak, or archive files created in temp directories or unusual paths.
- VSS audit events — Windows Event Log: Microsoft-Windows-StorageService/Operational and Microsoft-Windows-VolumeSnapshot-Driver/Operational contain VSS snapshot creation and deletion records with timestamps and requestor process.
- Security Event ID 4656/4663 — Object Access auditing for file and directory handles. If enabled, these show direct file system object access and are crucial for confirming ntds.dit was read.
- Security Event ID 4698/4702 — Scheduled Task creation or modification: adversaries may create a task to run volume access tools under a privileged account context.
- PowerShell ScriptBlock Logging (Event ID 4104) — if NinjaCopy or custom PowerShell volume access scripts were used, this log contains the full deobfuscated script content including all parameters.
- Network forensics — capture and preserve pcap or flow records from the host's network interface during the incident window, particularly any large outbound data transfers following the volume access event.
- MFT ($MFT) and USN Journal — use tools like MFTECmd or analyzeMFT to identify recently created files on the host that may represent the exfiltrated credential stores. The USN journal contains a detailed record of file system changes.
Escalation Criteria
- ! Any command directly targeting ntds.dit, SYSTEM, or SAM hive via shadow copy or direct volume path — treat as credential theft in progress regardless of whether the copy succeeded.
- ! esentutl or diskshadow execution on a domain controller by any account other than the designated backup service account with a current change ticket.
- ! PowerShell invoking NinjaCopy or direct physical drive access — this is a known offensive tool pattern with no common administrative use case.
- ! Shadow copy creation immediately followed (within minutes) by a large file copy operation or outbound network transfer — indicates complete extract-and-exfiltrate sequence.
- ! Volume access tool launched by a process that itself was spawned by a remote execution framework (PsExec parent, WmiPrvSE.exe parent, mstsc.exe session) — indicates active hands-on-keyboard attacker.
- ! Multiple domain controllers showing shadow copy creation events within the same time window — indicates automated lateral movement or a worm-like propagation pattern.
Investigation Guide
Forensic Artifacts
- >
Registry: HKLM\SYSTEM\CurrentControlSet\Services\VSS — VSS service configuration and provider registration; check LastModified time for recent changes - >
Event Log: Microsoft-Windows-StorageService/Operational — records VSS snapshot creation requests with requesting process PID and timestamp - >
Event Log: Microsoft-Windows-VolumeSnapshot-Driver/Operational — low-level VSS driver events including shadow copy creation and deletion - >
File System: C:\Windows\System32\winevt\Logs\ — check for recently modified or cleared event log files; Event ID 1102 indicates log clearing - >
File System: %TEMP%, %APPDATA%, C:\Windows\Temp — common staging locations for files copied via esentutl or diskshadow before exfiltration - >
Prefetch: C:\Windows\Prefetch\ESENTUTL.EXE-*.pf, VSSADMIN.EXE-*.pf, DISKSHADOW.EXE-*.pf — execution timestamps and referenced DLLs/files - >
Volume Shadow Copies: Run 'vssadmin list shadows /for=C:' to enumerate existing shadows and their creation times; compare against known backup schedules - >
Windows Backup Database: C:\Windows\System32\wbem\Repository — contains WMI VSS provider state; also check C:\WindowsImageBackup for wbadmin artifacts - >
MFT and USN Journal: Use MFTECmd to identify file creation timestamps around the incident window, particularly for .dit files or large binary files in temp locations - >
Security Event ID 4656/4663 — if Object Access auditing is enabled for C:\Windows\NTDS\, these events record NTDS directory handle access with the requesting process
Tuning Guidance
The primary source of false positives is legitimate backup infrastructure. Before deploying, inventory all backup agents, software, and service accounts in your environment: Veeam (typically runs as SYSTEM or a dedicated service account and spawns vssvc.exe), Windows Server Backup (uses wbadmin.exe with predictable schedules), and Acronis or similar agents. Build allowlist entries based on specific service account + parent process combinations rather than tool name alone — never exclude vssadmin.exe globally. For domain controllers specifically, the detection threshold should be zero tolerance: any interactive or scheduled task execution of esentutl, diskshadow, or ntdsutil IFM on a DC outside of a documented backup window should immediately alert. In environments where ntdsutil IFM is used for legitimate DC promotion (creating IFM media for new DC installs), validate against Active Directory site topology changes. For the PowerShell NinjaCopy branch, false positives are rare — this is an offensive-only tool. For the direct volume path detection, tune by excluding known backup tool executables in the InitiatingProcessFileName field rather than by command line patterns. Enable Windows Object Access auditing for the C:\Windows\NTDS directory on all domain controllers (Computer Configuration > Windows Settings > Security Settings > Advanced Audit Policy > Object Access > Audit File System) to get Event ID 4663 records that independently confirm file access.
Hunting Queries
Hunt for file creation events referencing shadow copy device paths or credential store filenames. This captures the file system artifact of a successful extraction — when esentutl or a custom tool writes the copied credential file to a staging location. Excludes legitimate VSS service processes to reduce false positives.
DeviceFileEvents
| where Timestamp > ago(7d)
| where FolderPath has_any ("HarddiskVolumeShadowCopy", "GLOBALROOT\\Device", "\\\\.\\")
or FileName in~ ("ntds.dit", "ntds.jfm", "SAM", "SECURITY", "SYSTEM")
| where not (InitiatingProcessFileName in~ ("vssvc.exe", "WmiPrvSE.exe", "svchost.exe"))
| summarize
AccessCount = count(),
UniqueFiles = make_set(FileName),
Paths = make_set(FolderPath),
Processes = make_set(InitiatingProcessFileName)
by DeviceName, InitiatingProcessAccountName, bin(Timestamp, 1h)
| where AccessCount > 0
| sort by AccessCount desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
(TargetFilename="*HarddiskVolumeShadowCopy*" OR TargetFilename="*GLOBALROOT*"
OR TargetFilename="*ntds.dit*" OR TargetFilename="*\\SAM" OR TargetFilename="*\\SECURITY"
OR TargetFilename="*\\SYSTEM")
NOT (Image="*\\vssvc.exe" OR Image="*\\WmiPrvSE.exe" OR Image="*\\svchost.exe")
| stats count as FileEvents, values(TargetFilename) as Files, dc(TargetFilename) as UniqueFiles
by host, User, Image, ParentImage
| sort - FileEvents Hunt for the attack sequence: shadow copy creation (vssadmin create shadow) followed within 30 minutes by a file copy tool (esentutl, robocopy, PowerShell) referencing the shadow copy device path or credential file names. This temporal correlation catches multi-step credential extraction chains that individual command detections might miss.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "vssadmin.exe"
| where ProcessCommandLine has "create shadow"
| join kind=inner (
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("esentutl.exe", "robocopy.exe", "xcopy.exe", "powershell.exe")
| where ProcessCommandLine has_any ("HarddiskVolumeShadowCopy", "GLOBALROOT", "ntds", "SAM", "SYSTEM")
| project JoinTimestamp = Timestamp, DeviceName, FollowOnTool = FileName,
FollowOnCmdLine = ProcessCommandLine, AccountName
) on DeviceName
| where JoinTimestamp between (Timestamp .. (Timestamp + 30min))
| project ShadowCreateTime = Timestamp, DeviceName, AccountName, ProcessCommandLine,
FollowOnTool, FollowOnCmdLine, JoinTimestamp
| sort by ShadowCreateTime desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
Image="*\\vssadmin.exe" CommandLine="*create shadow*"
| rename _time as ShadowCreateTime, host as TargetHost
| join type=inner TargetHost [
search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\esentutl.exe" OR Image="*\\robocopy.exe" OR Image="*\\powershell.exe")
(CommandLine="*HarddiskVolumeShadowCopy*" OR CommandLine="*GLOBALROOT*" OR CommandLine="*ntds*")
| rename host as TargetHost, _time as FollowOnTime, Image as FollowOnTool, CommandLine as FollowOnCmd
| table TargetHost, FollowOnTime, FollowOnTool, FollowOnCmd
]
| where (FollowOnTime - ShadowCreateTime) >= 0 AND (FollowOnTime - ShadowCreateTime) <= 1800
| table ShadowCreateTime, TargetHost, User, CommandLine, FollowOnTime, FollowOnTool, FollowOnCmd
| sort - ShadowCreateTime Hunt specifically for esentutl invocations where the /y (source) argument resolves to a VSS shadow copy device path or credential store name. Extracts source and destination paths from the command line to make the intent immediately visible without manual log parsing. This technique is a hallmark of the Scattered Spider, Volt Typhoon, and many ransomware group TTPs.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "esentutl.exe"
| extend SourcePath = extract(@"/y\s+([^\s]+)", 1, ProcessCommandLine)
| extend DestPath = extract(@"/d\s+([^\s]+)", 1, ProcessCommandLine)
| extend IsVSSSource = SourcePath has_any ("HarddiskVolumeShadowCopy", "GLOBALROOT", "PhysicalDrive")
| extend IsCredentialTarget = SourcePath has_any ("ntds.dit", "SAM", "SECURITY", "SYSTEM", "NTDS")
| where IsVSSSource or IsCredentialTarget
| project Timestamp, DeviceName, AccountName, ProcessCommandLine,
SourcePath, DestPath, IsVSSSource, IsCredentialTarget,
InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
Image="*\\esentutl.exe"
| rex field=CommandLine "/y\s+(?P<SourcePath>\S+)"
| rex field=CommandLine "/d\s+(?P<DestPath>\S+)"
| eval IsVSSSource=if(match(SourcePath, "(HarddiskVolumeShadowCopy|GLOBALROOT|PhysicalDrive)"), 1, 0)
| eval IsCredentialTarget=if(match(lower(SourcePath), "(ntds\.dit|\bsam\b|\bsecurity\b|\bsystem\b|ntds)"), 1, 0)
| where IsVSSSource=1 OR IsCredentialTarget=1
| table _time, host, User, CommandLine, SourcePath, DestPath, IsVSSSource, IsCredentialTarget, ParentImage
| sort - _time Atomic Red Team Tests
Simulates the Scattered Spider and Volt Typhoon TTP: creates a Volume Shadow Copy of the C: drive using vssadmin, then uses esentutl to copy a file from the shadow copy path. On a non-domain-controller, substitutes a benign system file (ntds.dit substitute). This is the most common real-world credential extraction sequence and should trigger both the shadow copy creation detection and the esentutl VSS path detection.
Command
vssadmin create shadow /for=C: 2>&1 | Tee-Object -Variable vssOutput; $shadowId = ($vssOutput | Select-String 'Shadow Copy Volume Name:').ToString().Split(':',2)[1].Trim(); Write-Host "Shadow path: $shadowId"; esentutl.exe /y "${shadowId}\Windows\System32\config\SYSTEM" /d "$env:TEMP\SYSTEM.bak" /vss Cleanup
Remove-Item "$env:TEMP\SYSTEM.bak" -ErrorAction SilentlyContinue; vssadmin delete shadows /for=C: /quiet 2>$null Expected Telemetry
Sysmon Event ID 1: Process Create for vssadmin.exe with CommandLine containing 'create shadow /for=C:'. Second Sysmon Event ID 1: esentutl.exe with CommandLine containing the \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy path and '/vss'. Security Event ID 4688 for both processes if command line auditing is enabled. Microsoft-Windows-StorageService/Operational events for VSS snapshot creation. Sysmon Event ID 11 (File Create) for SYSTEM.bak in %TEMP%.
Expected Detection
Branch 1 (ShadowCopyOrVSSToolUsage) fires on vssadmin create shadow. Branch 2 (EsentutlVSS in SPL, DirectVolumePathInCommandLine in KQL) fires on esentutl with GLOBALROOT path. File creation event for SYSTEM.bak triggers if DeviceFileEvents branch is active. RiskScore: Critical if SYSTEM is matched in CredentialTargets.
Uses diskshadow.exe with a script file to create a shadow copy and expose it as a drive letter — the technique documented in multiple ransomware and APT playbooks. Diskshadow accepts a script file that automates the multi-step process attackers use to avoid interactive command-line exposure. The exposed shadow drive is then accessible for direct file reads bypassing ACLs.
Command
$script = @"
set context persistent nowriters
add volume c: alias dftest
create
expose %dftest% z:
"@; $script | Out-File -Encoding ASCII "$env:TEMP\dsh_test.dsh"; diskshadow.exe /s "$env:TEMP\dsh_test.dsh"; Start-Sleep 3; if (Test-Path 'Z:\Windows\System32\config\SAM') { Write-Host 'SAM accessible via shadow at Z:\Windows\System32\config\SAM' } Cleanup
diskshadow.exe /s { unexpose z: } 2>$null; vssadmin delete shadows /for=C: /quiet 2>$null; Remove-Item "$env:TEMP\dsh_test.dsh" -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 1: diskshadow.exe with CommandLine containing '/s' and the .dsh script path. Sysmon Event ID 11: creation of dsh_test.dsh in %TEMP% by powershell.exe. Security Event ID 4688 for diskshadow.exe. Microsoft-Windows-StorageService/Operational events for VSS snapshot creation via diskshadow. If drive Z: is exposed, subsequent file access on Z: generates normal file system events attributed to the accessing process.
Expected Detection
SPL and KQL both detect diskshadow.exe execution (ToolCategory=DiskShadow / DetectionBranch=ShadowCopyOrVSSToolUsage). PowerShell creating the .dsh script file may additionally trigger T1059.001 detections. The exposed drive access does not directly generate VSS-path events but follow-on file reads from Z:\Windows\System32\config\ are detectable via file monitoring.
Uses ntdsutil in IFM (Install From Media) mode — a legitimate Active Directory tool for creating installation media for new domain controllers. Attackers abuse this built-in mechanism to dump the NTDS database and SYSTEM hive into a folder, bypassing direct file access restrictions. On a non-DC, ntdsutil IFM will fail with an error but still generates the expected process creation telemetry. Run on a test DC for full telemetry.
Command
ntdsutil.exe "ac i ntds" "ifm" "create full $env:TEMP\ntdsutil_ifm_test" q q Cleanup
Remove-Item "$env:TEMP\ntdsutil_ifm_test" -Recurse -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 1: ntdsutil.exe with CommandLine containing 'ifm', 'create full', and the output path. Security Event ID 4688 for ntdsutil.exe. On a domain controller: Security Event ID 4656/4663 for NTDS directory handle access, and Sysmon Event ID 11 for file creation of ntds.dit and SYSTEM in the IFM output directory. On a non-DC: ntdsutil exits with an error (0x80070003 - path not found for NTDS) but process creation event still fires.
Expected Detection
SPL ToolCategory=NtdsutilIFM fires immediately. KQL DetectionBranch=ShadowCopyOrVSSToolUsage fires on ntdsutil with 'ifm' in command line. TargetsCredentials=1 if 'ntds' appears in the output path argument. On a DC, the file creation of ntds.dit sets RiskScore=Critical.
Simulates the NinjaCopy technique by opening a direct handle to the physical drive using .NET File I/O — the same underlying mechanism used by Invoke-NinjaCopy from PowerSploit. This bypasses NTFS file locking by reading sectors directly from the physical disk. On standard endpoints, this requires elevated privileges. The command opens \\.\ PhysicalDrive0 for raw reading, which generates the expected process-to-device telemetry.
Command
powershell.exe -NoProfile -Command "$fs = [System.IO.File]::Open('\\\\.\\PhysicalDrive0', [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite); $buf = New-Object byte[] 512; $read = $fs.Read($buf, 0, 512); Write-Host "MBR signature bytes: $($buf[510].ToString('X2')) $($buf[511].ToString('X2'))"; $fs.Close()" Expected Telemetry
Sysmon Event ID 1: powershell.exe with CommandLine containing '\\.\PhysicalDrive0' and 'FileOpen'. Security Event ID 4688 if command line auditing is enabled. If Object Access auditing covers raw disk handles: Security Event ID 4656 for handle request to PhysicalDrive0. This command will fail with 'Access Denied' for non-elevated users, but the process creation event still fires and matches the detection pattern.
Expected Detection
KQL branch PowerShellDirectVolumeAccess fires on 'PhysicalDrive' in the PowerShell command line. SPL query matches on CommandLine containing '\\.\PhysicalDrive'. DetectionBranch=PowerShellDirectVolumeAccess. RiskScore=High. Alert text should note that elevation check (SYSTEM or admin account) is an additional severity indicator.