SkillsGrove
SkillsGrove/Documents bureautiques/meltedinhex/analyst-ai-pack/analyzing-malicious-pdfs

analyzing-malicious-pdfs

Installation

$npx skills add https://github.com/meltedinhex/analyst-ai-pack --skill analyzing-malicious-pdfs
$git clone --depth 1 https://github.com/meltedinhex/analyst-ai-pack.git /tmp/analyst-ai-pack && mkdir -p ~/.claude/skills && cp -r /tmp/analyst-ai-pack/skills/analyzing-malicious-pdfs ~/.claude/skills/analyzing-malicious-pdfs
Installe pour moi cette Agent Skill : https://github.com/meltedinhex/analyst-ai-pack/tree/629b765c96ed877eaee3585c834f29026835044d/skills/analyzing-malicious-pdfs — lis d’abord son SKILL.md et ses scripts, et ne l’installe dans mon dossier de compétences qu’après avoir vérifié qu’elle est sûre.

Résumé

Description d’origine · Apache-2.0Analyzes malicious PDF documents: parsing the object structure for JavaScript, OpenAction/launch triggers, embedded files, and URIs, then extracting and decoding suspicious streams without opening the document in a reader. Activates for requests to analyze a malicious PDF, inspect PDF JavaScript, or extract embedded payloads from a PDF.
Le SKILL.md ci-dessous est reproduit depuis meltedinhex/analyst-ai-pack (commit 629b765) sous licence Apache-2.0. Le texte est inchangé ; seules les métadonnées d’en-tête du fichier sont omises, les images sont affichées sous forme de liens et les fichiers très longs sont tronqués. Copyright the AnalystAIPack contributors.. Licence : skills/analyzing-malicious-pdfs/LICENSE. Seul le fichier d’instructions est affiché ; consultez le dépôt d’origine pour les éventuels scripts.

Analyzing Malicious PDFs

When to Use

  • You have a suspicious PDF (often from phishing) and must determine if it is weaponized.
  • You need to find auto-executing actions, embedded JavaScript, launch actions, or embedded files.
  • You want to extract and decode suspicious streams safely.

Do not use a PDF reader to "just look" — opening in a viewer can trigger the very actions you are investigating. Parse the structure statically.

Prerequisites

  • A PDF object parser (Python, or pdfid/pdf-parser/peepdf); the sample handled inertly.

Safety & Handling

  • Never open the PDF in a graphical reader; parse the raw object structure only.
  • Defang any extracted URLs and store embedded payloads password-protected.

Workflow

Step 1: Triage the object inventory

Count high-risk keywords: /JavaScript, /JS, /OpenAction, /AA, /Launch, /EmbeddedFile, /URI, /RichMedia. Their presence (especially auto-actions) flags weaponization.

python scripts/analyst.py triage sample.pdf

Step 2: Locate auto-execution triggers

Resolve /OpenAction and /AA (additional actions) to see what runs on open, and any /Launch actions that spawn external programs.

Step 3: Extract and decode streams

Pull JavaScript and suspicious streams, applying filters (/FlateDecode, /ASCIIHexDecode) to get the cleartext; deobfuscate layered JS as needed.

Step 4: Recover payloads and IOCs

Extract embedded files and URIs; hash payloads, defang URLs, and route extracted executables to PE analysis.

Validation

  • Auto-execution triggers (/OpenAction, /AA, /Launch) are resolved to concrete actions.
  • JavaScript/streams are decoded through their filters, not left encoded.
  • Embedded payloads and URIs are extracted, hashed, and defanged.

Pitfalls

  • Opening the PDF in a reader and triggering the payload.
  • Missing object-stream (/ObjStm) compressed objects that hide the malicious content.
  • Stopping at the first JS layer when it is multiply obfuscated.

References

Voir le texte intégral de la licence (Apache-2.0)
Apache License 2.0 — see the repository root LICENSE file for the full text.

Copyright the AnalystAIPack contributors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0