← Back to SOC feed Coverage →

snip3-encoded-powershell-structure

kql MEDIUM Azure-Sentinel
DeviceFileEvents
backdoorhuntingmicrosoftofficialpowershell
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-07T11:00:00Z · Confidence: medium

Hunt Hypothesis

The hunt hypothesis detects potential Snip3 remote access trojan activity through the use of encoded PowerShell structures, which are commonly used by the malware family to evade basic detection. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate early-stage Snip3 infections before they establish persistent access or exfiltrate data.

KQL Query

DeviceFileEvents
| where InitiatingProcessFileName =~ "powershell.exe"
| where InitiatingProcessCommandLine has_all ("IEX","Text.Encoding","UTF8.GetString(@")
| where InitiatingProcessCommandLine has_any ("Unrestricted","Hidden")

Analytic Rule Definition

id: c85c5b11-a5b9-480d-b9cf-79ba2289f770
name: snip3-encoded-powershell-structure
description: |
  Snip3 is a family of related remote access trojans. Although the malware in this family contain numerous small variations, they all exhibit similar behaviors and techniques.
  The following query looks for the method that Snip3 malware use to obfuscate PowerShell commands with UTF8 encoding. This technique is intended to evade detection from security products, and avoids the more standard switches used for encoding in malware such as Emotet.
  At present, this method of encoding is much more rare, being seen largely with loader installation of RevengeRAT, AsyncRAT and other RATs used in campaigns targeting the aviation industry.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceFileEvents
tactics:
- Defense evasion
query: |
  DeviceFileEvents
  | where InitiatingProcessFileName =~ "powershell.exe"
  | where InitiatingProcessCommandLine has_all ("IEX","Text.Encoding","UTF8.GetString(@")
  | where InitiatingProcessCommandLine has_any ("Unrestricted","Hidden")

Required Data Sources

Sentinel TableNotes
DeviceFileEventsEnsure 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/Campaigns/snip3-encoded-powershell-structure.yaml