Detect Software Packing in Sumo Logic CSE
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/
Sumo Detection Query
(_sourceCategory="windows/sysmon" OR _sourceCategory="os/windows/sysmon" OR _sourceCategory="*Sysmon*")
| parse regex "<EventID>(?<event_id>\d+)</EventID>" nodrop
| parse regex "<Image>(?<image>[^<]+)</Image>" nodrop
| parse regex "<CommandLine>(?<command_line>[^<]+)</CommandLine>" nodrop
| parse regex "<ImageLoaded>(?<image_loaded>[^<]+)</ImageLoaded>" nodrop
| parse regex "<Description>(?<description>[^<]+)</Description>" nodrop
| parse regex "<TargetFilename>(?<target_filename>[^<]+)</TargetFilename>" nodrop
| parse regex "<Computer>(?<computer>[^<]+)</Computer>" nodrop
| parse regex "<User>(?<user>[^<]+)</User>" nodrop
| where event_id in ("1", "7", "11")
| where
/* Event ID 1: Known packer tool execution */
(event_id == "1" and (
matches(image, "*upx.exe") or
matches(image, "*themida.exe") or
matches(image, "*vmprotect.exe") or
matches(image, "*mpress.exe") or
matches(image, "*enigma.exe") or
matches(image, "*obsidium.exe") or
matches(command_line, "*upx*") or
matches(command_line, "*vmprotect*")
)) or
/* Event ID 7: Packer-related DLL image load from non-system process */
(event_id == "7" and (
matches(image_loaded, "*upx*") or
matches(image_loaded, "*themida*") or
matches(image_loaded, "*vmprotect*") or
matches(description, "*UPX*") or
matches(description, "*packed*") or
matches(description, "*Themida*") or
matches(description, "*VMProtect*")
) and
!matches(image, "C:\\Windows\\*") and
!matches(image, "C:\\Program Files\\*")) or
/* Event ID 11: PE file created in temp or download directory */
(event_id == "11" and (
matches(target_filename, "*.exe") or matches(target_filename, "*.dll")
) and (
matches(target_filename, "*\\Temp\\*") or
matches(target_filename, "*\\Downloads\\*") or
matches(target_filename, "*\\AppData\\Roaming\\*") or
matches(target_filename, "*\\AppData\\Local\\Temp\\*")
))
| eval detection_type = if(event_id == "1", "Packer Tool Execution",
if(event_id == "7", "Packer Module Load",
if(event_id == "11", "PE Created in Temp Path", "Unknown")))
| count as EventCount by computer, user, event_id, detection_type, image, command_line, image_loaded, target_filename
| sort by EventCount desc Sumo Logic detection for software packing (T1027.002) parsing raw Sysmon XML from Windows event log sources using regex field extraction. Identifies three signals: Sysmon Event ID 1 for known packer tool process creation (UPX, Themida, VMProtect, MPRESS, Enigma, Obsidium), Event ID 7 for DLL image loads with packer-related names or descriptions from non-system processes, and Event ID 11 for PE files written to temp/download paths. Results are tagged with detection type and aggregated by host, user, and process for analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Authorized penetration testing engagements where red team operators pack payloads on scoped endpoints — suppress during exercise windows using a scheduled suppression for the hostname or user account.
- Anti-cheat game clients (Easy Anti-Cheat, BattlEye) that ship VMProtect or Themida-protected DLLs load these modules at game startup — Event ID 7 will fire on every gaming workstation with popular multiplayer titles.
- Software publishing workflows where developers run UPX against build artifacts in a scratch directory mapped to AppData or Downloads — common in game modding and open-source cross-platform tool development.
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.
- 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).
- 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.
- 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.
- 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.
References (5)
Unlock Pro Content
Get the full detection package for T1027.002 including response playbook, investigation guide, and atomic red team tests.