Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / WINDOWS / EXECUTION

Office Macro Execution

This note documents detection patterns related to Office Macro Execution within Windows environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4688Process creationCriticalDetects Office parent spawning child processes.
Sysmon1Process creationCriticalBest execution source for macro-driven lineage.
Sysmon11File createHighPayloads or temp files dropped by macro.
PowerShell4104Script block loggingCriticalMacro-launched PowerShell payload visibility.
Sysmon3Network connectionHighMacro-triggered outbound retrieval or beaconing.
Sysmon22DNS queryHighDNS lookups following macro execution.
Office Alerts / Protected View logsN/AMacro enablement contextMediumUser interaction clue.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Office spawns shellwinword.exe -> powershell.exe / cmd.exeCriticalStrong macro abuse signal.
Office spawns LOLBINmshta, regsvr32, rundll32CriticalCommon staged execution.
Document from internetZone.Identifier ADSHighExternal delivery clue.
Template file abuse.dotm, .xlsm, .docmCriticalMacro-enabled format.
Child process hiddenHidden PowerShell flagsCriticalCommon attacker stealth.
Office immediate network activityDownload cradle after document openCriticalStrong staging signal.

Common Tools

ToolUsage
winword.exeWord macro host
excel.exeExcel macro host
outlook.exeAttachment launch path
powershell.exeMacro child payload
cmd.exeShell stage
mshta.exeLOLBIN proxy execution
VBA macrosEmbedded code execution

Relevant Artifacts

  • Sysmon Event IDs 1, 3, 11, 22
  • Security Event ID 4688
  • PowerShell 4104
  • Prefetch:
    • WINWORD.EXE
    • EXCEL.EXE
    • POWERSHELL.EXE
    • MSHTA.EXE
  • Office recent files
  • Zone.Identifier ADS
  • Amcache / ShimCache
  • MFT / USN for payloads
  • Macro-enabled file extensions:
    • .docm
    • .xlsm
    • .pptm

MITRE ATT&CK References

  • T1204 User Execution
  • T1059.005 Visual Basic
  • T1059.001 PowerShell
  • T1218 Signed Binary Proxy Execution

Decision Tree

  1. Which Office process executed?

    • winword
    • excel
    • outlook
  2. Child process spawned?

    • powershell
    • cmd
    • LOLBIN
  3. Document origin?

    • Email
    • Download
    • Share
  4. Follow-up activity?

    • Network
    • File drop
    • Persistence
  5. Expand:

    • Macro content
    • Adjacent downloads
    • User context
  6. Scope:

    • Single document
    • Campaign delivery
    • Shared IOC

Example Detection Templates

KQL

SecurityEvent
| where EventID == 4688
| where ParentProcessName has_any ("winword.exe","excel.exe","outlook.exe")
| project TimeGenerated, Computer, ParentProcessName, NewProcessName, CommandLine
Sysmon
| where EventID == 1
| where ParentImage has_any ("\\winword.exe","\\excel.exe")
| project TimeGenerated, Computer, ParentImage, Image, CommandLine

EQL

process where process.parent.name in ("winword.exe","excel.exe","outlook.exe")
sequence by host.name with maxspan=5m
  [ process where process.parent.name in ("winword.exe","excel.exe") ]
  [ network where process.name in ("powershell.exe","mshta.exe") ]

Sigma

title: Office Macro Execution Detection
id: 5d8a2f14-office-macro
status: experimental
description: Detects suspicious Office child process execution linked to macro abuse
references:
  - https://attack.mitre.org/
author: Vergil
date: 2026-03-07
logsource:
  product: windows
  service: security
detection:
  selection:
    ParentProcessName|endswith:
      - '\WINWORD.EXE'
      - '\EXCEL.EXE'
      - '\OUTLOOK.EXE'
  condition: selection
fields:
  - ParentProcessName
  - NewProcessName
  - CommandLine
falsepositives:
  - Legitimate Office automation
level: high
tags:
  - attack.execution
  - attack.t1204

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Disable unsigned macrosRestrict macro executionCriticalStrong prevention
Office child process alertsMonitor parent-child chainsCriticalCore detection
Protected ViewKeep enabledHighAdds user friction
Zone.Identifier awarenessInspect downloaded docsHighDelivery clue
PowerShell loggingCapture macro child payloadsCriticalStrong visibility