
Exploit PoC for CVE-2025-64512 targeting insecure deserialization in pdfminer.six. Generates malicious pickle payload and produces exploit PDFs for RCE via web file upload.
본 개념 증명(PoC)은 승인된 보안 테스트 및 교육 목적으로만 제공됩니다.
소유한 시스템 또는 명시적인 서면 테스트 허가를 받은 시스템에서만 사용하십시오. 작성자는 이 코드로 인한 오용이나 손해에 대해 책임지지 않습니다.
CVE-2025-64512는 PDF 파일에서 텍스트와 메타데이터를 추출하는 널리 사용되는 Python 라이브러리인 pdfminer.six의 치명적인 취약점입니다. 이 결함은 악성 PDF를 처리할 때 pickle 데이터의 안전하지 않은 역직렬화를 통해 **원격 코드 실행(RCE)**을 허용합니다.
이 취약점은 일반적으로 pdfminer.six를 사용하여 업로드된 PDF 문서를 구문 분석하는 웹 애플리케이션의 파일 업로드 기능을 통해 트리거됩니다 (예: 문서 관리 시스템, 보고 도구, 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.