abusing-dpapi-for-cred…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using…
Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to
$ npx -y skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-pdf-malware-with-pdfid --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/analyzing-pdf-malware-with-pdfidContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to
name: analyzing-pdf-malware-with-pdfid description: '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. ' domain: cybersecurity subdomain: malware-analysis tags: - malware - PDF-analysis - document-malware - PDFiD - static-analysis version: 1.0.0 author: mahipal license: Apache-2.0 nist_csf: - DE.AE-02 - RS.AN-03 - ID.RA-01 - DE.CM-01 mitre_attack: - T1204.002 - T1566.001 - T1059.007 - T1027
**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.
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)
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
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 = []
for line in result.stdout.split('\n'):
if '/JavaScript' in line or '/JS' in line:
obj_id = re.search(r'obj (\d+)', line)
if obj_id:
js_objects.append(obj_id.group(1))
# Extract each JavaScript-containing object
for obj_id in js_objects:
result = subprocess.run(
["pdf-parser", "--object", obj_id, "--filter", "--raw", "suspect.pdf"],
capture_output=True, text=True
)
print(f"\n=== Object {obj_id} ===")
print(result.stdout[:2000])Extract and examine shellcode from PDF exploits:
# Extract raw stream data for shellcode analysis pdf-parser --object 7 --filter --raw --dump shellcode.bin suspect.pdf # Analyze shellcode wi
817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platforms · 29 security domains · Apache 2.0
Repo: mukul975/Anthropic-Cybersecurity-Skills
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using…
Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or…
Prepare a defense-contractor environment for CMMC Level 2 certification: scope CUI and FCI, implement the 110 NIST SP 800-171 Rev 2 security requirements…
Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification…
Detect dangerous ACL misconfigurations in Active Directory using ldap3
Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection,…