analyzing-pdf-malware-with-pdfid

analyzing-pdf-malware-with-pdfid is a skill for Claude Code from killvxk/cybersecurity-skills-zh. It costs 110 tokens per session (3,570 once invoked), scanned A, original, Apache-2.0.

A guide for examining a PDF’s internal structure to find malicious content without opening it in a PDF reader. It looks for JavaScript, automatic actions, exploit code, embedded files, and other suspicious objects.

In plain words
What is it for?
Use it to screen suspicious PDFs, extract embedded scripts or files, investigate PDF exploits, and prepare samples for further malware analysis.
Why use it?
It helps classify risky PDF attachments safely before they are opened and reveals possible attack methods or embedded payloads.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cybersecurity-skills-zh plugin — 58 skills shipped together

Good fit Use it to screen suspicious PDFs, extract embedded scripts or files, investigate PDF exploits, and prepare samples for further malware analysis.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-pdf-malware-with-pdfid
Clone the repo
git clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zh

Made for: Claude Code.

Or install cybersecurity-skills-zh, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-pdf-malware-with-pdfid

README.md
[![agentmods](https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid/github.svg)](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid)
Your own site
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-pdf-malware-with-pdfid

Your own site · 80×15
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-pdf-malware-with-pdfid.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,570 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00110 $0.03570
Opus 5 $0.00055 $0.01785
Sonnet 5 $0.00022 $0.00714
Haiku 4.5 $0.00011 $0.00357

Measured 11d ago against content hash 0d437a0731f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

analyzing-pdf-malware-with-pdfid scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
skills/analyzing-pdf-malware-with-pdfid/SKILL.md · 341 lines

How it starts

The opening of the file, as written. The whole thing — 341 lines — stays where its author put it; the contents beside it link to each section on GitHub.

使用 PDFiD 分析 PDF 恶意软件

适用场景

  • 可疑 PDF 附件被电子邮件安全系统标记或由用户报告
  • 需要确定 PDF 是否包含嵌入的 JavaScript、shellcode 或漏洞利用代码
  • 在沙箱或分析环境中打开 PDF 文件前进行分类筛查
  • 从恶意 PDF 对象中提取嵌入的可执行文件、脚本或 URL
  • 分析针对 Adobe Reader 或其他 PDF 查看器漏洞的 PDF 漏洞利用工具包

不适用于分析 PDF 的视觉渲染内容;本流程用于对 PDF 文件格式进行结构化分析以检测恶意对象。

前置条件

  • Python 3.8+,安装 Didier Stevens 的 PDF 工具(pip install pdfid pdf-parser
  • peepdf,用于交互式 PDF 分析(pip install peepdf
  • poppler-utils 中的 pdftotext,用于安全提取文本内容
  • 带有 PDF 专用规则的 YARA,用于恶意软件家族识别
  • 隔离的分析虚拟机(未安装 PDF 阅读器,防止意外打开)
  • CyberChef,用于解码嵌入的 Base64、十六进制或 deflate 流

工作流程

步骤 1:使用 PDFiD 进行初步分类

扫描 PDF 中的可疑关键词和结构:

# 运行 PDFiD 识别可疑元素
pdfid suspect.pdf

# 预期输出分析:
# /JS           - JavaScript(高风险)
# /JavaScript   - JavaScript 对象(高风险)
# /AA           - 打开时自动触发的动作(高风险)
# /OpenAction   - 文档打开时的动作(高风险)
# /Launch       - 启动外部应用程序(高风险)
# /EmbeddedFile - 嵌入文件(中风险)
# /RichMedia    - Flash 内容(中风险)
# /ObjStm       - 对象流(用于混淆)
# /URI          - URL 引用(情境风险)
# /AcroForm     - 交互式表单(中风险)

# 运行带额外详情的模式
pdfid -e suspect.pdf

# 运行拆解模式(重命名可疑关键词)
pdfid -d suspect.pdf
PDFiD 风险评估:
━━━━━━━━━━━━━━━━━━━━━
高风险指标(任意计数 > 0):
  /JS, /JavaScript  -> 嵌入 JavaScript 代码
  /AA               -> 自动动作(无需用户交互即触发)
  /OpenAction       -> 文档打开时执行代码
  /Launch           -> 可启动外部可执行文件
  /JBIG2Decode      -> 与 CVE-2009-0658 漏洞利用相关

中风险指标:
  /EmbeddedFile     -> 包含嵌入文件(可能是 EXE/DLL)
  /RichMedia        -> Flash/多媒体(Flash 漏洞利用)
  /AcroForm         -> 带有可能提交动作的表单
  /XFA              -> XML 表单架构(复杂攻击面)

低风险指标:
  /ObjStm           -> 对象流(混淆技术)
  /URI              -> 外部 URL 引用
  /Page             -> 页面数量(仅供参考)

步骤 2:使用 pdf-parser 解析 PDF 结构

检查 PDFiD 标记的可疑对象:

# 列出所有引用 JavaScript 的对象
pdf-parser --search "/JavaScript" suspect.pdf
pdf-parser --search "/JS" suspect.pdf

# 列出所有带 OpenAction 的对象
pdf-parser --search "/OpenAction" suspect.pdf

# 按 ID 提取特定对象(示例:对象 5)
pdf-parser --object 5 suspect.pdf

# 提取并解压流内容
pdf-parser --object 5 --filter --raw suspect.pdf

# 搜索嵌入文件
pdf-parser --search "/EmbeddedFile" suspect.pdf

# 列出所有对象及其类型
pdf-parser --stats suspect.pdf

Read the full file on GitHub · 341 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 341 lines · 110 tokens per session scan A 0d437a0731f3

Subscribe to this mod's changes

analyzing-pdf-malware-with-pdfid is a skill published in the GitHub repository killvxk/cybersecurity-skills-zh (44 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 110 tokens to every session and 3,570 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

mukul975/Anthropic-Cybersecurity-Skills · 84 tokens

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

26zl/cybersec-toolkit · 84 tokens

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

pinkpixel-dev/skills-collection-1 · 84 tokens

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

Youngmaidainon/Agent-Level-Up · 84 tokens

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

Mikaru0Mystic/sectinel · 84 tokens

analyzing-pdf-malware-with-pdfid

Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious…

RobotFlow-Labs/skills-repo · 84 tokens