← Back to SOC feed Coverage →

detect-malicious-rar-extraction

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
backdoorexploithuntingmicrosoftofficialphishing
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-20T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use malicious RAR files to deliver payloads, leveraging CVE-2018-15982 to execute arbitrary code on compromised systems. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential exploitation of outdated Adobe Flash Player vulnerabilities.

KQL Query

DeviceProcessEvents
| where FileName == "cmd.exe"
| where ProcessCommandLine contains @"set path=%ProgramFiles(x86)%\WinRAR;C:\Program Files\WinRAR;"
| where ProcessCommandLine contains @"cd /d %~dp0 & rar.exe e -o+ -r -inul*.rar"

Analytic Rule Definition

id: dac6bcd8-35c9-4937-88e8-3b1c00dcebe2
name: detect-malicious-rar-extraction
description: |
  This query was originally published in the threat analytics report, CVE-2018-15982 exploit attacks.
  CVE-2018-15982 is an exploit of Adobe Flash Player, that allows for remote execution of arbitrary code. It has since been patched.
  Actors have been observed using this vulnerability in targeted attacks. Exploits for CVE-2018-15982 have also been included in several exploit kits.
  In some initial attacks exploiting CVE-2018-15982, attackers sent targets spear-phishing emails. The emails would include an attached RAR archive, which contained a lure document, as well as a second archive disguised as a .jpg file. Opening the document would automatically run an embedded Flash ActiveX control. This, in turn, would call a script containing the exploit. The exploit's ability to run arbitrary code would be employed to unpack and run a payload from the second archive. The payload is a backdoor used both to achieve persistance and for command and control.
  The following query detects possible instances of a payload being extracted by the exploit.
  References:
  https://nvd.nist.gov/vuln/detail/CVE-2018-15982
  https://helpx.adobe.com/security/products/flash-player/apsb18-42.html
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Initial access
- Execution
- Persistence
- Command and control
query: |
  DeviceProcessEvents
  | where FileName == "cmd.exe"
  | where ProcessCommandLine contains @"set path=%ProgramFiles(x86)%\WinRAR;C:\Program Files\WinRAR;"
  | where ProcessCommandLine contains @"cd /d %~dp0 & rar.exe e -o+ -r -inul*.rar"

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/detect-malicious-rar-extraction.yaml