Detect Dynamic Data Exchange in Splunk
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.
MITRE ATT&CK
- Tactic
- Execution
- Technique
- T1559 Inter-Process Communication
- Sub-technique
- T1559.002 Dynamic Data Exchange
- Canonical reference
- https://attack.mitre.org/techniques/T1559/002/
SPL Detection Query
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval parent_lower=lower(ParentImage)
| eval child_lower=lower(Image)
| eval IsOfficeParent=if(match(parent_lower, "(winword\.exe|excel\.exe|outlook\.exe|onenote\.exe|powerpnt\.exe|msaccess\.exe|mspub\.exe)"), 1, 0)
| eval IsSuspiciousChild=if(match(child_lower, "(\\\\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|\\\\forfiles\.exe)"), 1, 0)
| eval IsEquationEditor=if(match(parent_lower, "eqnedt32\.exe"), 1, 0)
| eval SuspiciousArgs=if(match(lower(CommandLine), "(http|https|-enc|-encodedcommand|downloadstring|webclient|iex\(|invoke-expression|frombase64|-bypass|-hidden|start-bitstransfer)"), 1, 0)
| where (IsOfficeParent=1 AND IsSuspiciousChild=1) OR IsEquationEditor=1
| eval DDEType=case(IsEquationEditor=1, "EquationEditor_CVE-2017-11882", IsOfficeParent=1 AND IsSuspiciousChild=1, "OfficeDDE_Spawn", true(), "Unknown")
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, DDEType, SuspiciousArgs
| sort - _time Detects DDE code execution via Sysmon Event ID 1 (Process Create). Identifies Office applications spawning suspicious child processes (cmd.exe, PowerShell, scripting engines, LOLBins) and EQNEDT32.EXE spawning any process. Classifies alerts by DDE vector: EquationEditor_CVE-2017-11882 (Equation Editor exploitation — near-zero false positives) or OfficeDDE_Spawn (DDE field / OLE-based execution from Office documents). SuspiciousArgs flags child command lines containing download cradle or obfuscation patterns for prioritization.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Legitimate Office COM automation or VSTO add-ins that spawn cmd.exe or PowerShell for document post-processing
- Corporate legacy ERP integrations using DDE data links with Excel to push data from mainframe or middleware
- Developer workstations running Office interop test harnesses that spawn helper processes for document conversion
- Document management systems that open Office documents server-side and spawn child processes for indexing or conversion
Other platforms for T1559.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 1CSV DDE Injection via Excel
Expected signal: Sysmon Event ID 1: Process Create for excel.exe with the CSV path as argument. If the DDE prompt is accepted: Sysmon Event ID 1 for cmd.exe with ParentImage=excel.exe and CommandLine='/c whoami > %TEMP%\dde_csv_out.txt'. Sysmon Event ID 11: File Create for dde_csv_out.txt in %TEMP%. Security Event ID 4688 (if command line auditing enabled) for the cmd.exe spawn.
- Test 2Word DDEAUTO Field Execution via RTF
Expected signal: Sysmon Event ID 1: Process Create for winword.exe with the RTF file as argument. If DDE executes: Sysmon Event ID 1 for cmd.exe with ParentImage=winword.exe, CommandLine='/c whoami > %TEMP%\dde_word_out.txt'. Sysmon Event ID 11: File Create for dde_word_out.txt. Office telemetry logs the DDEAUTO field activation attempt. Security Event ID 4688 for the spawned cmd.exe.
- Test 3DDE via Outlook Email with Embedded OLE Object
Expected signal: Sysmon Event ID 1: Process Create for outlook.exe with the .msg file path as argument. Outlook COM instantiation visible in Sysmon Event ID 1 for the PowerShell parent spawning outlook.exe. If OLE DDE executes: Sysmon Event ID 1 for cmd.exe with ParentImage=outlook.exe. Security Event ID 4688 for the spawned process.
- Test 4Equation Editor (EQNEDT32.EXE) Presence and Execution Check
Expected signal: If EQNEDT32.EXE is found and executed: Sysmon Event ID 1 for EQNEDT32.EXE with Image=<office_path>\EQNEDT32.EXE. Prefetch file created at C:\Windows\Prefetch\EQNEDT32.EXE-*.pf. Security Event ID 4688 for EQNEDT32.EXE execution. In a real exploitation scenario: Sysmon Event ID 1 for a child process (cmd.exe, powershell.exe) with ParentImage=EQNEDT32.EXE would additionally fire.
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.