Defense evasion · Windows · LOLBAS
cipher.exe
Cipher
Manages EFS encryption, and with /w it overwrites free space so deleted files cannot be recovered. That wipe is used as anti-forensics after files are deleted.
Legitimate use
Used to manage EFS encryption and to securely clear free space.
Switches
Overwrites free space on a volume, erasing the content of previously deleted files.
MediumEncrypts folders and files.
LowDecrypts folders and files.
LowApplies the operation to a folder and its subfolders.
InfoCommand lines to worry about
- Medium
Free space wiped with cipher
cipher /w overwrites free space so deleted files cannot be carved back. Seen after evidence or tools are deleted.
Detection regex
cipher(\.exe)?\s+\/w
Where it is recorded
- Security4688Process creation with the full command line, when command-line auditing is enabled.
- Sysmon1Process creation with command line, hashes and parent process.
Community detections
2 SigmaHQ rules for cipher.exe. The explainer checks every pasted command line against all of them.
- HighSuspicious Spool Service Child Process
Detects suspicious print spool service (spoolsv.exe) child processes.
T1203T1068by Justin C. (@endisphotic), @dreadphones (detection), Thomas Patzke (Sigma rule)
- MediumDeleted Data Overwritten Via Cipher.EXE
Detects usage of the "cipher" built-in utility in order to overwrite deleted data from disk. Adversaries may destroy data and files on specific systems or in large numbers on a network to interrupt availability to systems, services, and network resources.
T1485by frack113
Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.