analyzing-macro-malware-in-office-documents

analyzing-macro-malware-in-office-documents is a skill for Claude Code from killvxk/cybersecurity-skills-zh. It costs 108 tokens per session (3,295 once invoked), scanned A, original, Apache-2.0.

A malware-analysis workflow for examining harmful VBA macros embedded in Microsoft Word, Excel, and PowerPoint files. It uses tools that extract, decode, and inspect the macros and their attack chain.

In plain words
What is it for?
Use it to check phishing attachments, find download URLs and execution methods, examine obfuscated VBA, and detect related threats such as DDE, ActiveX, and remote templates.
Why use it?
It helps investigators understand what a suspicious Office document does without opening it in Microsoft Office and accidentally running its code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cybersecurity-skills-zh plugin — 58 skills shipped together

Good fit Use it to check phishing attachments, find download URLs and execution methods, examine obfuscated VBA, and detect related threats such as DDE, ActiveX, and remote templates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-macro-malware-in-office-documents
Clone the repo
git clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zh

Made for: Claude Code.

Or install cybersecurity-skills-zh, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-macro-malware-in-office-documents

README.md
[![agentmods](https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents/github.svg)](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents)
Your own site
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-macro-malware-in-office-documents

Your own site · 80×15
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.03295
Opus 5 $0.00054 $0.01648
Sonnet 5 $0.00022 $0.00659
Haiku 4.5 $0.00011 $0.00330

Measured 12d ago against content hash 9370a9babd18, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

analyzing-macro-malware-in-office-documents scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/analyzing-macro-malware-in-office-documents/SKILL.md · 320 lines

How it starts

The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.

分析 Office 文档中的宏恶意软件

适用场景

  • 一个可疑的 Office 文档(.doc、.docm、.xls、.xlsm、.ppt)被电子邮件安全系统标记
  • 调查投递武器化 Office 文档的钓鱼攻击活动
  • 提取 VBA 宏代码以识别载荷下载 URL 和执行方法
  • 分析混淆的 VBA 代码以了解完整的攻击链
  • 确定文档是否使用 DDE、ActiveX 或远程模板注入而非宏

不适用于分析非宏 Office 威胁(DDE、远程模板注入);虽然本技能涵盖这些检测,但可能需要专门分析。

前置条件

  • Python 3.8+,安装 oletools(pip install oletools
  • Didier Stevens 的 oledump.py
  • 未安装 Microsoft Office 的隔离分析虚拟机(防止意外执行)
  • XLMDeobfuscator 用于 Excel 4.0 宏分析(pip install xlmdeobfuscator)
  • LibreOffice 用于安全文档渲染(默认不执行 VBA 宏)

工作流程

步骤 1:文档初始分类

确定文档是否包含宏或其他活动内容:

# 使用 olevba 快速分类
olevba suspect.docm

# 检查 OLE 流和宏
oleid suspect.docm

# 输出指标:
# VBA 宏:        True/False
# XLM 宏:        True/False
# 外部关系:      True/False(远程模板)
# ObjectPool:    True/False(嵌入对象)
# Flash:         True/False(SWF 对象)

# 综合 OLE 分析
oledump.py suspect.docm

# 列出所有带宏指示符的 OLE 流
# 标记为 'M' 的流包含 VBA 宏
# 标记为 'm' 的流包含宏属性

步骤 2:提取和分析 VBA 代码

提取完整的 VBA 宏源代码:

# 使用完整去混淆提取 VBA
olevba --decode --deobf suspect.docm

# 仅提取 VBA 源代码
olevba --code suspect.docm > extracted_vba.txt

# 使用 oledump 详细提取
oledump.py -s 8 -v suspect.docm  # 流 8(根据流列表调整)

# 提取所有宏流
oledump.py -p plugin_vba_dco suspect.docm
需要识别的关键 VBA 元素:
━━━━━━━━━━━━━━━━━━━━━━━━━━━
自动执行触发器:
  - Auto_Open / AutoOpen(Word)
  - Auto_Close / AutoClose
  - Document_Open / Document_Close
  - Workbook_Open(Excel)
  - AutoExec

可疑函数:
  - Shell() / Shell.Application
  - WScript.Shell.Run / Exec
  - CreateObject("WScript.Shell")
  - PowerShell 执行
  - URLDownloadToFile
  - MSXML2.XMLHTTP(HTTP 请求)
  - ADODB.Stream(文件写入)
  - Environ()(环境变量)
  - CallByName(间接方法调用)

步骤 3:VBA 代码去混淆

去除混淆层以揭示载荷:

# VBA 去混淆技术
import re

def deobfuscate_vba(code):
    # 1. 解析 Chr() 调用:Chr(104) & Chr(116) -> "ht"
    def resolve_chr(match):
        try:
            return chr(int(match.group(1)))
        except:
            return match.group(0)
    code = re.sub(r'Chr\$?\((\d+)\)', resolve_chr, code)

    # 2. 去除字符串拼接:"htt" & "p://" -> "http://"
    code = re.sub(r'"\s*&\s*"', '', code)

    # 3. 解析 ChrW 调用:ChrW(104)
    code = re.sub(r'ChrW\$?\((\d+)\)', resolve_chr, code)

    # 4. 解析 StrReverse:StrReverse("exe.daolnwod") -> "download.exe"
    def resolve_reverse(match):
        return '"' + match.group(1)[::-1] + '"'
    code = re.sub(r'StrReverse\("([^"]+)"\)', resolve_reverse, code)

    # 5. 去除 Mid$/Left$/Right$ 混淆(复杂,标记为需要手动审查)

    # 6. 解析 Replace():Replace("Powxershxell", "x", "")
    def resolve_replace(match):
        original = match.group(1)
        find = match.group(2)
        replace_with = match.group(3)
        return '"' + original.replace(find, replace_with) + '"'
    code = re.sub(r'Replace\("([^"]+)",\s*"([^"]+)",\s*"([^"]*)"\)', resolve_replace, code)

    return code

with open("extracted_vba.txt") as f:
    vba_code = f.read()

deobfuscated = deobfuscate_vba(vba_code)
print(deobfuscated)

Read the full file on GitHub · 320 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 320 lines · 108 tokens per session scan A 9370a9babd18

Subscribe to this mod's changes

analyzing-macro-malware-in-office-documents is a skill published in the GitHub repository killvxk/cybersecurity-skills-zh (44 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 108 tokens to every session and 3,295 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-macro-malware-in-office-documents

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…

26zl/cybersec-toolkit · 90 tokens

analyzing-macro-malware-in-office-documents

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…

plurigrid/asi · 90 tokens

analyzing-macro-malware-in-office-documents

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…

pinkpixel-dev/skills-collection-1 · 90 tokens

analyzing-macro-malware-in-office-documents

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…

marysatasselshaped667/skills-collection-1 · 90 tokens

analyzing-macro-malware-in-office-documents

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…

Mikaru0Mystic/sectinel · 90 tokens

analyzing-macro-malware-in-office-documents

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…

mukul975/Anthropic-Cybersecurity-Skills · 90 tokens