T1132.002 CrowdStrike LogScale · LogScale

Detect Non-Standard Encoding in CrowdStrike LogScale

Adversaries may encode data with a non-standard data encoding system to make the content of command and control traffic more difficult to detect. Non-standard encoding schemes diverge from existing protocol specifications — for example, modified Base64 using a custom alphabet, XOR encoding with a static or rolling key, character substitution (replacing '/' with '-s', '+' with '-p'), or custom binary serialization. Real-world examples include OceanSalt (NOT operation on bytes), Small Sieve (hex byte swapping), TONESHELL (XOR with 32/256-byte key), NightClub (modified Base64 in DNS subdomains), RDAT (Base64 with character substitutions in DNS), InvisiMole (modified Base32 in DNS subdomains), and Uroburos (custom Base62/Base32). Detection focuses on anomalous DNS subdomain lengths and entropy, unusual encoded patterns in network traffic, and scripting processes generating high-entropy outbound data.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1132 Data Encoding
Sub-technique
T1132.002 Non-Standard Encoding
Canonical reference
https://attack.mitre.org/techniques/T1132/002/

LogScale Detection Query

CrowdStrike LogScale (LogScale)
cql
// Branch 1: DNS requests with encoded subdomain labels (Falcon DnsRequest telemetry)
#event_simpleName = "DnsRequest"
| regex("^(?<FirstLabel>[A-Za-z0-9+/=_\\-]{50,})\\.", field=DomainName)
| LabelLength := length(FirstLabel)
| EncodingType := if(match(regex="^[0-9a-fA-F]{50,}$", field=FirstLabel), "HexEncoded",
                  if(match(regex="^[A-Za-z0-9+/=]{50,}$", field=FirstLabel), "Base64Like",
                  if(match(regex="^[A-Za-z0-9_\\-]{50,}$", field=FirstLabel), "ModifiedBase64URLSafe",
                  "LongSubdomain")))
| DetectionBranch := "DNS_NonStandardEncoding"
| table([@timestamp, ComputerName, UserName, DomainName, FirstLabel, LabelLength,
         EncodingType, FileName, CommandLine, DetectionBranch])

// Branch 2: Scripting engine beaconing with low destination diversity (run separately)
// #event_simpleName = "NetworkConnectIP4"
// | FileName = /(?i)^(python|python3|perl|ruby|wscript|cscript|mshta|powershell|pwsh)(\.exe)?$/
// | not cidr(RemoteAddressIP4, subnet=["10.0.0.0/8", "172.16.0.0/12",
//            "192.168.0.0/16", "127.0.0.0/8", "169.254.0.0/16"])
// | groupBy([ComputerName, FileName, CommandLine], function=[
//     count(as=ConnCount),
//     countDistinct(RemoteAddressIP4, as=UniqueIPs),
//     collect(RemotePort, as=Ports),
//     collect(RemoteAddressIP4, as=DestIPs)
//   ])
// | where ConnCount > 10 and UniqueIPs < 3
// | DetectionBranch := "Beaconing_ScriptingEngine_CustomEncoding"
// | table([ComputerName, FileName, CommandLine, ConnCount, UniqueIPs, DestIPs, Ports, DetectionBranch])
high severity medium confidence

CrowdStrike LogScale (Falcon SIEM) detection for T1132.002 using native Falcon sensor telemetry. Branch 1 queries DnsRequest events, applies regex capture to extract the first subdomain label from DomainName, and classifies encoding type (hex, Base64, URL-safe Base64) for labels exceeding 50 characters using nested if() for LogScale compatibility. Branch 2 (commented for separate execution) queries NetworkConnectIP4 for scripting engine processes making >10 outbound connections to <3 unique public IPs, consistent with custom-encoded beaconing. Both branches surface Falcon process context (FileName, CommandLine) for immediate pivot to process tree.

Data Sources

CrowdStrike Falcon Sensor — DnsRequest eventsCrowdStrike Falcon Sensor — NetworkConnectIP4 eventsCrowdStrike Falcon Sensor — ProcessRollup2 events (for process tree correlation)

Required Tables

DnsRequestNetworkConnectIP4ProcessRollup2

False Positives & Tuning

  • CrowdStrike Falcon sensor itself and other endpoint agents using Python or PowerShell runtimes to beacon cloud management APIs with encoded telemetry — whitelist by process hash or parent process
  • Software development workstations where Python, Ruby, or Node scripts actively communicate with package registries (PyPI, npm, RubyGems) or CI/CD orchestrators using long token-encoded URLs
  • DNS-based service mesh and service discovery solutions (HashiCorp Consul, Istio with DNS delegation) that use long hashed service identifiers as subdomain prefixes for internal routing
Download portable Sigma rule (.yml)

Other platforms for T1132.002


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 1Simulate DNS Tunneling with Modified Base64 Subdomain Encoding

    Expected signal: Sysmon Event ID 22 (DNS Query): QueryName will contain a long alphanumeric subdomain label (length > 30 characters) matching the pattern [a-z0-9ps]{30,}\.df00tech-test\.local. Sysmon Event ID 1 (Process Create): powershell.exe with command line containing Base64, Replace, and Resolve-DnsName. PowerShell ScriptBlock Log Event ID 4104 capturing the encoding logic.

  2. Test 2XOR-Encoded C2 Data Transmission Simulation (TONESHELL Pattern)

    Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing -bxor, New-Object System.Net.WebClient, and UploadString. Sysmon Event ID 3: Network connection attempt to 127.0.0.1:8080 (connection will be refused but event fires). PowerShell ScriptBlock Log Event ID 4104 capturing the full XOR encoding loop and WebClient upload code.

  3. Test 3High-Volume DNS Query Burst Simulating DNS Tunneling Data Transfer

    Expected signal: 25x Sysmon Event ID 22 (DNS Query) events within ~5 seconds, each with a unique QueryName containing a long base64-like subdomain label (length 40-70 characters) under df00tech-dnstest.local. All queries initiated by powershell.exe. The burst pattern with unique subdomains matches DNS tunneling telemetry.

  4. Test 4HTTP C2 with Custom Base64 Alphabet Encoding (Neo-reGeorg Pattern)

    Expected signal: Sysmon Event ID 1: powershell.exe with CommandLine containing IndexOf, ToCharArray, WebClient, and UploadString — all indicators of custom encoding implementation. Sysmon Event ID 3: Network connection to 127.0.0.1:8080. PowerShell ScriptBlock Log Event ID 4104 capturing the full custom alphabet encoding logic. If stream:http is available, the POST body will contain d=<60+ char custom-alphabet string>.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections