본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트35k · #7643

analyzing-pdf-malware-with-pdfid

하는 일

이 도구는 문서를 열지 않고도 악성 코드(JavaScript나 익스플로잇 등)를 찾기 위해 의심스러운 PDF 파일을 분석합니다. 공격이 어떻게 시작되었는지 파악하고, 위험한 부분을 추출해 추가 분석할 수 있게 합니다.

사용하는 경우

  • ✓이메일로 의심스러운 PDF 첨부 파일을 받았을 때.
  • ✓열기 전에 PDF에 악성 코드가 있는지 확인해야 할 때.
  • ✓PDF를 이용한 공격이 어떻게 일어났는지 조사할 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-pdf-malware-with-pdfid/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-pdf-malware-with-pdfid/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 PDF를 분석해서 악성 코드가 들어 있는지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 다른 프로그램을 사용해 PDF의 내부 구조를 살핍니다. 파일을 열지 않고도 숨겨진 스크립트나 자동으로 실행되는 명령 같은 위험 신호를 찾습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Analyzing PDF Malware with PDFiD

When to Use

  • A suspicious PDF attachment has been flagged by email security or reported by a user
  • You need to determine if a PDF contains embedded JavaScript, shellcode, or exploit code
  • Triaging PDF documents before opening them in a sandbox or analysis environment
  • Extracting embedded executables, scripts, or URLs from malicious PDF objects
  • Analyzing PDF exploit kits targeting Adobe Reader or other PDF viewer vulnerabilities

Do not use for analyzing the rendered visual content of a PDF; this is for structural analysis of the PDF file format for malicious objects.

Prerequisites

  • Python 3.8+ with Didier Stevens' PDF tools installed (pip install pdfid pdf-parser)
  • peepdf installed for interactive PDF analysis (pip install peepdf)
  • pdftotext from poppler-utils for extracting text content safely
  • YARA with PDF-specific rules for malware family identification
  • Isolated analysis VM without a PDF reader installed (prevent accidental opening)
  • CyberChef for decoding embedded Base64, hex, or deflate streams

Workflow

Step 1: Initial Triage with PDFiD

Scan the PDF for suspicious keywords and structures:

# Run PDFiD to identify suspicious elements
pdfid suspect.pdf

# Expected output analysis:
# /JS           - JavaScript (HIGH risk)
# /JavaScript   - JavaScript object (HIGH risk)
# /AA           - Auto-Action triggered on open (HIGH risk)
# /OpenAction   - Action on document open (HIGH risk)
# /Launch       - Launch external application (HIGH risk)
# /EmbeddedFile - Embedded file (MEDIUM risk)
# /RichMedia    - Flash content (MEDIUM risk)
# /ObjStm       - Object stream (used for obfuscation)
# /URI          - URL reference (contextual risk)
# /AcroForm     - Interactive form (MEDIUM risk)

# Run with extra detail
pdfid -e suspect.pdf

# Run with disarming (rename suspicious keywords)
pdfid -d suspect.pdf
PDFiD Risk Assessment:
━━━━━━━━━━━━━━━━━━━━━
HIGH RISK indicators (any count > 0):
  /JS, /JavaScript  -> Embedded JavaScript code
  /AA               -> Automatic Action (triggers without user interaction)
  /OpenAction       -> Code runs when document is opened
  /Launch           -> Can launch external executables
  /JBIG2Decode      -> Associated with CVE-2009-0658 exploit

MEDIUM RISK indicators:
  /EmbeddedFile     -> Contains embedded files (could be EXE/DLL)
  /RichMedia        -> Flash/multimedia (Flash exploits)
  /AcroForm         -> Form with possible submit action
  /XFA              -> XML Forms Architecture (complex attack surface)

LOW RISK indicators:
  /ObjStm           -> Object streams (obfuscation technique)
  /URI              -> External URL references
  /Page             -> Number of pages (context only)

Step 2: Parse PDF Structure with pdf-parser

Examine suspicious objects identified by PDFiD:

# List all objects referencing JavaScript
pdf-parser --search "/JavaScript" suspect.pdf
pdf-parser --search "/JS" suspect.pdf

# List all objects with OpenAction
pdf-parser --search "/OpenAction" suspect.pdf

# Extract a specific object by ID (example: object 5)
pdf-parser --object 5 suspect.pdf

# Extract and decompress stream content
pdf-parser --object 5 --filter --raw suspect.pdf

# Search for embedded files
pdf-parser --search "/EmbeddedFile" suspect.pdf

# List all objects with their types
pdf-parser --stats suspect.pdf

Step 3: Extract and Analyze Embedded JavaScript

Pull out JavaScript code from PDF objects:

# Extract JavaScript using pdf-parser
pdf-parser --search "/JS" --raw --filter suspect.pdf > extracted_js.txt

# Alternative: Use peepdf for interactive JavaScript extraction
peepdf -f -i suspect.pdf << 'EOF'
js_analyse
EOF

# peepdf interactive commands for JS analysis:
# js_analyse          - Extract and show all JavaScript code
# js_beautify         - Format extracted JavaScript
# js_eval <object>    - Evaluate JavaScript in sandboxed environment
# object <id>         - Display object content
# rawobject <id>      - Display raw object bytes
# stream <id>         - Display decompressed stream
# offsets             - Show object offsets in file
# Python script for comprehensive PDF JavaScript extraction
import subprocess
import re

# Extract all streams and search for JavaScript
result = subprocess.run(
    ["pdf-parser", "--stats", "suspect.pdf"],
    capture_output=True, text=True
)

# Find object IDs containing JavaScript references
js_objects = []

…
자주 묻는 질문

의심스러운 PDF를 왜 열면 안 되나요?

악성 PDF를 열면 위험한 코드가 실행되어 컴퓨터를 감염시키거나 정보를 훔칠 수 있습니다.

PDF의 '익스플로잇'이란 무엇인가요?

PDF 리더 같은 소프트웨어의 취약점을 악용해 원치 않는 동작을 수행하는 코드입니다.

PDF의 JavaScript란 무엇인가요?

PDF에 넣어 상호작용 기능을 더하는 코드입니다. 하지만 악의적인 목적으로 쓰일 수도 있습니다.

상세 정보

작성자의 원본 설명

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 document analysis, PDF exploit investigation, or suspicious attachment triage. '

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7643
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬