Disk Structure Wipe
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.
// Detection 1: Processes with raw physical disk handle access patterns
let PhysicalDriveAccess = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has "PhysicalDrive"
or ProcessCommandLine has "\\\\.\\PHYSICALDRIVE"
or ProcessCommandLine has "physicaldrive"
| extend AccessType = "RawDiskHandle"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
ProcessId, InitiatingProcessId, AccessType;
// Detection 2: dd.exe or disk utility wipe commands
let WiperToolCommands = DeviceProcessEvents
| where Timestamp > ago(24h)
| where (
(FileName =~ "dd.exe" and (ProcessCommandLine has "PhysicalDrive" or ProcessCommandLine has "if=/dev/zero" or ProcessCommandLine has "if=/dev/urandom"))
or (FileName =~ "diskpart.exe" and InitiatingProcessFileName !in~ ("mmc.exe", "diskmgmt.msc"))
or (FileName in~ ("shred", "wipe") and ProcessCommandLine has_any ("/dev/sd", "/dev/hd", "/dev/nvme", "/dev/vd"))
)
| extend AccessType = "WiperTool"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
ProcessId, InitiatingProcessId, AccessType;
// Detection 3: Known wiper driver files dropped to non-standard paths
let WiperDriverDrop = DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName endswith ".sys"
| where (
FileName has_any ("elrawdsk", "ElRawDisk", "epmntdrv", "EPMNTDRV", "HermeticWiper")
or (FolderPath has_any ("Temp", "AppData", "ProgramData", "Downloads") and FileName endswith ".sys")
)
| extend AccessType = "WiperDriverDrop"
| project Timestamp, DeviceName, FileName, FolderPath,
InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName,
AccessType;
// Detection 4: Suspicious service installation for raw disk drivers (Event ID 7045)
let ServiceInstall = SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID == 7045
| where ServiceType =~ "kernel mode driver"
| where ServiceFileName has_any ("Temp", "AppData", "ProgramData", "Users", "Downloads")
| extend AccessType = "SuspiciousDriverService"
| project TimeGenerated as Timestamp, Computer as DeviceName, ServiceName, ServiceFileName, AccessType;
union isfuzzy=true PhysicalDriveAccess, WiperToolCommands
| extend IsKnownWiper = FileName has_any ("Shamoon", "wiper", "HermeticWiper", "KillDisk", "CaddyWiper")
| extend IsDDTool = FileName =~ "dd.exe"
| extend IsDiskpart = FileName =~ "diskpart.exe"
| extend HasPhysicalDriveRef = ProcessCommandLine has "PhysicalDrive"
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- 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 and benchmarking utilities (CrystalDiskInfo, HD Tune, manufacturer tools like Seagate SeaTools) that read raw disk sectors to retrieve SMART data or perform surface scans
- Forensic acquisition tools (FTK Imager, dc3dd, Paladin) used by security teams that write forensic images by accessing physical disk handles directly
- System administrators using dd.exe (GnuWin32/UnxUtils port) for disk cloning or image creation in lab and deployment environments
- Virtualization platforms (VMware vSphere, VirtualBox, Hyper-V) that create and manage virtual disk files using driver-level disk access
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.