Deep Dive 02 · Defense Evasion Engineering

From Defender Disk-Exhaustion DoS (fsutil.exe / BigDiskBuster) to Multi-SIEM & Kernel-Handle Detection

Disk-space starvation against Microsoft Defender updates (ERROR_DISK_FULL / 0x80070070) silently freezes platform and signature updates while keeping Defender services superficially nominal. This case study traces how a single threat model became a 5-stage defensive ecosystem—from Win32 kernel-handle correlation in BDB-Guardian (formally cited by CUHK ITSC) to merged documentation in LOLBAS, safe adversary emulation in Red Canary Atomic Red Team, and approved detections in SigmaHQ and Elastic Security.

MITRE ATT&CK: T1685 · T1562.001 Win32: Restart Manager · NtQuerySystemInformation Cited by: CUHK ITSC 10 min read

1. Threat Model: Native NT Allocation vs. fsutil.exe

Disk exhaustion as a defense-impairment primitive splits into two operational implementations that require completely different telemetry layers:

  • Variant A — Native NT API (BigDiskBuster): Disclosed in MSNightmare/BigDiskBuster and analyzed by LevelBlue SpiderLabs. The binary monitors the C: volume for Defender staging paths (ProgramData\Microsoft\Windows Defender\Platform\... and ...\Definition Updates\{GUID}) and holds an open handle on C:\Windows\System32\MRT.exe. The moment an update begins, it allocates a hidden GUID-braced file in %TEMP% sized to all available free space with FILE_DELETE_ON_CLOSE. Defender updates fail with ERROR_DISK_FULL, and when the update aborts, the PoC releases its handle and goes back to sleep.
  • Variant B — Built-in LOLBin (fsutil.exe file createnew): Documented upstream in LOLBAS #525 (yml/OSBinaries/Fsutil.yml). Any unprivileged User account can invoke fsutil.exe file createnew {PATH_ABSOLUTE} {LENGTH_IN_BYTES} to pre-allocate arbitrary dummy files instantly without dropping custom native binaries.
Telemetry Layer Catches Native BigDiskBuster? Catches fsutil.exe file createnew? Artifact / Project
Process Creation (EID 1 / EQL) No (uses direct NT syscalls, no fsutil child) Yes (file + createnew args or PE OriginalFileName) Elastic #6946
File Creation (Sysmon EID 11) Yes (if GUID-braced buster-file created in %TEMP%) Partial (only if targeting GUID pattern in %TEMP%) SigmaHQ #6310
Kernel Handle Correlation (Same-PID) Yes (detects dormant/active MRT.exe + volume handles before/during spike) Optional (disk-fill symptom via TEMP scan) BDB-Guardian

2. Closing the EDR Blind Spot: BDB-Guardian & Win32 Internals

Because Variant A leaves zero fsutil.exe process-creation events and deletes its buster-file via FILE_DELETE_ON_CLOSE as soon as the update aborts, BDB-Guardian approaches the problem from live kernel/userland state—correlating three independent Indicators of Compromise per Process ID:

# IoC Signal Collection Mechanism False-Positive Profile
1 Open handle on C:\Windows\System32\MRT.exe Windows Restart Manager (instant, exact) + native name-scan fallback Very high signal: legitimate processes do not hold persistent locks on MRT.exe.
2 Open handle on C: volume (\Device\HarddiskVolumeN) Parallel native handle scan (NtQuerySystemInformation / DuplicateHandle / NtQueryObject) Weak alone (OS services hold volume handles) → OS-service whitelist; capped at MEDIUM alone.
3 Oversized hidden GUID-braced file in %TEMP% User/system %TEMP% directory scan Medium (installers occasionally stage GUID fixtures).

Same-PID Correlation Verdict: When a single non-whitelisted PID simultaneously holds an open handle to MRT.exe and the system volume, the verdict escalates immediately to CRITICAL (near-zero false positives), and presence of the GUID buster-file confirms active BigDiskBuster-like execution. To isolate native Win32/P/Invoke memory from the PowerShell orchestrator, BDBMonitor.ps1 delegates all native calls to a dedicated child worker (Invoke-VolumeScan.ps1 + inline C# in bdb-csharp.ps1).

Engineering Post-Mortem: Fixing 0xC0000374 Heap Corruption & Named-Pipe Deadlocks

Two real Win32 pitfalls surfaced during live testing of BDB-Guardian—documented in the repo and reproduced in the evidence report:

  • RmGetList struct mismatch (0xC0000374): Calling RmGetList with a buffer sized for RM_UNIQUE_PROCESS instead of RM_PROCESS_INFO (~668 bytes/entry) triggers native heap corruption (STATUS_HEAP_CORRUPTION). Switching to RM_PROCESS_INFO with a proper resize retry loop eliminated all Application Error crashes across consecutive runs.
  • NtQueryObject pipe hang: Querying object names across arbitrary duplicated handles stalls indefinitely on synchronous named pipes. Filtering out handles where GetFileType != FILE_TYPE_DISK before calling NtQueryObject—backed by per-PID timeouts—eliminated hangs and cut full-system handle scan runtime from ~45 seconds down to 6–14 seconds.

3. Safe Adversary Emulation (Atomic Red Team #3439 — Test #79)

Validating endpoint detections on live infrastructure requires generating authentic fsutil.exe file createnew + hidden GUID file telemetry without actually exhausting the system volume and crashing the OS or EDR spoolers. Atomic Red Team PR #3439 (merged into T1685, published at atomicredteam.io/docs/atomics/T1685) enforces three strict safety invariants:

PowerShell · Atomic Red Team T1685 Test #79 (Executor Excerpt)
$targetPath = [System.IO.Path]::GetFullPath("#{file_path}") # default: $env:TEMP\{15755e6b-a54d-4a6e-9773-554c724f8a63}
$tempRoot = [System.IO.Path]::GetFullPath($env:TEMP).TrimEnd('\') + '\'
if (-not $targetPath.StartsWith($tempRoot, [System.StringComparison]::OrdinalIgnoreCase)) {
  throw "Refusing to create a test file outside the current user's TEMP directory: $targetPath"
}

& fsutil.exe file createnew $targetPath #{file_size_bytes} # default: 10485760 (10 MB)
[System.IO.File]::SetAttributes($targetPath, ([System.IO.File]::GetAttributes($targetPath) -bor [System.IO.FileAttributes]::Hidden))
# Writes 5-line .atomic-test-owner metadata (path + CreationTimeUtc + LastWriteTimeUtc + Length) for verified cleanup

Using a default 10 MB dummy allocation and recording exact NTFS timestamps + file length in an ownership marker ensures cleanup never deletes unrelated files even if the path is modified externally.

4. Multi-SIEM Detection Rules (SigmaHQ #6310 & Elastic #6946)

Sigma File Event Rule — SigmaHQ/sigma #6310 (Approved, 14/14 CI)

Catching the %TEMP%\{GUID} buster-file stage in Sysmon Event ID 11 (PR #6310) required tuning against real Windows 7/10/11/Server 2022 telemetry via evtx-sigma-checker. During review with maintainer @frack113, baseline runs surfaced legitimate GUID-named temp files from taskhost.exe, TeamViewer (tv_x64.exe/tv_w32.exe), and VS Code's cpptools.exe, which were explicitly filtered without weakening the core path regex:

YAML · file_event_win_bigdiskbuster_temp_file.yml (SigmaHQ #6310)
title: Potential BigDiskBuster-Like Buster-File Creation in TEMP
id: 15755e6b-a54d-4a6e-9773-554c724f8a63
status: experimental
author: DevCop95
date: 2026-09-20
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|re: '\\AppData\\Local\\Temp\\\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\}$'
    filter_main_generic:
        Image:
            - 'C:\Windows\System32\taskhost.exe'
            - 'C:\Windows\SysWOW64\taskhost.exe'
    filter_optional_teamviewer:
        Image|endswith:
            - '\TeamViewer\tv_x64.exe'
            - '\TeamViewer\tv_w32.exe'
    filter_optional_vscode:
        Image|contains: '\.vscode\extensions\'
        Image|endswith: '\cpptools.exe'
    filter_optional_dataset:
        Image|startswith: 'C:\Users\'
        Image|contains: '\AppData\Local\Temp\'
        Image|endswith: '\target.exe'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
level: medium

Elastic Security EQL Rule — elastic/detection-rules #6946 (Approved ×2)

For the LOLBin variant, elastic/detection-rules #6946 detects fsutil.exe file createnew across Elastic Defend, Microsoft Defender XDR, CrowdStrike, SentinelOne, Sysmon, and Windows Security Event Logs, resilient to binary renaming via ?process.pe.original_file_name:

EQL · defense_evasion_suspicious_file_creation_with_fsutil.toml (Elastic #6946)
process where host.os.type == "windows" and event.type == "start" and
  (process.name : "fsutil.exe" or ?process.pe.original_file_name == "fsutil.exe") and
  process.args : "file" and process.args : "createnew"

5. Triage & Incident Response Playbook

  1. Verify Defender operational health: Inspect Microsoft-Windows-Windows Defender/Operational logs for Event IDs 2000, 2001, and 1151 (signature/platform update failures with 0x80070070 / ERROR_DISK_FULL).
  2. Inspect parent process tree & open handles: Trace the parent of fsutil.exe (or run BDBMonitor.ps1 to catch native NT binaries holding MRT.exe + volume handles without process-creation artifacts).
  3. Remediate starvation & verify recovery: Terminate the offending parent tree, remove oversized dummy/GUID files in %TEMP%, confirm free disk space recovery, and force a Defender signature update + full scan for concurrent staging payloads.

6. Verified References