
Analyzing Malicious PDF
FreePerform static analysis on malicious PDF documents.
Free · Opens the source repo
What Analyzing Malicious PDF does
The Analyzing Malicious PDF skill leverages tools like peepdf, pdfid, and pdf-parser to conduct thorough static analysis on potentially harmful PDF files. This skill is particularly useful for cybersecurity professionals who need to assess the risk posed by PDF attachments, especially in the context of phishing attacks. By using this skill, users can extract embedded JavaScript, shellcode, and other suspicious objects, providing critical insights into the nature of the threat.
The workflow begins with an initial triage using pdfid to scan for suspicious keywords such as '/JS' or '/OpenAction', which may indicate malicious intent. Users can then delve deeper into the PDF structure with peepdf, allowing for an interactive analysis that reveals hidden elements and potential exploits. The skill facilitates the extraction of content from these PDFs, enabling users to decode various filters and analyze embedded scripts for malicious behavior.
Additionally, the skill integrates with VirusTotal to cross-reference the file hash against known malware signatures, enhancing the detection process. By generating indicators of compromise (IOCs), users can create detection signatures that help in identifying future threats. This skill is designed for malware analysts, digital forensics experts, and cybersecurity researchers who require a reliable method for analyzing PDF-based exploits and enhancing their threat detection capabilities.
In summary, the Analyzing Malicious PDF skill is a comprehensive tool for those involved in cybersecurity, providing a structured approach to dissecting and understanding the risks associated with malicious PDF documents.
When to use it
Use this skill when you need to analyze suspicious PDF documents, especially those received via phishing emails or during forensic investigations.
When not to use it
This skill is not suitable for dynamic analysis or real-time threat detection; it focuses on static analysis of PDF files only.
What you can build with it
Phishing Email Analysis
Quickly analyze PDF attachments from phishing emails to assess potential threats.
Malware Research
Conduct in-depth research on PDF-based exploits to understand their structure and behavior.
Forensic Investigations
Use this skill during forensic examinations to extract and analyze malicious PDF artifacts.
How to install Analyzing Malicious PDF
View source1. Install with the skills CLI
npx skills add mukul975/anthropic-cybersecurity-skills/analyzing-malicious-pdf-with-peepdf --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mukul975Analyzing Malicious PDF with peepdf
When to Use
- When triaging suspicious PDF attachments from phishing emails
- During malware analysis of PDF-based exploit documents
- When extracting embedded JavaScript, shellcode, or executables from PDFs
- For forensic examination of weaponized document artifacts
- When building detection signatures for PDF-based threats
Prerequisites
- Python 3.8+ with peepdf-3 installed (pip install peepdf-3)
- pdfid.py and pdf-parser.py from Didier Stevens suite
- Isolated analysis environment (VM or sandbox)
- Optional: PyV8 for JavaScript emulation within peepdf
- Optional: Pylibemu for shellcode analysis
Workflow
- Triage with pdfid: Scan PDF for suspicious keywords (/JS, /JavaScript, /OpenAction, /Launch, /EmbeddedFile).
- Interactive Analysis: Open PDF in peepdf interactive mode to explore object structure.
- Identify Suspicious Objects: Locate objects containing JavaScript, streams, or encoded data.
- Extract Content: Dump suspicious streams and decode filters (FlateDecode, ASCIIHexDecode).
- Deobfuscate JavaScript: Analyze extracted JS for shellcode, heap sprays, or exploit code.
- Check VirusTotal: Use peepdf vtcheck to cross-reference file hash with AV detections.
- Generate IOCs: Extract URLs, domains, hashes, and shellcode signatures.
Key Concepts
| Concept | Description |
|---|---|
| /OpenAction | Automatic action executed when PDF is opened |
| /JavaScript /JS | Embedded JavaScript code in PDF objects |
| /Launch | Action that launches external applications |
| /EmbeddedFile | File embedded within the PDF structure |
| FlateDecode | zlib compression filter used to hide content |
| Object Streams | PDF objects stored in compressed streams |
Tools & Systems
| Tool | Purpose |
|---|---|
| peepdf / peepdf-3 | Interactive PDF analysis with JS emulation |
| pdfid.py | Quick triage scanning for suspicious keywords |
| pdf-parser.py | Deep object-level PDF parsing |
| VirusTotal | Hash lookup and AV detection cross-reference |
| CyberChef | Decode and transform extracted payloads |
Output Format
Analysis Report: PDF-MAL-[DATE]-[SEQ]
File: [filename.pdf]
SHA-256: [hash]
Suspicious Keywords: [/JS, /OpenAction, etc.]
Objects with JavaScript: [Object IDs]
Extracted URLs: [List]
Shellcode Detected: [Yes/No]
Embedded Files: [Count and types]
VirusTotal Detections: [X/Y engines]
Risk Level: [Critical/High/Medium/Low]
Frequently asked questions about Analyzing Malicious PDF
Similar skills
Security Triage
Efficiently manage OpenClaw security advisories.
OSS Security Forensics
Investigate open-source supply chain attacks effectively.
Security Advisory Management
Streamline your response to GitHub Security Advisories.
Bumblebee Security Scan
Detect compromised packages on macOS/Linux.
Incident Runbook Templates
Streamline your incident response with structured templates.
Memory Forensics
Analyze memory dumps for incident response and malware detection.
