Embedded Payloads
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.
let EmbeddingPatterns = dynamic([
"certutil -decode", "certutil -urlcache",
"expand ", "extrac32",
"makecab", "expand.exe"
]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (EmbeddingPatterns)
and ProcessCommandLine has_any (".exe", ".dll", ".bin", ".dat", ".cfg")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
| union (
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType == "FileCreated"
| where FileName endswith ".exe" or FileName endswith ".dll" or FileName endswith ".bin"
| where InitiatingProcessFileName has_any (".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx")
or InitiatingProcessFileName in~ ("AcroRd32.exe", "WINWORD.EXE", "EXCEL.EXE", "POWERPNT.EXE")
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName, FileName,
FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine
) Data Sources
Required Tables
False Positives
- certutil legitimately used by IT for certificate operations or legitimate file decoding in automation scripts
- expand.exe used by Windows Update and software installers to decompress cabinet files
- Office applications dropping temp files with .bin or .dat extensions during normal document processing
- PDF readers extracting embedded attachments from legitimate PDFs (forms, documents with attachments)
References (5)
- https://attack.mitre.org/techniques/T1027/009/
- https://github.com/peewpw/Invoke-PSImage
- https://www.cisa.gov/uscert/ncas/analysis-reports/ar20-303a
- https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-shllink/c41e062d-f764-4f13-bd4f-ea812ab9a4d1
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1027.009/T1027.009.md
Unlock Pro Content
Get the full detection package for T1027.009 including response playbook, investigation guide, and atomic red team tests.