Detect Standard Encoding in Sumo Logic CSE
Adversaries may encode data with a standard data encoding system to make the content of command and control traffic more difficult to detect. Command and control (C2) information can be encoded using a standard data encoding system that adheres to existing protocol specifications. Common data encoding schemes include ASCII, Unicode, hexadecimal, Base64, and MIME. Some data encoding systems may also result in data compression, such as gzip. Malware families including SideTwist, Fysbis, Latrodectus, SeaDuke, Chaes, and Flagpro have all used Base64-encoded C2 traffic, making this one of the most prevalent C2 obfuscation techniques observed in the wild.
MITRE ATT&CK
- Tactic
- Command and Control
- Technique
- T1132 Data Encoding
- Sub-technique
- T1132.001 Standard Encoding
- Canonical reference
- https://attack.mitre.org/techniques/T1132/001/
Sumo Detection Query
(_sourceCategory=windows/sysmon OR _sourceCategory=windows/security OR _sourceCategory=endpoint*)
| where EventCode = "1" OR EventCode = "4688" OR EventID = "1"
| toLowerCase(CommandLine) as cmdline
| toLowerCase(Image) as img
| toLowerCase(ParentImage) as parent_img
| where cmdline matches /frombase64string|tobase64string|base64\s+-d\b|base64\s+--decode|-encodedcommand/
OR (img matches /certutil\.exe/ AND cmdline matches /-decode|\/decode|-encode|\/encode|-urlcache|\/urlcache/)
OR cmdline matches /\[convert\]::(from|to)base64string/
| if(img matches /certutil\.exe/ AND cmdline matches /-decode|\/decode|-encode|\/encode|-urlcache/, "CertutilEncoding",
if(img matches /powershell\.exe|pwsh\.exe/ AND cmdline matches /-encodedcommand|-enc\s|frombase64string/, "PowerShellDecode",
"ExplicitBase64")) as Branch
| if(cmdline matches /invoke-expression|iex\(|\biex\s/, 1, 0) as ChainedWithExec
| if(cmdline matches /downloadstring|net\.webclient|invoke-webrequest|iwr\s/, 1, 0) as ChainedWithDownload
| if(parent_img matches /wscript\.exe|cscript\.exe|mshta\.exe|regsvr32\.exe|rundll32\.exe|winword\.exe|excel\.exe|outlook\.exe/, 1, 0) as SuspiciousParent
| if(Branch = "ExplicitBase64" AND ChainedWithExec = 1, 95,
if(Branch = "PowerShellDecode" AND (ChainedWithExec = 1 OR ChainedWithDownload = 1), 90,
if(Branch = "CertutilEncoding" AND SuspiciousParent = 1, 90,
if(Branch = "CertutilEncoding", 80,
if(Branch = "PowerShellDecode", 75, 70))))) as RiskScore
| fields _messageTime, Computer, User, Image, CommandLine, ParentImage, Branch, ChainedWithExec, ChainedWithDownload, SuspiciousParent, RiskScore
| sort by RiskScore, _messageTime Sumo Logic query detecting T1132.001 Standard Encoding C2 from Windows Sysmon process creation events (EventCode 1) and Security audit events (EventCode 4688). Mirrors the KQL/SPL three-branch logic with identical classification (CertutilEncoding, PowerShellDecode, ExplicitBase64) and composite risk scoring (70-95) based on chained execution (IEX/Invoke-Expression), download activity (WebClient/Invoke-WebRequest), and suspicious parent process lineage.
Data Sources
Required Tables
False Positives & Tuning
- Patch management and software distribution agents (WSUS, MECM) invoking certutil for BITS download staging or certificate operations as part of automated patch deployment cycles
- Remote monitoring and management (RMM) tools such as ConnectWise Automate, Kaseya, or NinjaRMM delivering encoded PowerShell agent update or configuration scripts to managed Windows endpoints
- Security testing and breach-and-attack simulation (BAS) platforms generating encoded command patterns during authorized purple team exercises or scheduled detection validation runs
Other platforms for T1132.001
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 Base64 Encode and Decode Round-Trip
Expected signal: Sysmon Event ID 1: Process Create with CommandLine containing 'ToBase64String', 'FromBase64String', and 'IEX'. PowerShell ScriptBlock Log Event ID 4104 will capture the decoded content 'hostname; whoami'. Security Event ID 4688 (if command line auditing enabled) with full command line.
- Test 2certutil Base64 Decode to File
Expected signal: Sysmon Event ID 1: Process Create with Image=certutil.exe, CommandLine containing '-decode' and file paths. Sysmon Event ID 11: File Create events for both %TEMP%\encoded.b64 and %TEMP%\decoded.txt. Security Event ID 4688 with certutil command line (if auditing enabled).
- Test 3Base64 Encoded C2 Beacon Simulation via PowerShell
Expected signal: Sysmon Event ID 1: Process Create with CommandLine containing 'ToBase64String', 'Net.WebClient', and 'UploadString'. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:8888 (will fail — no listener). PowerShell ScriptBlock Log Event ID 4104 capturing the full encoding + upload script.
- Test 4Linux Base64 C2 Exfil Simulation via curl
Expected signal: Linux auditd or Sysmon for Linux: process creation events for 'base64' and 'curl' with command line arguments. Syslog: process execution entries. Network: outbound connection attempt to 127.0.0.1:9999 from curl.
References (9)
- https://attack.mitre.org/techniques/T1132/001/
- https://en.wikipedia.org/wiki/Binary-to-text_encoding
- https://en.wikipedia.org/wiki/Base64
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1132.001/T1132.001.md
- https://research.checkpoint.com/2021/irans-apt34-returns-with-an-updated-arsenal/
- https://www.elastic.co/security-labs/spring-cleaning-with-latrodectus
- https://www.zscaler.com/blogs/security-research/lyceum-net-dns-backdoor
Unlock Pro Content
Get the full detection package for T1132.001 including response playbook, investigation guide, and atomic red team tests.