T1027.013 Google Chronicle · YARA-L

Detect Encrypted/Encoded File in Google Chronicle

Adversaries encrypt or encode files to conceal malicious content and evade static signature detection. Techniques include XOR (single-byte and multi-byte), RC4, AES, 3DES, Base64, and custom encoding schemes applied to malware payloads, configuration files, C2 communication blobs, and dropped files. The full content or only specific values (such as C2 addresses or strings) may be obfuscated, sometimes in multiple redundant layers. Common delivery vectors include password-protected ZIP/Word documents and self-extracting (SFX) archives. Threat actors ranging from APT28 and Inception Group to ransomware families like Qilin and RansomHub consistently use encrypted/encoded files to defeat antivirus and EDR static analysis.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1027 Obfuscated Files or Information
Sub-technique
T1027.013 Encrypted/Encoded File
Canonical reference
https://attack.mitre.org/techniques/T1027/013/

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule T1027_013_Encrypted_Encoded_File_Execution {
  meta:
    author = "Detection Engineering"
    description = "Detects runtime payload decoding and encrypted/encoded file execution patterns associated with T1027.013 Encrypted/Encoded File. Covers certutil decode, PowerShell Base64+exec chains, XOR decode via bxor, password-protected archive extraction via 7z/WinRAR, and scripting engine execution of encoded content."
    mitre_attack_technique = "T1027.013"
    mitre_attack_tactic = "Defense Evasion"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1027/013/"
    severity = "HIGH"
    confidence = "HIGH"
    version = "1.0"

  events:
    $proc.metadata.event_type = "PROCESS_LAUNCH"

    (
      (
        re.regex($proc.target.process.file.full_path, `(?i)certutil\.exe$`) and
        re.regex($proc.target.process.command_line, `(?i)-(decode|decodehex)`)
      ) or
      (
        re.regex($proc.target.process.file.full_path, `(?i)powershell\.exe$`) and
        re.regex($proc.target.process.command_line, `(?i)FromBase64String`) and
        re.regex($proc.target.process.command_line, `(?i)(Invoke-Expression|\biex\b|&\(|\.Invoke)`)
      ) or
      (
        re.regex($proc.target.process.file.full_path, `(?i)powershell\.exe$`) and
        re.regex($proc.target.process.command_line, `(?i)\bbxor\b`)
      ) or
      (
        re.regex($proc.target.process.file.full_path, `(?i)(7z|7za|winrar|wrar)\.exe$`) and
        re.regex($proc.target.process.command_line, `-p\S+`)
      ) or
      (
        re.regex($proc.target.process.file.full_path, `(?i)(mshta|wscript|cscript)\.exe$`) and
        re.regex($proc.target.process.command_line, `(?i)(Base64|FromBase64|\bbxor\b|Encoding)`)
      )
    )

  condition:
    $proc
}
high severity high confidence

Chronicle YARA-L 2.0 rule detecting T1027.013 Encrypted/Encoded File execution using the UDM PROCESS_LAUNCH event type. Operates on target.process.file.full_path and target.process.command_line UDM fields to match certutil decode invocations, PowerShell Base64-decode-then-execute attack chains, PowerShell XOR decode patterns (-bxor), password-protected archive extraction via 7z/WinRAR/wrar, and scripting engine (mshta/wscript/cscript) executions referencing encoding-related content. A companion FILE_CREATION rule should be deployed separately to detect encoded file staging to writable paths.

Data Sources

Google Chronicle SIEMWindows Event Logs via Chronicle ForwarderSysmon via Chronicle ForwarderCrowdStrike Falcon via Chronicle IntegrationSentinelOne via Chronicle Integration

Required Tables

UDM Events

False Positives & Tuning

  • Automated software provisioning and configuration management systems (Ansible, Chef, Puppet, Terraform remote-exec, SCCM) generate frequent PROCESS_LAUNCH events for powershell.exe with FromBase64String in the command line as an expected operational pattern on managed servers
  • Security awareness and red team training platforms that demonstrate obfuscation techniques (Base64, XOR, certutil abuse) in controlled sandbox environments will produce high-fidelity but expected matches during training exercises
  • Enterprise software distribution tooling using WinRAR or 7-Zip with password-protected archives for secure patch delivery (particularly in air-gapped or high-security environments) will trigger the password-protected archive extraction pattern on software distribution servers and endpoints
Download portable Sigma rule (.yml)

Other platforms for T1027.013


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 1Base64 Encode, Drop, and Decode with certutil

    Expected signal: Sysmon EventCode 1 (ProcessCreate) for certutil.exe with '-decode' in CommandLine. EventCode 11 for both the .b64 source file and decoded output file creation in %TEMP%.

  2. Test 2PowerShell XOR Decryption Simulating Single-Byte XOR Malware

    Expected signal: Sysmon EventCode 1 (ProcessCreate) for powershell.exe. PowerShell Script Block Logging EventCode 4104 will capture the deobfuscated script including the -bxor operator and Invoke-Expression call.

  3. Test 3Password-Protected ZIP Delivery and Extraction

    Expected signal: Sysmon EventCode 1 for 7z.exe invocations with '-p' flag in CommandLine. EventCode 11 for .zip creation and extracted file creation in %TEMP%.

  4. Test 4Base64 Blob Decode and Execute via PowerShell

    Expected signal: Sysmon EventCode 1 for powershell.exe. PowerShell Script Block Logging EventCode 4104 will capture both the FromBase64String call and the decoded Invoke-Expression content — this is the primary high-value telemetry source.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections