Detection rule
Deleted Data Overwritten Via Cipher.EXE
Overview
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. Data destruction is likely to render stored data irrecoverable by forensic techniques through overwriting files or data on local and remote drives
- Rule id
4b046706-5789-4673-b111-66f25fe99534- ATT&CK techniques
- T1485 Data Destruction
- Severity
- Medium
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- safepay, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
2 of 2 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 4b046706-5789-4673-b111-66f25fe99534
title: Deleted Data Overwritten Via Cipher.EXE
id: 4b046706-5789-4673-b111-66f25fe99534
status: test
description: |
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.
Data destruction is likely to render stored data irrecoverable by forensic techniques through overwriting files or data on local and remote drives
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1485/T1485.md#atomic-test-3---overwrite-deleted-data-on-c-drive
author: frack113
date: 2021-12-26
modified: 2023-02-21
tags:
- attack.impact
- attack.t1485
logsource:
category: process_creation
product: windows
detection:
selection_img:
- OriginalFileName: 'CIPHER.EXE'
- Image|endswith: '\cipher.exe'
selection_cli:
CommandLine|contains: ' /w:'
condition: all of selection_*
falsepositives:
- Unknown
level: medium
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_cipher_overwrite_deleted_data/info.yml
simulation:
- type: atomic-red-team
name: Overwrite deleted data on C drive
technique: T1485
atomic_guid: 321fd25e-0007-417f-adec-33232252be19QRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND (Filename='CIPHER.EXE' OR (LOWER("Process Path") LIKE '%\cipher.exe' OR LOWER("Process Name") LIKE '%\cipher.exe')) AND LOWER(Command) LIKE '% /w:%'QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Deleted Data Overwritten Via Cipher.EXE- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:Deleted Data Overwritten Via Cipher EXE:selection_img(match)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.Filenameis equal to (case-insensitive):CIPHER.EXEProcess Path / Process Nameends with:\cipher.exe
BB:OffSet7:Deleted Data Overwritten Via Cipher EXE:selection_cli(match)All test lines must match (AND).Commandcontains:/w:
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
(ALL of [BB:OffSet7:Deleted Data Overwritten Via Cipher EXE:selection_img, BB:OffSet7:Deleted Data Overwritten Via Cipher EXE:selection_cli])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND (Filename='CIPHER.EXE' OR (LOWER("Process Path") LIKE '%\cipher.exe' OR LOWER("Process Name") LIKE '%\cipher.exe')) AND LOWER(Command) LIKE '% /w:%'
Rule response
- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
(OriginalFileName="CIPHER.EXE" OR Image="*\\cipher.exe") CommandLine="* /w:*"Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Deleted Data Overwritten Via Cipher.EXE]
description = 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.Data destruction is likely to render stored data irrecoverable by forensic techniques through overwriting files or data on local and remote drives
search = (OriginalFileName="CIPHER.EXE" OR Image="*\\cipher.exe") CommandLine="* /w:*"Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where (TargetProcessFileOriginalName =~ "CIPHER.EXE" or TargetProcessName endswith "\\cipher.exe") and TargetProcessCommandLine contains " /w:"Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where (ProcessVersionInfoOriginalFileName =~ "CIPHER.EXE" or FolderPath endswith "\\cipher.exe") and ProcessCommandLine contains " /w:"Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
(process.pe.original_file_name:CIPHER.EXE OR process.executable:*\\cipher.exe) AND process.command_line:*\ \/w\:*Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where (process.pe.original_file_name:"CIPHER.EXE" or process.executable:"*\\cipher.exe") and process.command_line:"* /w:*"Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where (process.pe.original_file_name=="CIPHER.EXE" or ends_with(process.executable, "\\cipher.exe")) and process.command_line like "* /w:*"Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageOriginalFileName
False positives
- Unknown
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- frack113
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_cipher_overwrite_deleted_data.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2