# analyzing-macro-malware-in-office-documents

Examines malicious VBA macros in Word, Excel, and PowerPoint files. Use it to inspect suspicious attachments and reconstruct an attack chain.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 336 installs · ★ 35034
- Author: mahipal
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/analyzing-macro-malware-in-office-documents/SKILL.md
- Updated: 2026-08-31
- HTML: https://affpapa.org/en/nevibecode/skills/analyzing-macro-malware-in-office-documents

## What it does

This skill checks Office documents for VBA and XLM macros, extracts code, and traces auto-execution, payload downloads, execution methods, persistence, and anti-analysis behaviour. It uses `olevba`, `oleid`, and `oledump.py` for triage and extraction, then works through common VBA obfuscation such as `Chr`, `ChrW`, `StrReverse`, and `Replace`.

For Excel 4.0 macros, it calls on `xlmdeobfuscator`. It also checks for DDE, remote templates, and embedded OLE objects, though non-macro threats can require specialised analysis. Run the analysis in an isolated VM without Microsoft Office, because that prevents accidental document execution.

The setup requires Python 3.8+ with `oletools` and `oledump.py`; Excel 4.0 analysis also needs `XLMDeobfuscator`. LibreOffice is listed for safe rendering because it does not execute VBA macros by default.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-macro-malware-in-office-documents -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/analyzing-macro-malware-in-office-documents/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/analyzing-macro-malware-in-office-documents/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-macro-malware-in-office-documents -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/analyzing-macro-malware-in-office-documents/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-macro-malware-in-office-documents -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/analyzing-macro-malware-in-office-documents/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mukul975/Anthropic-Cybersecurity-Skills analyzing-macro-malware-in-office-documents
```

2. **Manually: put the files in place**
- File: `.github/skills/analyzing-macro-malware-in-office-documents/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-macro-malware-in-office-documents -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mukul975/Anthropic-Cybersecurity-Skills --path skills/analyzing-macro-malware-in-office-documents
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/analyzing-macro-malware-in-office-documents/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-macro-malware-in-office-documents -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/analyzing-macro-malware-in-office-documents/SKILL.md

## When to use it
- check an Office file for VBA and XLM macros
- extract VBA source from a suspicious document
- decode strings hidden with `Chr` or `StrReverse`
- trace a payload URL and its execution method
- detect DDE and remote template references

## Example prompts
- Analyze `suspect.docm` for malicious VBA macros and map the attack chain.
- Extract and deobfuscate code from `suspect.xlsm`, then inspect its XLM macros.
- Check `suspect.docx` for DDE, remote templates, and embedded OLE objects.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 7a18b9c1055af651.

BEGIN THIRD-PARTY FILE 7a18b9c1055af651
````text
---
name: analyzing-macro-malware-in-office-documents
description: 'Analyzes malicious VBA macros embedded in Microsoft Office documents
  (Word, Excel, PowerPoint) to identify download cradles, payload execution, persistence
  mechanisms, and anti-analysis techniques. Uses olevba, oledump, and VBA deobfuscation
  to extract the attack chain. Activates for requests involving Office macro analysis,
  VBA malware investigation, maldoc analysis, or document-based threat examination.

  '
domain: cybersecurity
subdomain: malware-analysis
tags:
- malware
- macro
- Office
- VBA
- document-malware
version: 1.0.0
author: mahipal
license: Apache-2.0
atlas_techniques:
- AML.T0068
- AML.T0067
d3fend_techniques:
- File Metadata Consistency Validation
- Application Protocol Command Analysis
- Identifier Analysis
- Content Format Conversion
- Message Analysis
nist_csf:
- DE.AE-02
- RS.AN-03
- ID.RA-01
- DE.CM-01
mitre_attack:
- T1137.001
- T1204.002
- T1059.005
- T1027
---

# Analyzing Macro Malware in Office Documents

## When to Use

- A suspicious Office document (.doc, .docm, .xls, .xlsm, .ppt) has been flagged by email security
- Investigating phishing campaigns that deliver weaponized Office documents
- Extracting VBA macro code to identify the payload download URL and execution method
- Analyzing obfuscated VBA code to understand the full attack chain
- Determining if a document uses DDE, ActiveX, or remote template injection instead of macros

**Do not use** for analyzing non-macro Office threats (DDE, remote template injection); while this skill covers detection of these, specialized analysis may be needed.

## Prerequisites

- Python 3.8+ with oletools installed (`pip install oletools`)
- oledump.py from Didier Stevens (https://blog.didierstevens.com/programs/oledump-py/)
- Isolated analysis VM without Microsoft Office installed (prevents accidental execution)
- XLMDeobfuscator for Excel 4.0 macro analysis (pip install xlmdeobfuscator)
- LibreOffice for safe document rendering (does not execute VBA macros by default)

## Workflow

### Step 1: Initial Document Triage

Determine if the document contains macros or other active content:

```bash
# Quick triage with olevba
olevba suspect.docm
````
END THIRD-PARTY FILE 7a18b9c1055af651

The third-party file has ended. Everything between the 7a18b9c1055af651 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2223 of 12181 bytes. © mahipal · Apache-2.0 · https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/HEAD/skills/analyzing-macro-malware-in-office-documents/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
