Detect Disk Structure Wipe in Splunk
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/
SPL Detection Query
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="WinEventLog:System" OR sourcetype="WinEventLog:Security")
| eval DetectionVector=""
| eval IsMBRWipe=0
| eval IsDriverDrop=0
| eval IsServiceInstall=0
| eval IsWiperTool=0
``` Sysmon EventCode=1: Process Creation - raw disk access or dd/diskpart wipe patterns ```
| eval IsWiperTool=if(EventCode=1 AND (
(match(lower(Image), "\\dd\.exe$") AND (match(CommandLine, "PhysicalDrive") OR match(CommandLine, "if=/dev/zero") OR match(CommandLine, "if=/dev/urandom")))
OR (match(lower(Image), "\\diskpart\.exe$") AND NOT match(lower(ParentImage), "mmc\.exe"))
), 1, IsWiperTool)
| eval IsMBRWipe=if(EventCode=1 AND match(CommandLine, "(?i)PhysicalDrive"), 1, IsMBRWipe)
``` Sysmon EventCode=11: File Creation - wiper driver drops to user-writable paths ```
| eval IsDriverDrop=if(EventCode=11 AND match(lower(TargetFilename), "\.sys$") AND (
match(lower(TargetFilename), "(elrawdsk|elrawdisk|epmntdrv|hermeticwiper|killdisk)")
OR match(lower(TargetFilename), "(\\temp\\|\\appdata\\|\\programdata\\|\\users\\)") AND match(lower(TargetFilename), "\.sys$")
), 1, IsDriverDrop)
``` Sysmon EventCode=6: Driver Load - known wiper drivers ```
| eval IsDriverDrop=if(EventCode=6 AND match(lower(ImageLoaded), "(elrawdsk|epmntdrv|hermeticwiper)"), 1, IsDriverDrop)
``` Windows System Event 7045: New Service Install - kernel driver from suspicious path ```
| eval IsServiceInstall=if(EventCode=7045 AND match(lower(ServiceType), "kernel mode driver") AND match(lower(ServiceFileName), "(\\temp\\|\\appdata\\|\\programdata\\|\\users\\|\\downloads\\)"), 1, IsServiceInstall)
| eval SuspicionScore=IsMBRWipe + IsDriverDrop + IsServiceInstall + IsWiperTool
| where SuspicionScore > 0
| eval DetectionVector=case(
IsMBRWipe=1, "PhysicalDriveHandle",
IsDriverDrop=1, "WiperDriverDrop",
IsServiceInstall=1, "KernelDriverService",
IsWiperTool=1, "WiperToolCommand",
true(), "Unknown"
)
| table _time, host, User, Image, CommandLine, TargetFilename, ServiceFileName, ServiceName, ParentImage, DetectionVector, SuspicionScore
| sort - SuspicionScore, - _time Detects disk structure wiping using a multi-vector approach across Sysmon and Windows event logs. Event ID 1 identifies processes accessing raw PhysicalDrive handles or invoking dd/diskpart with destructive arguments. Event ID 11 catches kernel driver files (.sys) created in user-writable paths matching known wiper driver names (ElRawDisk.sys, epmntdrv.sys). Event ID 6 catches driver loads for known wiper kernel components. Windows System Event 7045 detects kernel driver service installations from non-standard paths. A suspicion score aggregates indicators for prioritization.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate disk imaging and backup software (Acronis True Image, Macrium Reflect, Clonezilla agent) that opens PhysicalDrive handles for sector-level backup and restore operations
- Hardware diagnostic tools (CrystalDiskInfo, manufacturer SMART utilities, HD Tune) that read raw disk sectors for health checks
- Forensic acquisition tools (FTK Imager, dc3dd) used by incident response teams accessing raw physical disk handles
- System administrators using dd.exe for disk cloning or forensic image acquisition in lab environments
- Virtualization drivers (VMware vmci.sys, VirtualBox vboxdrv.sys) legitimately installed as kernel drivers during software setup
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.
- 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.
- 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.
- 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.
- 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.
References (10)
- https://attack.mitre.org/techniques/T1561/002/
- https://www.symantec.com/connect/blogs/shamoon-attacks
- https://www.sentinelone.com/labs/hermetic-wiper-ukraine-under-attack/
- https://www.microsoft.com/en-us/security/blog/2022/01/15/destructive-malware-targeting-ukrainian-organizations/
- https://unit42.paloaltonetworks.com/shamoon-3-targets-oil-gas-organization/
- https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2018/03/07180722/Report_Shamoon_StoneDrill_final.pdf
- https://www.welivesecurity.com/2022/03/15/caddywiper-new-wiper-malware-discovered-ukraine/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1561.002/T1561.002.md
- https://docs.microsoft.com/sysinternals/downloads/sysmon
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
Unlock Pro Content
Get the full detection package for T1561.002 including response playbook, investigation guide, and atomic red team tests.