T1561.002 Elastic Security · Elastic

Detect Disk Structure Wipe in Elastic Security

Adversaries may corrupt or wipe disk data structures such as the Master Boot Record (MBR), GUID Partition Table (GPT), or partition entries to render systems permanently unbootable. Wiper malware (Shamoon, HermeticWiper, WhisperGate, CaddyWiper, KillDisk) achieves this by opening a handle to raw physical disk devices (e.g., \\.\PhysicalDrive0) and overwriting the first 512 bytes (MBR boot sector) or subsequent partition structures. Some malware uses kernel-mode drivers such as ElRawDisk.sys (Shamoon) or the HermeticWiper EaseUS driver to bypass user-mode restrictions and gain direct disk sector access. On Linux systems, adversaries use utilities like dd with /dev/zero or /dev/urandom targeting /dev/sda or /dev/nvme0n1. This technique is frequently combined with worm-like propagation via SMB/Windows Admin Shares, Valid Accounts, and OS Credential Dumping to maximize organizational impact.

MITRE ATT&CK

Tactic
Impact
Technique
T1561 Disk Wipe
Sub-technique
T1561.002 Disk Structure Wipe
Canonical reference
https://attack.mitre.org/techniques/T1561/002/

Elastic Detection Query

Elastic Security (Elastic)
eql
any where
  /* Detection 1: Raw PhysicalDrive handle access in process command line */
  (
    event.category == "process" and event.type == "start" and
    process.command_line like~ "*PhysicalDrive*"
  ) or

  /* Detection 2: dd.exe targeting physical disk or wipe sources */
  (
    event.category == "process" and event.type == "start" and
    process.name like~ "dd.exe" and
    process.command_line like~ ("*PhysicalDrive*", "*if=/dev/zero*", "*if=/dev/urandom*")
  ) or

  /* Detection 3: diskpart.exe spawned outside legitimate management tools */
  (
    event.category == "process" and event.type == "start" and
    process.name like~ "diskpart.exe" and
    not process.parent.name in~ ("mmc.exe", "diskmgmt.msc", "taskschd.msc")
  ) or

  /* Detection 4: Known wiper driver file created in user-writable paths */
  (
    event.category == "file" and event.type in ("creation", "change") and
    file.name like~ "*.sys" and
    (
      file.name like~ ("*elrawdsk*", "*elrawdisk*", "*epmntdrv*", "*hermeticwiper*", "*killdisk*", "*caddywiper*") or
      file.path like~ ("*\\Temp\\*", "*\\AppData\\*", "*\\ProgramData\\*", "*\\Downloads\\*")
    )
  ) or

  /* Detection 5: Known wiper kernel driver load (Sysmon EventCode 6) */
  (
    event.category == "driver" and
    file.name like~ ("*elrawdsk*", "*epmntdrv*", "*hermeticwiper*", "*killdisk*")
  ) or

  /* Detection 6: Kernel mode driver service installed from user-writable path (Event 7045) */
  (
    event.code == "7045" and
    winlog.event_data.ServiceType like~ "*kernel mode driver*" and
    winlog.event_data.ServiceFileName like~ ("*\\Temp\\*", "*\\AppData\\*", "*\\ProgramData\\*", "*\\Users\\*", "*\\Downloads\\*")
  )
critical severity high confidence

Detects disk structure wipe activity (T1561.002) across six detection vectors: raw PhysicalDrive handle access in command-line arguments, dd.exe or diskpart.exe wiper tool commands, known wiper driver file drops (elrawdsk, epmntdrv, HermeticWiper, KillDisk, CaddyWiper) to user-writable paths, known wiper kernel driver loads via Sysmon driver events, and suspicious kernel mode driver service installations from non-system directories (Event 7045). Covers wiper malware families including Shamoon, HermeticWiper, WhisperGate, CaddyWiper, and KillDisk.

Data Sources

Elastic Endpoint Security (logs-endpoint.events.*)Winlogbeat with SysmonWinlogbeat Windows Event Log

Required Tables

logs-endpoint.events.process-*logs-endpoint.events.file-*logs-endpoint.events.driver-*winlogbeat-*

False Positives & Tuning

  • Legitimate disk diagnostic utilities such as CrystalDiskInfo, HD Tune, or Macrorit Disk Partition Expert that open raw PhysicalDrive handles for health monitoring and SMART data collection
  • IT administrators running diskpart.exe from scripts (cmd.exe, powershell.exe) during OS imaging, MDT/WDS deployments, or partition management workflows rather than through the expected mmc.exe parent
  • Digital forensics and incident response tools (FTK Imager, dd.exe for forensic imaging, WinHex, Autopsy) that legitimately access raw disk sectors and may drop companion driver files during operation
Download portable Sigma rule (.yml)

Other platforms for T1561.002


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.

  1. Test 1MBR Overwrite Simulation on VHD (Windows, Safe)

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'PhysicalDrive'. Sysmon Event ID 11: File Creation for mbr-test.vhd in %TEMP%. DeviceProcessEvents will show the PowerShell process with the raw disk handle pattern. Windows Event ID 4688 (if command-line auditing enabled) captures the full PowerShell command. DeviceFileEvents captures the VHD file creation.

  2. Test 2Kernel Driver Drop to Temp Directory (Windows)

    Expected signal: Sysmon Event ID 11: File Created — TargetFilename matches '*\Temp\elrawdsk.sys'. Sysmon Event ID 1: Process Create for powershell.exe invoking New-Service. Windows System Event ID 7045: New Service Installed with ServiceName=RawDiskDrv, ServiceFileName pointing to %TEMP%\elrawdsk.sys, ServiceType=kernel mode driver. Security Event ID 4697: A service was installed in the system.

  3. Test 3Linux MBR Overwrite on Loop Device (Linux, Safe)

    Expected signal: Sysmon for Linux (if deployed): ProcessCreate event showing dd with arguments 'if=/dev/zero of=/dev/loop* bs=512 count=1'. auditd (if configured with execve rules): EXECVE record capturing the full dd command with the loop device path. /var/log/auth.log or journald: sudo/su records if the test required privilege elevation. bash_history: dd command with /dev/zero source.

  4. Test 4WhisperGate-Style Malicious Bootloader Drop Pattern (Windows)

    Expected signal: Sysmon Event ID 11: File Created — TargetFilename '$env:TEMP\stage1.bin'. Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing '[Convert]::FromBase64String' and 'WriteAllBytes'. PowerShell ScriptBlock Log Event ID 4104: full script with staging path and base64 operations. DeviceFileEvents: file creation event for stage1.bin in TEMP.

Unlock Pro Content

Get the full detection package for T1561.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections