Encrypting Files with WinRar or 7z

Last updated a month ago on 2026-01-12
Created 5 years ago on 2020-12-04

About

Identifies the use of WinRAR or 7-Zip to create encrypted archives. Adversaries often compress and encrypt data in preparation for exfiltration.
Tags
Domain: EndpointOS: WindowsUse Case: Threat DetectionTactic: CollectionData Source: Elastic EndgameData Source: Elastic DefendData Source: SysmonData Source: Microsoft Defender for EndpointData Source: SentinelOneLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Collection (TA0009)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.process-*winlogbeat-*logs-windows.sysmon_operational-*endgame-*logs-m365_defender.event-*logs-sentinel_one_cloud_funnel.*
Related Integrations

endpoint(external, opens in a new tab or window)

windows(external, opens in a new tab or window)

m365_defender(external, opens in a new tab or window)

sentinel_one_cloud_funnel(external, opens in a new tab or window)

Query
text code block:
process where host.os.type == "windows" and event.type == "start" and ( ( ( process.name : ("rar.exe", "WinRAR.exe") or ?process.code_signature.subject_name == "win.rar GmbH" or ?process.pe.original_file_name == "WinRAR.exe" ) and process.args == "a" and process.args : ("-hp*", "-p*", "/hp*", "/p*") ) or ( (process.name : ("7z.exe", "7za.exe") or ?process.pe.original_file_name in ("7z.exe", "7za.exe")) and process.args == "a" and process.args : "-p*" ) ) and not process.parent.executable : ( "C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe", "?:\\ManageEngine\\*\\jre\\bin\\java.exe", "?:\\Nox\\bin\\Nox.exe", "\\Device\\HarddiskVolume?\\Program Files\\*.exe", "\\Device\\HarddiskVolume?\\Program Files (x86)\\*.exe", "\\Device\\HarddiskVolume?\\ManageEngine\\*\\jre\\bin\\java.exe", "\\Device\\HarddiskVolume?\\Nox\\bin\\Nox.exe" )

Install detection rules in Elastic Security

Detect Encrypting Files with WinRar or 7z in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).