T1027.002 Elastic Security · Elastic

Detect Software Packing in Elastic Security

Adversaries may perform software packing or virtual machine software protection to conceal their code. Software packing is a method of compressing or encrypting an executable. Packing an executable changes the file signature in an attempt to avoid signature-based detection. Most decompression techniques decompress the executable code in memory. Virtual machine software protection translates an executable's original code into a special format that only a special virtual machine can run. Common packers include UPX, MPRESS, Themida, VMProtect, and custom packers. APT41, APT39, Lazarus Group, Aoqin Dragon, and many commodity malware families including LockBit, QakBot, and Cobalt Strike use software packing.

MITRE ATT&CK

Tactic
Defense Evasion
Technique
T1027 Obfuscated Files or Information
Sub-technique
T1027.002 Software Packing
Canonical reference
https://attack.mitre.org/techniques/T1027/002/

Elastic Detection Query

Elastic Security (Elastic)
eql
any where
  /* Signal 1: Known packer tool executed outside trusted system paths (mirrors KQL packer process join) */
  (event.category == "process" and event.type == "start" and
   process.name in~ ("upx.exe", "themida.exe", "vmprotect.exe", "mpress.exe",
                     "enigma.exe", "obsidium.exe", "asprotect.exe", "pecompact.exe") and
   not process.executable : ("C:\\Windows\\*", "C:\\Program Files\\*",
                              "C:\\Program Files (x86)\\*"))
  or
  /* Signal 2: Packer-associated DLL/module loaded by a non-system process (mirrors SPL EventCode=7) */
  (event.category == "library" and
   (file.name : ("*upx*", "*themida*", "*vmprotect*", "*mpress*") or
    dll.description : ("*UPX*", "*Themida*", "*VMProtect*", "*packed*")) and
   not process.executable : ("C:\\Windows\\*", "C:\\Program Files\\*",
                              "C:\\Program Files (x86)\\*"))
  or
  /* Signal 3: PE binary dropped into temp/download path by a known packer process (mirrors KQL FileCreated join) */
  (event.category == "file" and event.action == "creation" and
   file.extension in ("exe", "dll") and
   file.path : ("*\\Temp\\*", "*\\Downloads\\*",
                "*\\AppData\\Roaming\\*", "*\\AppData\\Local\\Temp\\*") and
   process.name in~ ("upx.exe", "themida.exe", "vmprotect.exe",
                     "mpress.exe", "enigma.exe"))
high severity high confidence

Detects software packing activity (T1027.002) across three Elastic ECS event categories: (1) direct execution of known packer tools from non-system paths using process events, mirroring the KQL packer process join; (2) loading of packer-named DLLs or modules by non-system processes using library events, mirroring the SPL EventCode=7 image load correlation; (3) PE binaries created in temp or download directories by a known packer executable using file events, mirroring the KQL FileCreated logic. All three signals fire independently.

Data Sources

Elastic Endpoint Security via Elastic AgentWindows Sysmon via Elastic Agent or BeatsElastic Security Integration (endpoint.events.process, endpoint.events.file, endpoint.events.library)

Required Tables

logs-endpoint.events.process-*logs-endpoint.events.file-*logs-endpoint.events.library-*logs-sysmon.operational-*

False Positives & Tuning

  • Legitimate software developers using UPX or MPRESS to compress release binaries — common in open-source projects and indie game development, especially when build scripts write output to a Temp or Downloads directory.
  • Security researchers and malware analysts running packer tools against samples in dedicated analysis workstations — endpoint telemetry from sandbox or forensics machines will match all three signals.
  • Commercial software with built-in code protection (anti-cheat, DRM) that bundles VMProtect or Themida — endpoint agents on gaming workstations trigger the module load signal on every game client startup.
Download portable Sigma rule (.yml)

Other platforms for T1027.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 1Pack an Executable with UPX

    Expected signal: Sysmon Event ID 1: upx.exe process creation with '--best' flag and output path. Sysmon Event ID 11: File Create for packed_target.exe in %TEMP%. The output file will have different SHA256 than the input, smaller file size, and UPX-specific section names (.UPX0, .UPX1).

  2. Test 2Identify Packed Binary with PE Entropy Check

    Expected signal: Sysmon Event ID 1: sigcheck.exe process creation with the target binary path. Output will show section entropy values. For a UPX-packed binary, sections will show entropy near 7.8-8.0.

  3. Test 3Simulate Packed Malware Self-Extraction Pattern

    Expected signal: Sysmon Event ID 1: powershell.exe with Assembly.Load command. Sysmon Event ID 11: Temp file creation followed by deletion. PowerShell ScriptBlock Log Event ID 4104 with the full script including Assembly.Load. This pattern (write to disk + load + delete) is characteristic of packed dropper behavior.

  4. Test 4Download and Execute UPX to Pack a Binary

    Expected signal: Sysmon Event ID 1: PowerShell with Invoke-WebRequest (download cradle). Sysmon Event ID 3: Network connection to github.com. Sysmon Event ID 11: upx.zip download, extraction. Sysmon Event ID 1: upx.exe execution on victim_payload.exe.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections