Dynamic Data Exchange
Adversaries may use Windows Dynamic Data Exchange (DDE) to execute arbitrary commands without relying on VBA macros. DDE is a legacy client-server IPC protocol supported in Microsoft Office applications that allows documents to request command execution from a server process. Attackers poison Word documents, Excel spreadsheets, Outlook emails, and CSV files with DDE fields (e.g., DDEAUTO cmd) that execute shell commands when the document is opened and field updates are accepted. DDE is also delivered via OLE-embedded Equation Editor objects (EQNEDT32.EXE) exploiting CVE-2017-11882. Threat actors including APT28, FIN7, MuddyWater, Cobalt Group, Gallmaker, APT37, Leviathan, and BITTER have leveraged DDE in targeted spearphishing campaigns to achieve initial code execution.
let OfficeProcesses = dynamic(["winword.exe", "excel.exe", "outlook.exe", "onenote.exe", "powerpnt.exe", "msaccess.exe", "mspub.exe"]);
let SuspiciousChildren = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe", "msiexec.exe", "wmic.exe", "schtasks.exe", "net.exe", "net1.exe", "curl.exe", "wget.exe", "forfiles.exe", "pcalua.exe"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where (InitiatingProcessFileName has_any (OfficeProcesses) and FileName has_any (SuspiciousChildren))
or InitiatingProcessFileName =~ "EQNEDT32.EXE"
| extend IsDDE_EquationEditor = (InitiatingProcessFileName =~ "EQNEDT32.EXE")
| extend IsOfficeSpawn = (InitiatingProcessFileName has_any (OfficeProcesses) and FileName has_any (SuspiciousChildren))
| extend SuspiciousArgs = ProcessCommandLine has_any ("http", "https", "-enc", "-EncodedCommand", "DownloadString", "WebClient", "iex(", "invoke-expression", "base64", "-bypass", "-hidden", "frombase64", "Start-BitsTransfer")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, FolderPath,
IsDDE_EquationEditor, IsOfficeSpawn, SuspiciousArgs
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate Office COM automation or VSTO add-ins that programmatically spawn cmd.exe or PowerShell for document post-processing (distinguish by correlating InitiatingProcessCommandLine with known automation tool paths)
- Corporate IT tools using legacy DDE-based data integration with Excel, common in ERP environments where financial data is pushed via DDE links from mainframe or middleware systems
- Developer workstations running Office interop test harnesses that invoke shell processes as part of automated document generation or conversion pipelines
- Document management systems (e.g., OpenText, SharePoint integration tools) that open Office documents server-side and spawn helper processes for format conversion or indexing
References (12)
- https://attack.mitre.org/techniques/T1559/002/
- https://www.bleepingcomputer.com/news/microsoft/microsoft-disables-dde-feature-in-word-to-prevent-further-malware-attacks/
- https://sensepost.com/blog/2016/powershell-c-sharp-and-dde-the-power-within/
- https://sensepost.com/blog/2017/macro-less-code-exec-in-msword/
- https://posts.specterops.io/reviving-dde-using-onenote-and-excel-for-code-execution-d7226864caee
- https://portal.msrc.microsoft.com/security-guidance/advisory/ADV170021
- https://technet.microsoft.com/library/security/4053440
- https://owasp.org/www-community/attacks/CSV_Injection
- https://blog.securelayer7.net/how-to-perform-csv-excel-macro-injection/
- https://www.fireeye.com/blog/threat-research/2019/06/hunting-com-objects.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1559.002/T1559.002.md
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
Unlock Pro Content
Get the full detection package for T1559.002 including response playbook, investigation guide, and atomic red team tests.