T1679 Google Chronicle · YARA-L

Detect Selective Exclusion in Google Chronicle

This detection identifies adversaries employing selective exclusion during ransomware or destructive payload execution, where specific file extensions, directories, or system components are deliberately skipped to maintain system stability, evade detection, and ensure ransom delivery. Key indicators include script interpreter processes enumerating files with extensive system extension exclusion lists (.dll, .exe, .lnk, .sys, .msi), command-line arguments embedding regex patterns targeting multiple Windows critical extensions, explicit PowerShell exclusion operators (-notmatch, -notlike, -notcontains) filtering system file types, and mass file operation patterns that selectively skip binary and system formats. Ransomware families including Medusa, Embargo, and InvisibleFerret employ this technique to avoid system instability while maximizing encryption coverage, ensuring the victim endpoint remains operational enough to display ransom demands.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1679 Selective Exclusion
Canonical reference
https://attack.mitre.org/techniques/T1679/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule detection_t1679 {
  meta:
    author = "Argus Detection Platform"
    description = "Detects Selective Exclusion - T1679"
    severity = "HIGH"
    mitre_attack = "T1679"
    reference = "https://attack.mitre.org/techniques/T1679/"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    $e.principal.hostname = $hostname
    $e.target.process.file.full_path = $process_path
    $e.target.process.command_line = $cmdline
    (
      re.regex($e.target.process.file.full_path, `(?i)(powershell|cmd|wscript|cscript|mshta|rundll32)\.exe$`) and
      (
        re.regex($e.target.process.command_line, `(?i)-enc(odedcommand)?`) or
        re.regex($e.target.process.command_line, `(?i)-bypass`) or
        re.regex($e.target.process.command_line, `(?i)(invoke-expression|iex\s)`) or
        re.regex($e.target.process.command_line, `(?i)http://`)
      )
    )
    not re.regex($e.principal.process.file.full_path, `(?i)(trustedinstaller|msiexec|svchost)`)

  condition:
    $e
}
high severity medium confidence

Google Chronicle YARA-L 2.0 rule for detecting Selective Exclusion (T1679). Uses Chronicle UDM event model to identify selective exclusion behaviors across endpoint and cloud telemetry.

Data Sources

Windows EDRCrowdStrike FalconCarbon Black

Required Tables

PROCESS_LAUNCH

False Positives & Tuning

  • Legitimate backup agent scripts (Veeam, Commvault, Veritas) that enumerate file systems while excluding binary extensions from backup scope
  • Software deployment automation (SCCM, PDQ Deploy, Ansible) that iterates files while targeting specific document types and skipping executables
  • IT administration PowerShell scripts performing selective file operations during maintenance windows
Download portable Sigma rule (.yml)

Other platforms for T1679


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1PowerShell Selective File Exclusion with -notcontains Operator

    Expected signal: Sysmon EventCode=1 with Image ending in powershell.exe, CommandLine containing .dll, .exe, .lnk, .sys, .msi, .bat, .cmd, .ini, .url, .drv extensions and -notcontains operator

  2. Test 2Embargo-Style Regex-Based Extension Exclusion Pattern

    Expected signal: Sysmon EventCode=1 with Image=powershell.exe, CommandLine containing regex pattern referencing dll|exe|lnk|sys|msi|bat|cmd|ini|url|drv|ocx|pif|com and -notmatch operator

  3. Test 3CMD Batch Script Selective File Targeting with Multiple IF NOT Conditions

    Expected signal: Sysmon EventCode=1 with Image=cmd.exe, CommandLine containing .dll, .exe, .sys, .lnk, .msi, .bat in multiple IF NOT conditional statements

  4. Test 4InvisibleFerret-Style Path and Extension Avoidance Enumeration

    Expected signal: Sysmon EventCode=1 with Image=powershell.exe, CommandLine containing avoidExtensions array with 12 system extensions, avoidPaths array, -notcontains and -like operators, Get-ChildItem cmdlet

Unlock Pro Content

Get the full detection package for T1679 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections