T1027.009 Elastic Security · Elastic

Detect Embedded Payloads in Elastic Security

Adversaries may embed payloads within other files to conceal malicious content from defenses. Otherwise seemingly benign files (such as scripts and executables) may be abused to carry and obfuscate malicious payloads and content. Adversaries have been observed embedding payloads as PE overlays, within resource sections of legitimate binaries, inside LNK file ExtraData fields, within Office VBA macros, and nested inside other file types. Notable examples include Emotet embedding executables in dropper binaries, DEADEYE embedding payloads in compiled binaries, Lazarus Group distributing malicious payloads in PNG files, Pikabot loading encrypted chunked PE sections, and Uroburos storing executable payloads in encrypted Queue files.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1027 Obfuscated Files or Information
Sub-technique
T1027.009 Embedded Payloads
Canonical reference
https://attack.mitre.org/techniques/T1027/009/

Elastic Detection Query

Elastic Security (Elastic)
eql
any where
  (
    event.category == "process" and
    event.type == "start" and
    (
      (
        process.name like~ "certutil.exe" and
        (
          process.command_line like~ "*-decode*" or
          process.command_line like~ "*-urlcache*"
        ) and
        (
          process.command_line like~ "*.exe*" or
          process.command_line like~ "*.dll*" or
          process.command_line like~ "*.bin*" or
          process.command_line like~ "*.dat*" or
          process.command_line like~ "*.cfg*"
        )
      ) or
      (
        process.name in~ ("expand.exe", "extrac32.exe", "makecab.exe") and
        (
          process.command_line like~ "*.exe*" or
          process.command_line like~ "*.dll*" or
          process.command_line like~ "*.bin*"
        )
      )
    )
  ) or
  (
    event.category == "file" and
    event.type in ("creation", "change") and
    file.extension in~ ("exe", "dll", "bin", "shellcode") and
    process.name in~ (
      "WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE",
      "AcroRd32.exe", "FoxitPDFReader.exe",
      "wscript.exe", "cscript.exe", "mshta.exe"
    )
  )
high severity medium confidence

Detects T1027.009 Embedded Payloads via two branches: (1) certutil.exe invoked with -decode or -urlcache arguments targeting executable file formats, or expand/extrac32/makecab dropping executables; (2) executable file creation events (ECS FILE_CREATION) where the creating process is an Office application, PDF reader, or Windows script host — a strong indicator of payload extraction from a document.

Data Sources

Elastic Endpoint Security agentSysmon via Elastic Agent Windows integrationWinlogbeat with Sysmon module

Required Tables

logs-endpoint.events.process-*logs-endpoint.events.file-*logs-windows.sysmon_operational-*

False Positives & Tuning

  • IT administrators legitimately invoking certutil.exe for certificate enrollment, CRL retrieval, or base64 decode of non-malicious payloads during system provisioning or PKI management tasks
  • Software deployment tools such as SCCM, PDQ Deploy, or Intune Win32 app packaging that use expand.exe or extrac32.exe to stage cabinet-archive installer components containing .exe or .dll files
  • Office COM add-ins or macro-enabled templates used for legitimate business automation that write helper .dll components to the user profile or temp directories during first-run initialization
Download portable Sigma rule (.yml)

Other platforms for T1027.009


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 1Extract Embedded Payload from PE Overlay with certutil

    Expected signal: Sysmon Event ID 1: certutil.exe with -encode and then -decode arguments. Sysmon Event ID 11: encoded_payload.txt and extracted_payload.exe created in %TEMP%. The -decode operation creates an executable from a text file.

  2. Test 2Office Macro Dropping Embedded Executable

    Expected signal: Sysmon Event ID 1: PowerShell spawning Word COM object. Word process creating a document with VBA code. File creation of macro_test.doc.

  3. Test 3Embed Payload in PE Resources Section

    Expected signal: PowerShell process creation demonstrating the concept. Binary data file creation in %TEMP%.

  4. Test 4Extract Payload from LNK ExtraData Field

    Expected signal: Sysmon Event ID 11: embedded_lnk.lnk created in %TEMP%. Sysmon Event ID 1: cmd.exe spawned from LNK execution with arguments. Sysmon Event ID 11: lnk_output.txt created.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections