Analyzing malicious office macros

From meltedinhex/analyst-ai-pack · View interactive version

Analyzing malicious office macros is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. Analyzes malicious Office documents by extracting and reviewing VBA macros and OLE/OOXML structure: auto-exec triggers, obfuscation, dropped payloads, and shell/PowerShell invocation. Activates for requests to analyze a malicious Word/Excel document, VBA macro, or maldoc.

How to use this skill

Skill file

Analyzing Malicious Office Macros

When to Use

Do not use the document's "Enable Content" path to analyze it — never open a maldoc in

Office. Extract and read the macro statically; detonate only in the isolated lab if needed.

Prerequisites

Safety & Handling

Workflow

Step 1: Identify the container and locate macros

OOXML (.docm, .xlsm) is a ZIP; legacy (.doc, .xls) is OLE2. Macros live in a

vbaProject.bin OLE stream. Extract it:

python scripts/analyst.py extract maldoc.docm

Step 2: Flag auto-exec triggers

Look for entry points that run without user action beyond enabling macros:

AutoOpen, Document_Open, AutoClose, Workbook_Open, Auto_Open, Document_Close

Step 3: Find suspicious calls

Identify execution and download primitives:

Shell, WScript.Shell, CreateObject, powershell, cmd /c
URLDownloadToFile, MSXML2.XMLHTTP, ADODB.Stream (drop to disk)
Environ, GetObject("winmgmts:") (WMI)

Step 4: Deobfuscate

Maldocs commonly use Chr()/string concatenation, base64, and split-and-join. Resolve these to

recover the real command and any URL or dropped path.

Step 5: Extract IOCs and the next stage

Pull URLs, dropped file paths, and the spawned command line. These become the report's IOCs

and pivot points.

Validation

Pitfalls

p-code if the source looks empty.

References

indicator scanner.

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.