T1137.006

Add-ins

Adversaries abuse Microsoft Office add-ins to achieve persistence. Add-ins (WLL/XLL for Word/Excel, COM add-ins, VSTO add-ins, Outlook add-ins) are loaded automatically when the corresponding Office application starts. Bisonal malware used .wll files dropped in Word startup; Naikon APT used intel.wll via RoyalRoad; Turla's LunarLoader and LunarMail use Outlook add-ins. XLL add-ins are particularly dangerous as they can execute arbitrary code when loaded and can be delivered via email attachments.

Microsoft Sentinel / Defender
kusto
// T1137.006 — Office Add-ins persistence detection
// Detect add-in file drops, registry registration, and suspicious DLL loads by Office
let AddInExtensions = dynamic([".wll", ".xll", ".xlam", ".xla", ".vsto", ".ppam", ".ppa"]);
let AddInPaths = dynamic([
  "\\Microsoft\\Word\\STARTUP\\",
  "\\Microsoft\\Excel\\XLSTART\\",
  "\\Microsoft\\AddIns\\",
  "\\Microsoft\\Office\\AddIns\\"
]);
// Part 1: Detect add-in file writes to Office startup/add-in directories
let AddInFileWrite = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath has_any (AddInPaths)
    or (FileName has_any (".wll", ".xll", ".xlam", ".vsto"))
| where InitiatingProcessFileName !in~ ("winword.exe", "excel.exe", "powerpnt.exe",
                                        "outlook.exe", "OfficeClickToRun.exe", "setup.exe",
                                        "msiexec.exe", "OfficeC2RClient.exe")
| extend DetectionType = "Office_AddIn_File_Written"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 2: Detect Office add-in registry registration
let AddInRegistration = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey has_any ("Excel\\Addins", "Word\\Addins", "Outlook\\Addins",
                              "PowerPoint\\Addins", "Office\\Addins", "Excel\\ExcelDNA")
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend DetectionType = "Office_AddIn_Registry_Registration"
| project Timestamp, DeviceName, AccountName, RegistryKey, RegistryValueName, RegistryValueData,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 3: Detect Office processes loading DLLs from non-standard paths (XLL/WLL execution)
let AddInDLLLoad = DeviceImageLoadEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe")
| where FileName has_any (".wll", ".xll", ".xlam")
    or (FolderPath has_any ("\\Users\\", "\\Temp\\", "\\AppData\\", "\\Downloads\\"))
| where not (FolderPath has_any ("\\Microsoft Office\\", "\\Program Files\\Microsoft Office\\"))
| extend DetectionType = "Office_AddIn_DLL_Load"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
union AddInFileWrite, AddInRegistration, AddInDLLLoad
| sort by Timestamp desc
high severity high confidence

Data Sources

File: File Creation Windows Registry: Registry Key/Value Creation Module: Module Load Microsoft Defender for Endpoint

Required Tables

DeviceFileEvents DeviceRegistryEvents DeviceImageLoadEvents

False Positives

  • Legitimate third-party Office add-in installations (e.g., Acrobat PDF add-in, Zoom for Outlook, Microsoft Teams add-in)
  • Corporate IT deploying custom Office add-ins via MSI packages (msiexec.exe writing to add-in directories)
  • Developer workstations installing VSTO or Excel-DNA add-ins for development purposes
  • Automated software update processes updating existing legitimate add-ins

Unlock Pro Content

Get the full detection package for T1137.006 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections