T1132 Google Chronicle · YARA-L

Detect Data Encoding in Google Chronicle

Adversaries may encode data 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. Use of data encoding may adhere to existing protocol specifications and includes use of ASCII, Unicode, Base64, MIME, or other binary-to-text and character encoding systems. Some data encoding systems may also result in data compression, such as gzip. Real-world examples include BADNEWS converting encrypted C2 data to hexadecimal then Base64 before transmission, Ursnif embedding Base64-encoded data in HTTP URLs, H1N1 using an altered Base64 scheme for C2 traffic, and Linux Rabbit sending encoded payloads as URL parameters.

MITRE ATT&CK

Tactic
Command and Control
Technique
T1132 Data Encoding
Canonical reference
https://attack.mitre.org/techniques/T1132/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule t1132_data_encoding_c2_communication {
  meta:
    author = "Argus Detection Engineering"
    description = "Detects T1132 Data Encoding techniques used to obfuscate C2 traffic. Covers certutil LOLBin encoding, scripting interpreters combining encoding with network primitives, PowerShell Base64 conversion with networking classes, and curl/wget with large encoded argument blobs."
    mitre_attack_tactic = "Command and Control"
    mitre_attack_technique = "T1132"
    mitre_attack_subtechnique = "T1132.001"
    severity = "HIGH"
    priority = "HIGH"

  events:
    $e.metadata.event_type = "PROCESS_LAUNCH"
    $e.principal.hostname = $hostname
    $e.target.process.command_line = $cmdline
    $e.target.process.file.full_path = $proc_path

    (
      // Branch 1: certutil encoding/decoding LOLBin
      (
        re.regex($e.target.process.file.full_path, `(?i)certutil\.exe`)
        and re.regex($e.target.process.command_line, `(?i)(-encode|-decode|-urlcache|/encode|/decode|/urlcache)`)
      )
      or
      // Branch 2: scripting interpreters with encoding + network primitives
      (
        re.regex($e.target.process.file.full_path, `(?i)(python[23]?\.exe|perl\.exe|php\.exe|ruby\.exe|node\.exe|nodejs)`)
        and re.regex($e.target.process.command_line, `(?i)(base64|b64encode|b64decode|binascii|hexlify|unhexlify|zlib\.compress|gzip|btoa|atob|urllib\.parse\.quote|hex_codec)`)
        and re.regex($e.target.process.command_line, `(?i)(http://|https://|ftp://|socket|urllib|requests\.|connect\()`)
      )
      or
      // Branch 3: PowerShell Base64 conversion with network class usage
      (
        re.regex($e.target.process.file.full_path, `(?i)(powershell\.exe|pwsh\.exe)`)
        and re.regex($e.target.process.command_line, `(?i)(FromBase64String|ToBase64String|\[Convert\]::|System\.Convert)`)
        and re.regex($e.target.process.command_line, `(?i)(Net\.WebClient|Invoke-WebRequest|Invoke-RestMethod|TcpClient|UdpClient|UploadString|DownloadString)`)
      )
      or
      // Branch 4: curl/wget with long Base64 or hex-encoded argument
      (
        re.regex($e.target.process.file.full_path, `(?i)(curl\.exe|wget\.exe|/curl$|/wget$)`)
        and (
          re.regex($e.target.process.command_line, `[A-Za-z0-9+/]{60,}={0,2}`)
          or re.regex($e.target.process.command_line, `[0-9a-fA-F]{80,}`)
        )
      )
    )

  condition:
    $e
}
high severity high confidence

Chronicle YARA-L 2.0 rule detecting T1132 Data Encoding C2 obfuscation across four behavioral branches: certutil LOLBin encoding operations, scripting engines pairing encoding libraries with network calls, PowerShell Base64 conversion with networking primitives, and curl/wget carrying long encoded payloads. Uses UDM process launch events and regex matching against command-line arguments.

Data Sources

Google Chronicle UDMEndpoint Process EventsWindows Sysmon via Chronicle Forwarder

Required Tables

process_launch UDM events

False Positives & Tuning

  • DevOps automation pipelines that use Python scripts to Base64-encode configuration payloads before posting to REST APIs or configuration management services
  • Enterprise backup software that invokes certutil for certificate validation operations during scheduled backup jobs
  • Container orchestration health checks or init scripts using curl with long authorization tokens or JSON-encoded payloads
Download portable Sigma rule (.yml)

Other platforms for T1132


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 1certutil Base64 Encode Reconnaissance Output and Transmit via curl

    Expected signal: Sysmon Event ID 1: Process Create for certutil.exe with CommandLine containing '-encode %TEMP%\recon_out.txt'. Sysmon Event ID 11: File Create for %TEMP%\recon_encoded.b64. Sysmon Event ID 1: Subsequent Process Create for curl.exe with CommandLine containing '--data-binary @' and the encoded temp file. Sysmon Event ID 3: Network Connection from curl.exe to 127.0.0.1:8080 (connection refused, but event fires).

  2. Test 2Python Base64-Encoded System Fingerprint Beacon

    Expected signal: Sysmon Event ID 1: Process Create for python.exe (or python3.exe) with CommandLine containing 'base64', 'urllib.request', 'socket', and 'os'. Sysmon Event ID 3: Network Connection attempt from python.exe to 127.0.0.1:8080.

  3. Test 3PowerShell ToBase64String with WebClient POST

    Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'ToBase64String', '[System.Convert]::', 'Net.WebClient', and 'UploadString'. Sysmon Event ID 3: Network Connection attempt from powershell.exe to 127.0.0.1:8080. PowerShell ScriptBlock Log Event ID 4104 in Microsoft-Windows-PowerShell/Operational captures the full script including the ToBase64String call.

  4. Test 4Hex-Encoded C2 Data via Python binascii and subprocess curl

    Expected signal: Sysmon Event ID 1: Process Create for python.exe with CommandLine containing 'binascii', 'hexlify', and 'subprocess'. Sysmon Event ID 1: Child Process Create for curl.exe with CommandLine containing 'http://127.0.0.1:8080/q?d=' followed by a hex-encoded string of 40+ characters. Sysmon Event ID 3: Network Connection attempt from curl.exe to 127.0.0.1:8080.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections