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.
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-macro-malware-in-office-documentsgit clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zhWrote 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.
[](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-macro-malware-in-office-documents)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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)
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.
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.
- 12d ago First seen · 320 lines · 108 tokens per session scan A 9370a9babd18
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.
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…
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…
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…
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…
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…
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…