Detect Selective Exclusion in Sumo Logic CSE
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/
Sumo Detection Query
_sourceCategory=windows/sysmon EventCode=1
| json auto
| where process_name in ("powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe")
| where process_cmdline matches /(-enc|-encodedcommand|-bypass|-hidden|invoke-expression|iex\s)/i
OR process_cmdline matches /(http:\/\/|https:\/\/|ftp:\/\/)/i
| if(process_cmdline matches /-enc/i, "EncodedCommand",
if(process_cmdline matches /-bypass/i, "BypassExecution",
if(process_cmdline matches /(invoke-expression|iex)/i, "ScriptExecution",
"SuspiciousProcess"))) as detection_type
| if(parent_process_name in ("w3wp.exe","httpd.exe","nginx.exe"), 95,
if(process_cmdline matches /-enc/i, 85,
if(process_cmdline matches /-bypass/i, 75, 60))) as risk_score
| where risk_score >= 60
| count by host, user, process_name, process_cmdline, parent_process_name, detection_type, risk_score
| sort - risk_score Sumo Logic detection for Selective Exclusion (T1679). Identifies adversary selective exclusion behaviors using Sumo Logic's search pipeline with field extraction and anomaly classification.
Data Sources
Required Tables
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
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.
- 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
- 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
- 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
- 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
References (5)
- https://attack.mitre.org/techniques/T1679/
- https://unit42.paloaltonetworks.com/medusa-ransomware-january-2024/
- https://www.esentire.com/blog/contagious-interview-north-korean-threat-actors-delivering-new-invisibleferret-malware
- https://www.cyble.com/blog/embargo-ransomware-a-new-multi-extortion-group/
- https://www.microsoft.com/en-us/security/blog/2024/05/28/ransomware-as-a-service-the-threat-actors-behind-medusa/
Unlock Pro Content
Get the full detection package for T1679 including response playbook, investigation guide, and atomic red team tests.