Re doc malware

From dslsdzc/rev-skills · View interactive version

Re doc malware is an AI agent skill from the GitHub repository dslsdzc/rev-skills. 恶意文档分析:PDF/Office 武器化、宏链、文档漏洞利用、载荷提取。 触发词:恶意文档、钓鱼文档、PDF恶意、宏文档、docm、文档漏洞、恶意附件。

How to use this skill

Skill file

恶意文档分析

何时使用 / 何时不用

工具准备

pdf-parser / pdfid(PDF 结构分析)

qpdf(PDF 流解压,可选)

olevba / rtfobj(Office/RTF 宏与嵌入对象提取)

xlmdeobfuscator(Excel 4.0 宏去混淆,可选)

LibreOffice(沙箱打开验证,可选)

7z(OLE/OOXML 解包)

操作步骤

按顺序执行;每步产物存档(路径 + sha256,见 [[re-triage]])。

  1. 文档类型识别:

```sh

file sample.pdf sample.docm sample.rtf

```

  1. PDF 静态分析:

```sh

pdfid.py sample.pdf # 对象计数,恶意特征速览

pdf-parser -f sample.pdf | head -50 # 对象树遍历(-f 经过 filter 解压流)

pdf-parser -s /JS sample.pdf # JavaScript 动作

pdf-parser -s /OpenAction sample.pdf # 打开即执行动作

pdf-parser -O sample.pdf # 解析对象流(ObjStm)内的对象

```

  1. Office 宏提取:

```sh

olevba -c sample.docm > macro.txt # 提取宏源码(-c 只输出源码)

olevba --decode -c sample.docm > macro_decoded.txt # 自动解常见字符串混淆(--decode 自 oletools 0.24 起;源码内解码串显示用 --reveal)

olevba --deobf -c sample.docm # 表达式级去混淆(0.46+)

strings sample.docm | grep -iE 'DDEAUTO|http|powershell' | head

```

  1. RTF 分析:

```sh

rtfobj sample.rtf # 列出嵌入 OLE 对象与 CLSID

```

  1. 模板注入与关系文件(OOXML):

```sh

7z l sample.docx | head -40

7z x sample.docx -oext/

grep -r 'TargetMode="External"' ext/word/_rels/ 2>/dev/null

```

  1. 载荷提取:
  1. 动态验证(沙箱):

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.